File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,7 +65,8 @@ import {
6565 Tree ,
6666 Calendar ,
6767 Slider ,
68- AutoComplete
68+ AutoComplete ,
69+ Collapse
6970} from 'ant-design-vue'
7071
7172Vue . use ( ConfigProvider )
@@ -114,6 +115,7 @@ Vue.use(Tree)
114115Vue . use ( Calendar )
115116Vue . use ( Slider )
116117Vue . use ( AutoComplete )
118+ Vue . use ( Collapse )
117119
118120Vue . prototype . $confirm = Modal . confirm
119121Vue . prototype . $message = message
Original file line number Diff line number Diff line change @@ -1023,6 +1023,10 @@ export default {
10231023 this .vms = []
10241024 this .addVmModalLoading = true
10251025 const networkId = (' vpcid' in this .resource && ! (' associatednetworkid' in this .resource )) ? this .selectedTier : this .resource .associatednetworkid
1026+ if (! networkId) {
1027+ this .addVmModalLoading = false
1028+ return
1029+ }
10261030 api (' listVirtualMachines' , {
10271031 listAll: true ,
10281032 keyword: this .searchQuery ,
Original file line number Diff line number Diff line change @@ -391,6 +391,7 @@ export default {
391391 if (' vpcid' in this .resource && ' associatednetworkid' in this .resource ) {
392392 return
393393 }
394+ this .selectedTier = null
394395 this .tiers .loading = true
395396 api (' listNetworks' , {
396397 account: this .resource .account ,
@@ -399,7 +400,9 @@ export default {
399400 vpcid: this .resource .vpcid
400401 }).then (json => {
401402 this .tiers .data = json .listnetworksresponse .network || []
402- this .selectedTier = this .tiers .data && this .tiers .data [0 ].id ? this .tiers .data [0 ].id : null
403+ if (this .tiers .data && this .tiers .data .length > 0 ) {
404+ this .selectedTier = this .tiers .data [0 ].id
405+ }
403406 this .$forceUpdate ()
404407 }).catch (error => {
405408 this .$notifyError (error)
@@ -615,6 +618,10 @@ export default {
615618 this .vms = []
616619 this .addVmModalLoading = true
617620 const networkId = (' vpcid' in this .resource && ! (' associatednetworkid' in this .resource )) ? this .selectedTier : this .resource .associatednetworkid
621+ if (! networkId) {
622+ this .addVmModalLoading = false
623+ return
624+ }
618625 api (' listVirtualMachines' , {
619626 listAll: true ,
620627 keyword: this .searchQuery ,
Original file line number Diff line number Diff line change @@ -390,6 +390,9 @@ export default {
390390 },
391391 fetchData () {
392392 this .networks = this .resource .network
393+ if (! this .networks || this .networks .length === 0 ) {
394+ return
395+ }
393396 for (const network of this .networks ) {
394397 this .fetchLoadBalancers (network .id )
395398 this .fetchVMs (network .id )
You can’t perform that action at this time.
0 commit comments