mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Selected type on update traffic type is based on chosen type in traffic types tab (#10902)
Co-authored-by: Nicole Schmidt <nicole.schmidt@scclouds.com.br>
This commit is contained in:
parent
f58372e97b
commit
6b9615b2f9
@ -15,7 +15,7 @@
|
|||||||
// specific language governing permissions and limitations
|
// specific language governing permissions and limitations
|
||||||
// under the License.
|
// under the License.
|
||||||
|
|
||||||
import { shallowRef, defineAsyncComponent } from 'vue'
|
import { shallowRef, defineAsyncComponent, reactive } from 'vue'
|
||||||
export default {
|
export default {
|
||||||
name: 'physicalnetwork',
|
name: 'physicalnetwork',
|
||||||
title: 'label.physical.network',
|
title: 'label.physical.network',
|
||||||
@ -131,3 +131,6 @@ export default {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
export const trafficTypeTab = reactive({
|
||||||
|
index: 0
|
||||||
|
})
|
||||||
|
|||||||
@ -99,6 +99,7 @@
|
|||||||
import { ref, reactive, toRaw } from 'vue'
|
import { ref, reactive, toRaw } from 'vue'
|
||||||
import { getAPI, postAPI } from '@/api'
|
import { getAPI, postAPI } from '@/api'
|
||||||
import TooltipLabel from '@/components/widgets/TooltipLabel'
|
import TooltipLabel from '@/components/widgets/TooltipLabel'
|
||||||
|
import { trafficTypeTab } from '@/config/section/infra/phynetworks.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EditTrafficLabel',
|
name: 'EditTrafficLabel',
|
||||||
@ -150,9 +151,9 @@ export default {
|
|||||||
getAPI('listTrafficTypes', { physicalnetworkid: this.resource.id })
|
getAPI('listTrafficTypes', { physicalnetworkid: this.resource.id })
|
||||||
.then(json => {
|
.then(json => {
|
||||||
this.trafficTypes = json.listtraffictypesresponse.traffictype || []
|
this.trafficTypes = json.listtraffictypesresponse.traffictype || []
|
||||||
this.form.id = this.trafficTypes[0].id || undefined
|
this.form.id = this.trafficTypes[trafficTypeTab.index].id || undefined
|
||||||
this.trafficResource = this.trafficTypes[0] || {}
|
this.trafficResource = this.trafficTypes[trafficTypeTab.index] || {}
|
||||||
this.traffictype = this.trafficTypes[0].traffictype || undefined
|
this.traffictype = this.trafficTypes[trafficTypeTab.index].traffictype || undefined
|
||||||
this.fillEditFromFieldValues()
|
this.fillEditFromFieldValues()
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$notification.error({
|
this.$notification.error({
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<a-spin :spinning="fetchLoading">
|
<a-spin :spinning="fetchLoading">
|
||||||
<a-tabs :tabPosition="device === 'mobile' ? 'top' : 'left'" :animated="false">
|
<a-tabs :tabPosition="device === 'mobile' ? 'top' : 'left'" :animated="false" @tabClick="onClick">
|
||||||
<a-tab-pane v-for="(item, index) in traffictypes" :tab="item.traffictype" :key="index">
|
<a-tab-pane v-for="(item, index) in traffictypes" :tab="item.traffictype" :key="index">
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
:title="$t('message.confirm.delete.traffic.type')"
|
:title="$t('message.confirm.delete.traffic.type')"
|
||||||
@ -84,6 +84,7 @@ import IpRangesTabPublic from './IpRangesTabPublic'
|
|||||||
import IpRangesTabManagement from './IpRangesTabManagement'
|
import IpRangesTabManagement from './IpRangesTabManagement'
|
||||||
import IpRangesTabStorage from './IpRangesTabStorage'
|
import IpRangesTabStorage from './IpRangesTabStorage'
|
||||||
import IpRangesTabGuest from './IpRangesTabGuest'
|
import IpRangesTabGuest from './IpRangesTabGuest'
|
||||||
|
import { trafficTypeTab } from '@/config/section/infra/phynetworks.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TrafficTypesTab',
|
name: 'TrafficTypesTab',
|
||||||
@ -221,6 +222,9 @@ export default {
|
|||||||
this.fetchLoading = false
|
this.fetchLoading = false
|
||||||
this.fetchTrafficTypes()
|
this.fetchTrafficTypes()
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
onClick (trafficType) {
|
||||||
|
trafficTypeTab.index = trafficType
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user