This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.15
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.15 by this push:
     new be78180  ui: fix physical network setup in zone wizard (#4892)
be78180 is described below

commit be781804f1eba28d028a7ecfb57b08a47679b22b
Author: Hoang Nguyen <[email protected]>
AuthorDate: Tue Apr 6 19:05:58 2021 +0700

    ui: fix physical network setup in zone wizard (#4892)
---
 ui/src/views/infra/zone/ZoneWizardLaunchZone.vue   | 18 ++++----
 .../zone/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 d456827..7191f19 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 08ed238..2ea3f39 100644
--- a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue
+++ b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue
@@ -60,31 +60,6 @@
             <a-icon type="delete" class="traffic-type-action" 
@click="deleteTraffic(record.key, traffic, $event)"/>
           </a-tag>
         </div>
-        <a-modal
-          :title="$t('label.edit.traffic.type')"
-          :visible="showEditTraffic"
-          :closable="true"
-          :maskClosable="false"
-          :okText="$t('label.ok')"
-          :cancelText="$t('label.cancel')"
-          @ok="updateTrafficLabel(trafficInEdit)"
-          @cancel="cancelEditTraffic"
-          centered
-        >
-          <a-form :form="form">
-            <span class="ant-form-text"> {{ $t('message.edit.traffic.type') }} 
</span>
-            <a-form-item v-bind="formItemLayout" style="margin-top:16px;" 
:label="$t('label.traffic.label')">
-              <a-input
-                v-decorator="['trafficLabel', {
-                  rules: [{
-                    required: true,
-                    message: $t('message.error.traffic.label'),
-                  }]
-                }]"
-              />
-            </a-form-item>
-          </a-form>
-        </a-modal>
         <div v-if="isShowAddTraffic(record.traffics)">
           <div class="traffic-select-item" v-if="addingTrafficForKey === 
record.key">
             <a-select
@@ -162,6 +137,31 @@
     >
       <span>{{ $t('message.required.traffic.type') }}</span>
     </a-modal>
+    <a-modal
+      :title="$t('label.edit.traffic.type')"
+      :visible="showEditTraffic"
+      :closable="true"
+      :maskClosable="false"
+      :okText="$t('label.ok')"
+      :cancelText="$t('label.cancel')"
+      @ok="updateTrafficLabel(trafficInEdit)"
+      @cancel="cancelEditTraffic"
+      centered
+    >
+      <a-form :form="form">
+        <span class="ant-form-text"> {{ $t('message.edit.traffic.type') }} 
</span>
+        <a-form-item v-bind="formItemLayout" style="margin-top:16px;" 
:label="$t('label.traffic.label')">
+          <a-input
+            v-decorator="['trafficLabel', {
+              rules: [{
+                required: true,
+                message: $t('message.error.traffic.label'),
+              }]
+            }]"
+          />
+        </a-form-item>
+      </a-form>
+    </a-modal>
   </div>
 </template>
 <script>

Reply via email to