mirror of https://github.com/apache/cloudstack.git
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).
This commit is contained in:
parent
f6e7e58a47
commit
38cb16df36
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue