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-forward to 37c87a8
Date Mon, 09 Sep 2013 21:01:55 GMT
Updated Branches:
  refs/heads/4.2-forward 2e3104ac1 -> 37c87a84f


CLOUDSTACK-4619: UI > Infrastructure > zone > Using listApis to check existence of
listVmwareDcs API command will show an error in the log when listVmwareDcs API command doesn't
exist (in oss build).
So, still use listClusters to determine the existence of listVmwareDcs API command.


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

Branch: refs/heads/4.2-forward
Commit: 37c87a84fa49985c6bd2aade8a96f47daf6244c8
Parents: 2e3104a
Author: Jessica Wang <jessicawang@apache.org>
Authored: Mon Sep 9 14:00:26 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Mon Sep 9 14:00:26 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js | 55 +++++++++++++++++++++++++++--------------------
 1 file changed, 32 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/37c87a84/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index d677a49..3f5a5d4 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -6096,30 +6096,39 @@
                                                     });
 
                                                     $.ajax({
-                                                    	url: createURL('listApis'),
+                                                    	url: createURL('listClusters'),
                                                     	data: {
-                                                    		name: 'listVmwareDcs'             
                                      		
-                                                    	},
-                                                    	async: false,
-                                                    	success: function(json) {          
                                         		
-                                                    		$.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) {}
//suppress error dialog by overriding default error handling: cloudStack.dialog.notice({ message:
parseXMLHttpResponse(XMLHttpResponse)});   
-                                                    });                                 
                                                                    
+                                                            zoneid: args.context.physicalResources[0].id
+                                                        },
+                                                        async: false,
+                                                        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