From be781804f1eba28d028a7ecfb57b08a47679b22b Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Tue, 6 Apr 2021 19:05:58 +0700 Subject: [PATCH 1/3] ui: fix physical network setup in zone wizard (#4892) --- .../views/infra/zone/ZoneWizardLaunchZone.vue | 18 +++---- .../ZoneWizardPhysicalNetworkSetupStep.vue | 50 +++++++++---------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue b/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue index d456827d8a1..7191f1935fd 100644 --- a/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue +++ b/ui/src/views/infra/zone/ZoneWizardLaunchZone.vue @@ -222,13 +222,13 @@ export default { this.$emit('stepError', step, this.stepData) } }, - trafficLabelParam (trafficTypeID, physicalNetworkID) { + trafficLabelParam (trafficTypeID, physicalNetworkIndex) { const hypervisor = this.prefillContent.hypervisor.value - physicalNetworkID = this.isAdvancedZone ? physicalNetworkID : 0 + physicalNetworkIndex = this.isAdvancedZone ? physicalNetworkIndex : 0 let physicalNetwork = [] let trafficConfig = null if (this.prefillContent.physicalNetworks) { - physicalNetwork = this.prefillContent.physicalNetworks[0].traffics.filter(traffic => traffic.type === trafficTypeID) + physicalNetwork = this.prefillContent.physicalNetworks[physicalNetworkIndex].traffics.filter(traffic => traffic.type === trafficTypeID) trafficConfig = physicalNetwork.length > 0 ? physicalNetwork[0] : null } let trafficLabel @@ -476,13 +476,13 @@ export default { try { if (!this.stepData.stepMove.includes('addTrafficType' + index + key)) { if (traffic.type === 'public') { - await this.addTrafficType('Public') + await this.addTrafficType('Public', index) } else if (traffic.type === 'management') { - await this.addTrafficType('Management') + await this.addTrafficType('Management', index) } else if (traffic.type === 'guest') { - await this.addTrafficType('Guest') + await this.addTrafficType('Guest', index) } else if (traffic.type === 'storage') { - await this.addTrafficType('Storage') + await this.addTrafficType('Storage', index) } this.stepData.stepMove.push('addTrafficType' + index + key) } @@ -1605,8 +1605,8 @@ export default { }) }) }, - addTrafficType (trafficType) { - const getTrafficParams = this.trafficLabelParam(trafficType.toLowerCase()) + addTrafficType (trafficType, index) { + const getTrafficParams = this.trafficLabelParam(trafficType.toLowerCase(), index) let params = {} params.trafficType = trafficType diff --git a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue index 08ed2382af0..2ea3f390524 100644 --- a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue +++ b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue @@ -60,31 +60,6 @@ - - - {{ $t('message.edit.traffic.type') }} - - - - -
{{ $t('message.required.traffic.type') }} + + + {{ $t('message.edit.traffic.type') }} + + + + +