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/master to 0e695ec
Date Fri, 06 Sep 2013 17:29:33 GMT
Updated Branches:
  refs/heads/master eb390fba2 -> 0e695ec7e


CLOUDSTACK-4619: UI > zone detail page > check if the zone has any cluster whose hypervisor
is VMware. If not, skip calling listVmwareDcs API.


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

Branch: refs/heads/master
Commit: 0e695ec7e0cc8e26059e8b91a0af0a667d9ed420
Parents: eb390fb
Author: Jessica Wang <jessicawang@apache.org>
Authored: Fri Sep 6 10:27:52 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Fri Sep 6 10:29:24 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js | 43 ++++++++++++++++++++++++++++++-------------
 1 file changed, 30 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0e695ec7/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 8b09260..32d0e56 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -6096,22 +6096,39 @@
                                                     });
 
                                                     $.ajax({
-                                                        url: createURL('listVmwareDcs'),
//listVmwareDcs API exists in only non-oss bild
-                                                        data: {
+                                                    	url: createURL('listClusters'),
+                                                    	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;
-                                                            }
-                                                        },
-                                                        error: function(XMLHttpResponse)
{} //override default error handling: cloudStack.dialog.notice({ message: parseXMLHttpResponse(XMLHttpResponse)});
  
-                                                    });
-
+                                                        success: function(json) {       
                                                	
+                                                        	var clusters = json.listclustersresponse.cluster;
+                                                        	if (clusters != null) {
+                                                        		for (var i = 0; i < clusters.length;
i++) {                                                        			
+                                                        			if (clusters[i].hypervisortype
== 'VMware') {                                                        				
+                                                        				$.ajax({
+                                                                            url: createURL('listVmwareDcs'),
//listVmwareDcs API exists in only non-oss bild
+                                                                            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;
+                                                                                }
+                                                                            }
+                                                                            //, error: function(XMLHttpResponse)
{} //override default error handling: cloudStack.dialog.notice({ message: parseXMLHttpResponse(XMLHttpResponse)});
  
+                                                                        });             
                                          				
+                                                        				
+                                                        				break;
+                                                        			}
+                                                        		}                             
                          		
+                                                        	}                              
                         	
+                                                        }
+                                                    });                         
                                                     // for testing only (begin)
                                                     /*
 						                            selectedZoneObj.vmwaredcName = "datacenter";


Mime
View raw message