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/09/06 19:28:33 UTC
git commit: updated refs/heads/4.2-forward to 3f492ca
Updated Branches:
refs/heads/4.2-forward 751fe8e33 -> 3f492ca2e
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/3f492ca2
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3f492ca2
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3f492ca2
Branch: refs/heads/4.2-forward
Commit: 3f492ca2ea24c74e9628d015ddc2b8b8387ce6b4
Parents: 751fe8e
Author: Jessica Wang <je...@apache.org>
Authored: Fri Sep 6 10:27:52 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Fri Sep 6 10:28:03 2013 -0700
----------------------------------------------------------------------
ui/scripts/system.js | 43 ++++++++++++++++++++++++++++++-------------
1 file changed, 30 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3f492ca2/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";