You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2013/06/04 01:28:20 UTC

git commit: updated refs/heads/master to bfe05ac

Updated Branches:
  refs/heads/master ddfdc9af6 -> bfe05acd9


CLOUDSTACK-2782: UI - Infrastructure menu - zone detail page - add new action Add VMWare DC.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/bfe05acd
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/bfe05acd
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/bfe05acd

Branch: refs/heads/master
Commit: bfe05acd95e8327cce96bc9a300f3803d03f9cce
Parents: ddfdc9a
Author: Jessica Wang <je...@apache.org>
Authored: Mon Jun 3 16:26:35 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Mon Jun 3 16:28:09 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js |   71 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 70 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bfe05acd/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 80dd0bf..0bdb5b8 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -5373,7 +5373,74 @@
 
               detailView: {
                 isMaximized: true,
-                actions: {
+                actions: {                  
+                  addVmwareDc: {
+                    label: 'Adds a VMware datacenter',
+                    messages: {                      
+                      notification: function(args) {
+                        return 'Adds a VMware datacenter';
+                      }
+                    },
+                    createForm: {
+                      title: 'Adds a VMware datacenter',
+                      fields: {
+                        name: { 
+                          label: 'label.name',
+                          validation: { required: true }
+                        },
+                        url: { 
+                          label: 'label.url',
+                          validation: { required: false }
+                        },
+                        username: {
+                          label: 'label.username',
+                          validation: { required: false }
+                        },
+                        password: {
+                          label: 'label.password',
+                          isPassword: true,
+                          validation: { required: false }
+                        },
+                      }
+                    },                    
+                    action: function(args) {
+                      var data = {
+                        zoneid: args.context.physicalResources[0].id,
+                        name: args.data.name
+                      };
+                      
+                      if(args.data.url != null && args.data.url.length > 0) {
+                        $.extend(data, {
+                          url: args.data.url 
+                        })
+                      }
+                      if(args.data.username != null && args.data.username.length > 0) {
+                        $.extend(data, {
+                          username: args.data.username 
+                        })
+                      }
+                      if(args.data.password != null && args.data.password.length > 0) {
+                        $.extend(data, {
+                          password: args.data.password 
+                        })
+                      }
+                      
+                      $.ajax({
+                        url: createURL('addVmwareDc'),  
+                        data: data,                       
+                        success: function(json) {
+                          //var item = json.addvmwaredcresponse.vmwaredc;
+                          args.response.success();
+                        }
+                      });
+                    },
+                    notification: {
+                      poll: function(args) {
+                        args.complete();
+                      }
+                    }
+                  },
+                                                      
                   enable: {
                     label: 'label.action.enable.zone',
                     messages: {
@@ -13204,6 +13271,8 @@
     var jsonObj = args.context.item;
     var allowedActions = ['enableSwift'];
 
+    allowedActions.push('addVmwareDc');
+    
      if(jsonObj.domainid != null)
       allowedActions.push("release");
     else