File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 1515// specific language governing permissions and limitations
1616// under the License.
1717
18- import { shallowRef , defineAsyncComponent } from 'vue'
18+ import { shallowRef , defineAsyncComponent , reactive } from 'vue'
1919export default {
2020 name : 'physicalnetwork' ,
2121 title : 'label.physical.network' ,
@@ -131,3 +131,6 @@ export default {
131131 }
132132 ]
133133}
134+ export const trafficTypeTab = reactive ( {
135+ index : 0
136+ } )
Original file line number Diff line number Diff line change 9999import { ref , reactive , toRaw } from ' vue'
100100import { getAPI , postAPI } from ' @/api'
101101import TooltipLabel from ' @/components/widgets/TooltipLabel'
102+ import { trafficTypeTab } from ' @/config/section/infra/phynetworks.js'
102103
103104export default {
104105 name: ' EditTrafficLabel' ,
@@ -150,9 +151,9 @@ export default {
150151 getAPI (' listTrafficTypes' , { physicalnetworkid: this .resource .id })
151152 .then (json => {
152153 this .trafficTypes = json .listtraffictypesresponse .traffictype || []
153- this .form .id = this .trafficTypes [0 ].id || undefined
154- this .trafficResource = this .trafficTypes [0 ] || {}
155- this .traffictype = this .trafficTypes [0 ].traffictype || undefined
154+ this .form .id = this .trafficTypes [trafficTypeTab . index ].id || undefined
155+ this .trafficResource = this .trafficTypes [trafficTypeTab . index ] || {}
156+ this .traffictype = this .trafficTypes [trafficTypeTab . index ].traffictype || undefined
156157 this .fillEditFromFieldValues ()
157158 }).catch (error => {
158159 this .$notification .error ({
Original file line number Diff line number Diff line change 1717
1818<template >
1919 <a-spin :spinning =" fetchLoading" >
20- <a-tabs :tabPosition =" device === 'mobile' ? 'top' : 'left'" :animated =" false" >
20+ <a-tabs :tabPosition =" device === 'mobile' ? 'top' : 'left'" :animated =" false" @tabClick = " onClick " >
2121 <a-tab-pane v-for =" (item, index) in traffictypes" :tab =" item.traffictype" :key =" index" >
2222 <a-popconfirm
2323 :title =" $t('message.confirm.delete.traffic.type')"
@@ -84,6 +84,7 @@ import IpRangesTabPublic from './IpRangesTabPublic'
8484import IpRangesTabManagement from ' ./IpRangesTabManagement'
8585import IpRangesTabStorage from ' ./IpRangesTabStorage'
8686import IpRangesTabGuest from ' ./IpRangesTabGuest'
87+ import { trafficTypeTab } from ' @/config/section/infra/phynetworks.js'
8788
8889export default {
8990 name: ' TrafficTypesTab' ,
@@ -221,6 +222,9 @@ export default {
221222 this .fetchLoading = false
222223 this .fetchTrafficTypes ()
223224 })
225+ },
226+ onClick (trafficType ) {
227+ trafficTypeTab .index = trafficType
224228 }
225229 }
226230}
You can’t perform that action at this time.
0 commit comments