mirror of https://github.com/apache/cloudstack.git
ui: fix add Vmware cluster (#4663)
When adding a cluster from existing host-datacenter UI shoudl list and autofill host, DC name while making addCluster API call. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
a234501172
commit
fef0e66764
|
|
@ -216,11 +216,35 @@ export default {
|
|||
|
||||
if (this.hypervisor === 'VMware') {
|
||||
this.clustertype = 'ExternalManaged'
|
||||
if ((this.host === null || this.host.length === 0) &&
|
||||
(this.dataCenter === null || this.dataCenter.length === 0)) {
|
||||
api('listVmwareDcs', {
|
||||
zoneid: this.zoneId
|
||||
}).then(response => {
|
||||
var vmwaredcs = response.listvmwaredcsresponse.VMwareDC
|
||||
if (vmwaredcs !== null) {
|
||||
this.host = vmwaredcs[0].vcenter
|
||||
this.dataCenter = vmwaredcs[0].name
|
||||
}
|
||||
this.addCluster()
|
||||
}).catch(error => {
|
||||
this.$notification.error({
|
||||
message: `${this.$t('label.error')} ${error.response.status}`,
|
||||
description: error.response.data.listvmwaredcsresponse.errortext,
|
||||
duration: 0
|
||||
})
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
this.addCluster()
|
||||
},
|
||||
addCluster () {
|
||||
if (this.hypervisor === 'VMware') {
|
||||
const clusternameVal = this.clustername
|
||||
this.url = `http://${this.host}/${this.dataCenter}/${clusternameVal}`
|
||||
this.clustername = `${this.host}/${this.dataCenter}/${clusternameVal}`
|
||||
}
|
||||
|
||||
this.loading = true
|
||||
this.parentToggleLoading()
|
||||
api('addCluster', {}, 'POST', {
|
||||
|
|
|
|||
Loading…
Reference in New Issue