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')
|
this.apiParams = this.$getApiParams('createKubernetesCluster')
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.networks = [
|
this.emptyEntry = {
|
||||||
{
|
id: null,
|
||||||
id: null,
|
name: ''
|
||||||
name: ''
|
}
|
||||||
}
|
this.networks = [this.emptyEntry]
|
||||||
]
|
this.keyPairs = [this.emptyEntry]
|
||||||
this.keyPairs = [
|
|
||||||
{
|
|
||||||
id: null,
|
|
||||||
name: ''
|
|
||||||
}
|
|
||||||
]
|
|
||||||
this.initForm()
|
this.initForm()
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
},
|
},
|
||||||
@ -322,7 +316,6 @@ export default {
|
|||||||
},
|
},
|
||||||
fetchData () {
|
fetchData () {
|
||||||
this.fetchZoneData()
|
this.fetchZoneData()
|
||||||
this.fetchNetworkData()
|
|
||||||
this.fetchKeyPairData()
|
this.fetchKeyPairData()
|
||||||
},
|
},
|
||||||
isValidValueForKey (obj, key) {
|
isValidValueForKey (obj, key) {
|
||||||
@ -417,14 +410,16 @@ export default {
|
|||||||
params.zoneid = this.selectedZone.id
|
params.zoneid = this.selectedZone.id
|
||||||
}
|
}
|
||||||
this.networkLoading = true
|
this.networkLoading = true
|
||||||
|
this.networks = []
|
||||||
api('listNetworks', params).then(json => {
|
api('listNetworks', params).then(json => {
|
||||||
var listNetworks = json.listnetworksresponse.network
|
var listNetworks = json.listnetworksresponse.network
|
||||||
if (this.arrayHasItems(listNetworks)) {
|
if (this.arrayHasItems(listNetworks)) {
|
||||||
listNetworks = listNetworks.filter(n => n.type !== 'L2')
|
listNetworks = listNetworks.filter(n => n.type !== 'L2')
|
||||||
this.networks = this.networks.concat(listNetworks)
|
this.networks = listNetworks
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.networkLoading = false
|
this.networkLoading = false
|
||||||
|
this.networks = [this.emptyEntry].concat(this.networks)
|
||||||
if (this.arrayHasItems(this.networks)) {
|
if (this.arrayHasItems(this.networks)) {
|
||||||
this.form.networkid = 0
|
this.form.networkid = 0
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user