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/07/12 00:42:16 UTC
git commit: updated refs/heads/master to 20bade6
Updated Branches:
refs/heads/master 62823a292 -> 20bade62f
CLOUDSTACK-3460: UI > Infrastructure menu > clusters > add cluster dialog > when hypervisor is VMware, call listVmwareDcs API to get vCenter Host and vCenter Datacenter value if the 2 fields are not filled (the 2 fields are optional).
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/20bade62
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/20bade62
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/20bade62
Branch: refs/heads/master
Commit: 20bade62f1babb185aec1dca0b3cb148f3eb186e
Parents: 62823a2
Author: Jessica Wang <je...@apache.org>
Authored: Thu Jul 11 15:39:33 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Thu Jul 11 15:41:51 2013 -0700
----------------------------------------------------------------------
ui/scripts/system.js | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20bade62/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 90ede7d..4080b6b 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -10375,7 +10375,24 @@
var hostname = args.data.vCenterHost;
var dcName = args.data.vCenterDatacenter;
-
+
+ if(hostname.length == 0 && dcName.length == 0) {
+ $.ajax({
+ url: createURL('listVmwareDcs'),
+ data: {
+ zoneid: args.data.zoneid
+ },
+ 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) {
+ hostname = vmwaredcs[0].vcenter;
+ dcName = vmwaredcs[0].name;
+ }
+ }
+ });
+ }
+
var url;
if(hostname.indexOf("http://") == -1)
url = "http://" + hostname;