mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
ui: fix create k8s cluster multiple listing (#8539)
Fixes #8536 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
80bbb29abf
commit
19250403e6
@ -259,18 +259,12 @@ export default {
|
||||
this.apiParams = this.$getApiParams('createKubernetesCluster')
|
||||
},
|
||||
created () {
|
||||
this.networks = [
|
||||
{
|
||||
this.emptyEntry = {
|
||||
id: null,
|
||||
name: ''
|
||||
}
|
||||
]
|
||||
this.keyPairs = [
|
||||
{
|
||||
id: null,
|
||||
name: ''
|
||||
}
|
||||
]
|
||||
this.networks = [this.emptyEntry]
|
||||
this.keyPairs = [this.emptyEntry]
|
||||
this.initForm()
|
||||
this.fetchData()
|
||||
},
|
||||
@ -322,7 +316,6 @@ export default {
|
||||
},
|
||||
fetchData () {
|
||||
this.fetchZoneData()
|
||||
this.fetchNetworkData()
|
||||
this.fetchKeyPairData()
|
||||
},
|
||||
isValidValueForKey (obj, key) {
|
||||
@ -417,14 +410,16 @@ export default {
|
||||
params.zoneid = this.selectedZone.id
|
||||
}
|
||||
this.networkLoading = true
|
||||
this.networks = []
|
||||
api('listNetworks', params).then(json => {
|
||||
var listNetworks = json.listnetworksresponse.network
|
||||
if (this.arrayHasItems(listNetworks)) {
|
||||
listNetworks = listNetworks.filter(n => n.type !== 'L2')
|
||||
this.networks = this.networks.concat(listNetworks)
|
||||
this.networks = listNetworks
|
||||
}
|
||||
}).finally(() => {
|
||||
this.networkLoading = false
|
||||
this.networks = [this.emptyEntry].concat(this.networks)
|
||||
if (this.arrayHasItems(this.networks)) {
|
||||
this.form.networkid = 0
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user