Skip to content

Commit d826b49

Browse files
committed
Routed: UI bug fix and improvements
1 parent 2772157 commit d826b49

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

ui/src/config/section/network.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,14 @@ export default {
872872
icon: 'partition-outlined',
873873
permission: ['listASNumbers'],
874874
show: () => {
875-
return ['Admin'].includes(store.getters.userInfo.roletype)
875+
if (!store.getters.zones || store.getters.zones.length === 0) {
876+
return false
877+
}
878+
const AdvancedZonesWithRoutedmode = store.getters.zones.filter(zone => zone.routedmodeenabled)
879+
if (isAdmin() && (AdvancedZonesWithRoutedmode && AdvancedZonesWithRoutedmode.length > 0)) {
880+
return true
881+
}
882+
return false
876883
},
877884
filters: ['all', 'allocatedonly', 'free'],
878885
columns: ['asnumber', 'allocationstate', 'asnrange', 'associatednetworkname', 'vpcname', 'allocated', 'account', 'domain', 'zonename'],
@@ -1446,7 +1453,11 @@ export default {
14461453
if (!store.getters.zones || store.getters.zones.length === 0) {
14471454
return false
14481455
}
1449-
return isAdmin()
1456+
const AdvancedZonesWithRoutedmode = store.getters.zones.filter(zone => zone.routedmodeenabled)
1457+
if (isAdmin() && (AdvancedZonesWithRoutedmode && AdvancedZonesWithRoutedmode.length > 0)) {
1458+
return true
1459+
}
1460+
return false
14501461
},
14511462
actions: [
14521463
{

ui/src/views/network/CreateIpv4SubnetForNetwork.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export default {
150150
const params = { showicon: true }
151151
api('listZones', params).then(json => {
152152
this.zones = json.listzonesresponse.zone || []
153+
this.zones = this.zones.filter(zone => zone.routedmodeenabled)
153154
this.form.zoneid = this.zones[0].id || ''
154155
this.fetchParentSubnets(this.form.zoneid)
155156
}).finally(() => {

ui/src/views/offering/AddNetworkOffering.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -740,10 +740,10 @@ export default {
740740
api('listConfigurations', params).then(json => {
741741
var value = json?.listconfigurationsresponse?.configuration?.[0].value || null
742742
this.routedNetworkEnabled = value === 'true'
743+
if (!this.routedNetworkEnabled) {
744+
this.networkmodes.pop()
745+
}
743746
})
744-
if (!this.routedNetworkEnabled) {
745-
this.networkmodes.pop()
746-
}
747747
},
748748
fetchZoneData () {
749749
const params = {}

ui/src/views/offering/AddVpcOffering.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,10 @@ export default {
371371
api('listConfigurations', params).then(json => {
372372
var value = json?.listconfigurationsresponse?.configuration?.[0].value || null
373373
this.routedNetworkEnabled = value === 'true'
374+
if (!this.routedNetworkEnabled) {
375+
this.networkmodes.pop()
376+
}
374377
})
375-
if (!this.routedNetworkEnabled) {
376-
this.networkmodes.pop()
377-
}
378378
},
379379
fetchDomainData () {
380380
const params = {}

0 commit comments

Comments
 (0)