cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/4.2 to 129f207
Date Thu, 11 Jul 2013 18:12:33 GMT
Updated Branches:
  refs/heads/4.2 eb7b226e6 -> 129f207ef


CLOUDSTACK-3450: UI > Infrastructure menu - zone detail - (1) Add VMware datacenter fields.
(2) Show Remove VMware datacenter action where there is no VMware datacenter attached with
the zone. Show Add VMware datacenter action otherwise.


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

Branch: refs/heads/4.2
Commit: 129f207ef6f9bc1135d78c23da6f4e855175bb79
Parents: eb7b226
Author: Jessica Wang <jessicawang@apache.org>
Authored: Thu Jul 11 11:08:20 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Thu Jul 11 11:12:23 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js | 92 ++++++++++++++++++++++++++++++-----------------
 1 file changed, 59 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/129f207e/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 48874db..876e8e1 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -6155,14 +6155,15 @@
 												  converter:cloudStack.converters.toBooleanText
                         }
                       },
-
-                       {
-
-                       isdedicated:{label:'Dedicated'},
-                       domainid:{label:'Domain ID'}
-
+                      {
+                       isdedicated: {label:'Dedicated'},
+                       domainid: {label:'Domain ID'}
+                      },
+                      {
+                        vmwaredcName: { label: 'VMware datacenter Name' },
+                        vmwaredcVcenter: { label: 'VMware datacenter vcenter' },
+                        vmwaredcId: { label: 'VMware datacenter Id' }
                       }
-
                     ],
                     dataProvider: function(args) {
                       $.ajax({
@@ -6172,30 +6173,51 @@
                         },
                         success: function(json) {
                           selectedZoneObj = json.listzonesresponse.zone[0];
-                             $.ajax({
-                                                    url:createURL("listDedicatedZones&zoneid="
+args.context.physicalResources[0].id),
-                                                    dataType:"json",
-                                                    async:false,
-                                                    success:function(json){
-                                                        if(json.listdedicatedzonesresponse.dedicatedzone
!= undefined){
-                                                          var zoneItem = json.listdedicatedzonesresponse.dedicatedzone[0];
-                                                            if (zoneItem.domainid != null)
{
-                                                            $.extend(selectedZoneObj, zoneItem
, { isdedicated: 'Yes' });
-                                                          }
-                                                        }
-                                                        else
-                                                            $.extend(selectedZoneObj,{ isdedicated:
'No' })
-
-                                                    },
-                                                  error:function(json){
-                                                       args.response.error(parseXMLHttpResponse(XMLHttpResponse));
-                                                  }
-                                              });
+                          $.ajax({
+                            url: createURL("listDedicatedZones&zoneid=" +args.context.physicalResources[0].id),
+                            dataType: "json",
+                            async: false,
+                            success: function(json){
+                              if(json.listdedicatedzonesresponse.dedicatedzone != undefined)
{
+                                var zoneItem = json.listdedicatedzonesresponse.dedicatedzone[0];
+                                if (zoneItem.domainid != null) {
+                                  $.extend(selectedZoneObj, zoneItem , { isdedicated: 'Yes'
});
+                                }
+                              }
+                              else {
+                                $.extend(selectedZoneObj, { isdedicated: 'No' })
+                              }
+                            }
+                          });
+                           
+                          $.ajax({
+                            url: createURL('listVmwareDcs'),
+                            data: {
+                              zoneid: args.context.physicalResources[0].id
+                            },
+                            async: false,
+                            success: function(json) { //e.g. json == { "listvmwaredcsresponse"
{ "count":1 ,"VMwareDC" [ {"id":"c3c2562d-65e9-4fc7-92e2-773c2efe8f37","zoneid":1,"name":"datacenter","vcenter":"10.10.20.20"}
] } } 
+                              var vmwaredcs = json.listvmwaredcsresponse.VMwareDC;
+                              if(vmwaredcs != null) {
+                                selectedZoneObj.vmwaredcName = vmwaredcs[0].name;
+                                selectedZoneObj.vmwaredcVcenter = vmwaredcs[0].vcenter;
+                                selectedZoneObj.vmwaredcId = vmwaredcs[0].id;
+                              }                              
+                            }                         
+                          });                            
+                           
+                          // for testing only (begin)
+                          /*
+                          selectedZoneObj.vmwaredcName = "datacenter";
+                          selectedZoneObj.vmwaredcVcenter = "10.10.20.20";
+                          selectedZoneObj.vmwaredcId = "c3c2562d-65e9-4fc7-92e2-773c2efe8f37";
+                          */
+                          // for testing only (end)
+                          
                           args.response.success({
-                                                actionFilter: zoneActionfilter,
-                                                data: selectedZoneObj
+                            actionFilter: zoneActionfilter,
+                            data: selectedZoneObj
                           });
-
                         }
                       });
                     }
@@ -14969,19 +14991,23 @@
     var jsonObj = args.context.item;
     var allowedActions = ['enableSwift'];
 
-    allowedActions.push('addVmwareDc');
-    allowedActions.push('removeVmwareDc');
+    if(jsonObj.vmwaredcId == null)
+      allowedActions.push('addVmwareDc');
+    else
+      allowedActions.push('removeVmwareDc');
     
-     if(jsonObj.domainid != null)
+    if(jsonObj.domainid != null)
       allowedActions.push("releaseDedicatedZone");
     else
-    allowedActions.push("dedicateZone");
+      allowedActions.push("dedicateZone");
 
     allowedActions.push("edit");
+    
     if(jsonObj.allocationstate == "Disabled")
       allowedActions.push("enable");
     else if(jsonObj.allocationstate == "Enabled")
       allowedActions.push("disable");
+    
     allowedActions.push("remove");
     return allowedActions;
   }


Mime
View raw message