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:43:01 UTC
git commit: updated refs/heads/4.2 to 38cb16d
Updated Branches:
refs/heads/4.2 f6e7e58a4 -> 38cb16df3
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/38cb16df
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/38cb16df
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/38cb16df
Branch: refs/heads/4.2
Commit: 38cb16df367db3b0e5cfb4b73b08cee183427349
Parents: f6e7e58
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:42:50 2013 -0700
----------------------------------------------------------------------
ui/scripts/system.js | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/38cb16df/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 04d5b8f..3b0fb21 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -10383,7 +10383,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;