mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Merge branch 'main' into nsx-integration
This commit is contained in:
commit
e51c400f82
@ -259,18 +259,12 @@ export default {
|
||||
this.apiParams = this.$getApiParams('createKubernetesCluster')
|
||||
},
|
||||
created () {
|
||||
this.networks = [
|
||||
{
|
||||
id: null,
|
||||
name: ''
|
||||
}
|
||||
]
|
||||
this.keyPairs = [
|
||||
{
|
||||
id: null,
|
||||
name: ''
|
||||
}
|
||||
]
|
||||
this.emptyEntry = {
|
||||
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,15 +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')
|
||||
var ids = new Set(this.networks.map(n => n.id))
|
||||
this.networks = [...this.networks, ...listNetworks.filter(n => !ids.has(n.id))]
|
||||
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