Skip to content

Commit b275c29

Browse files
author
Hoang Nguyen
authored
UI - Add Network: shows "Offering for Isolated networks with no Source Nat service" on Network Offering for normal users (apache#5904)
* shows "Offering for Isolated networks with no Source Nat service" for normal users * fixes roles * fix selected tabs
1 parent ce81a8e commit b275c29

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

ui/src/views/network/CreateIsolatedNetworkForm.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ export default {
344344
var params = {
345345
zoneid: this.selectedZone.id,
346346
guestiptype: 'Isolated',
347-
supportedServices: 'SourceNat',
348347
state: 'Enabled'
349348
}
350349
if (isAdminOrDomainAdmin() && this.selectedDomain.id !== '-1') { // domain is visible only for admins

ui/src/views/network/CreateNetwork.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<template>
1919
<a-spin :spinning="loading" class="form-layout">
20-
<a-tabs defaultActiveKey="1" :animated="false" v-if="!loading">
20+
<a-tabs :default-active-key="defaultNetworkTypeTabKey" :animated="false" v-if="!loading">
2121
<a-tab-pane :tab="$t('label.isolated')" key="1" v-if="isAdvancedZoneWithoutSGAvailable">
2222
<CreateIsolatedNetworkForm
2323
:loading="loading"
@@ -68,7 +68,7 @@ export default {
6868
},
6969
data () {
7070
return {
71-
isAdvancedZoneWithoutSGAvailable: true,
71+
isAdvancedZoneWithoutSGAvailable: false,
7272
defaultNetworkTypeTabKey: '1',
7373
loading: false,
7474
actionZones: [],
@@ -79,14 +79,17 @@ export default {
7979
const promises = []
8080
promises.push(this.fetchActionZoneData())
8181
Promise.all(promises).then(() => {
82+
this.isAdvancedZoneWithoutSGAvailable = false
83+
this.defaultNetworkTypeTabKey = '2'
84+
8285
for (const i in this.actionZones) {
8386
const zone = this.actionZones[i]
8487
if (zone.networktype === 'Advanced' && zone.securitygroupsenabled !== true) {
8588
this.isAdvancedZoneWithoutSGAvailable = true
89+
this.defaultNetworkTypeTabKey = '1'
8690
return
8791
}
8892
}
89-
this.isAdvancedZoneWithoutSGAvailable = false
9093
})
9194
},
9295
methods: {

0 commit comments

Comments
 (0)