mirror of https://github.com/apache/cloudstack.git
ui: list only accessible networks during import (#9194)
* ui: list only accessible networks during import Fixes #8612 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> * fix Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> * space Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> * changes --------- Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
78ace3a750
commit
f45267174a
|
|
@ -99,6 +99,14 @@ export default {
|
|||
type: String,
|
||||
default: () => ''
|
||||
},
|
||||
domainid: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
account: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
selectionEnabled: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
|
|
@ -144,7 +152,8 @@ export default {
|
|||
ipAddressesEnabled: {},
|
||||
ipAddresses: {},
|
||||
indexNum: 1,
|
||||
sendValuesTimer: null
|
||||
sendValuesTimer: null,
|
||||
accountNetworkUpdateTimer: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -184,6 +193,14 @@ export default {
|
|||
},
|
||||
zoneId () {
|
||||
this.fetchNetworks()
|
||||
},
|
||||
account () {
|
||||
clearTimeout(this.accountNetworkUpdateTimer)
|
||||
this.accountNetworkUpdateTimer = setTimeout(() => {
|
||||
if (this.account) {
|
||||
this.fetchNetworks()
|
||||
}
|
||||
}, 750)
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
|
@ -196,13 +213,20 @@ export default {
|
|||
return
|
||||
}
|
||||
this.loading = true
|
||||
api('listNetworks', {
|
||||
var params = {
|
||||
zoneid: this.zoneId,
|
||||
listall: true
|
||||
}).then(response => {
|
||||
}
|
||||
if (this.domainid && this.account) {
|
||||
params.domainid = this.domainid
|
||||
params.account = this.account
|
||||
}
|
||||
api('listNetworks', params).then(response => {
|
||||
this.networks = response.listnetworksresponse.network || []
|
||||
this.orderNetworks()
|
||||
}).catch(() => {
|
||||
this.networks = []
|
||||
}).finally(() => {
|
||||
this.orderNetworks()
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -297,6 +297,8 @@
|
|||
<multi-network-selection
|
||||
:items="nics"
|
||||
:zoneId="cluster.zoneid"
|
||||
:domainid="form.domainid"
|
||||
:account="form.account"
|
||||
:selectionEnabled="false"
|
||||
:filterUnimplementedNetworks="true"
|
||||
:hypervisor="this.cluster.hypervisortype"
|
||||
|
|
@ -693,7 +695,9 @@ export default {
|
|||
this.form = reactive({
|
||||
rootdiskid: 0,
|
||||
migrateallowed: this.switches.migrateAllowed,
|
||||
forced: this.switches.forced
|
||||
forced: this.switches.forced,
|
||||
domainid: null,
|
||||
account: null
|
||||
})
|
||||
this.rules = reactive({
|
||||
displayname: [{ required: true, message: this.$t('message.error.input.value') }],
|
||||
|
|
|
|||
Loading…
Reference in New Issue