Skip to content

Commit be78180

Browse files
author
Hoang Nguyen
authored
ui: fix physical network setup in zone wizard (#4892)
1 parent 35b20b2 commit be78180

2 files changed

Lines changed: 34 additions & 34 deletions

File tree

ui/src/views/infra/zone/ZoneWizardLaunchZone.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,13 @@ export default {
222222
this.$emit('stepError', step, this.stepData)
223223
}
224224
},
225-
trafficLabelParam (trafficTypeID, physicalNetworkID) {
225+
trafficLabelParam (trafficTypeID, physicalNetworkIndex) {
226226
const hypervisor = this.prefillContent.hypervisor.value
227-
physicalNetworkID = this.isAdvancedZone ? physicalNetworkID : 0
227+
physicalNetworkIndex = this.isAdvancedZone ? physicalNetworkIndex : 0
228228
let physicalNetwork = []
229229
let trafficConfig = null
230230
if (this.prefillContent.physicalNetworks) {
231-
physicalNetwork = this.prefillContent.physicalNetworks[0].traffics.filter(traffic => traffic.type === trafficTypeID)
231+
physicalNetwork = this.prefillContent.physicalNetworks[physicalNetworkIndex].traffics.filter(traffic => traffic.type === trafficTypeID)
232232
trafficConfig = physicalNetwork.length > 0 ? physicalNetwork[0] : null
233233
}
234234
let trafficLabel
@@ -476,13 +476,13 @@ export default {
476476
try {
477477
if (!this.stepData.stepMove.includes('addTrafficType' + index + key)) {
478478
if (traffic.type === 'public') {
479-
await this.addTrafficType('Public')
479+
await this.addTrafficType('Public', index)
480480
} else if (traffic.type === 'management') {
481-
await this.addTrafficType('Management')
481+
await this.addTrafficType('Management', index)
482482
} else if (traffic.type === 'guest') {
483-
await this.addTrafficType('Guest')
483+
await this.addTrafficType('Guest', index)
484484
} else if (traffic.type === 'storage') {
485-
await this.addTrafficType('Storage')
485+
await this.addTrafficType('Storage', index)
486486
}
487487
this.stepData.stepMove.push('addTrafficType' + index + key)
488488
}
@@ -1605,8 +1605,8 @@ export default {
16051605
})
16061606
})
16071607
},
1608-
addTrafficType (trafficType) {
1609-
const getTrafficParams = this.trafficLabelParam(trafficType.toLowerCase())
1608+
addTrafficType (trafficType, index) {
1609+
const getTrafficParams = this.trafficLabelParam(trafficType.toLowerCase(), index)
16101610
let params = {}
16111611
16121612
params.trafficType = trafficType

ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -60,31 +60,6 @@
6060
<a-icon type="delete" class="traffic-type-action" @click="deleteTraffic(record.key, traffic, $event)"/>
6161
</a-tag>
6262
</div>
63-
<a-modal
64-
:title="$t('label.edit.traffic.type')"
65-
:visible="showEditTraffic"
66-
:closable="true"
67-
:maskClosable="false"
68-
:okText="$t('label.ok')"
69-
:cancelText="$t('label.cancel')"
70-
@ok="updateTrafficLabel(trafficInEdit)"
71-
@cancel="cancelEditTraffic"
72-
centered
73-
>
74-
<a-form :form="form">
75-
<span class="ant-form-text"> {{ $t('message.edit.traffic.type') }} </span>
76-
<a-form-item v-bind="formItemLayout" style="margin-top:16px;" :label="$t('label.traffic.label')">
77-
<a-input
78-
v-decorator="['trafficLabel', {
79-
rules: [{
80-
required: true,
81-
message: $t('message.error.traffic.label'),
82-
}]
83-
}]"
84-
/>
85-
</a-form-item>
86-
</a-form>
87-
</a-modal>
8863
<div v-if="isShowAddTraffic(record.traffics)">
8964
<div class="traffic-select-item" v-if="addingTrafficForKey === record.key">
9065
<a-select
@@ -162,6 +137,31 @@
162137
>
163138
<span>{{ $t('message.required.traffic.type') }}</span>
164139
</a-modal>
140+
<a-modal
141+
:title="$t('label.edit.traffic.type')"
142+
:visible="showEditTraffic"
143+
:closable="true"
144+
:maskClosable="false"
145+
:okText="$t('label.ok')"
146+
:cancelText="$t('label.cancel')"
147+
@ok="updateTrafficLabel(trafficInEdit)"
148+
@cancel="cancelEditTraffic"
149+
centered
150+
>
151+
<a-form :form="form">
152+
<span class="ant-form-text"> {{ $t('message.edit.traffic.type') }} </span>
153+
<a-form-item v-bind="formItemLayout" style="margin-top:16px;" :label="$t('label.traffic.label')">
154+
<a-input
155+
v-decorator="['trafficLabel', {
156+
rules: [{
157+
required: true,
158+
message: $t('message.error.traffic.label'),
159+
}]
160+
}]"
161+
/>
162+
</a-form-item>
163+
</a-form>
164+
</a-modal>
165165
</div>
166166
</template>
167167
<script>

0 commit comments

Comments
 (0)