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

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


The following commit(s) were added to refs/heads/4.17 by this push:
     new 600d81e345 UI: Fixes some issues from zone wizard with VMWare 
hypervisor (#6480)
600d81e345 is described below

commit 600d81e345f915561bdbacdb595df2d133e5cc0f
Author: Hoang Nguyen <[email protected]>
AuthorDate: Fri Jul 8 15:23:12 2022 +0700

    UI: Fixes some issues from zone wizard with VMWare hypervisor (#6480)
    
    * hide html warning in message
    
    * hidden ip address step
    
    * refill value of edit tariff
    
    * close modal when icon-close clicked
    
    * fixes modal not show when error
    
    * check valid traffic label with VMWare
    
    * remove automatic change clustername
---
 ui/src/locales/index.js                            |  3 ++-
 ui/src/views/infra/ClusterAdd.vue                  |  6 +++--
 ui/src/views/infra/zone/ZoneWizardAddResources.vue |  6 ++---
 .../zone/ZoneWizardPhysicalNetworkSetupStep.vue    | 26 ++++++++++++++--------
 4 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/ui/src/locales/index.js b/ui/src/locales/index.js
index d8ff08ff4a..29c828b644 100644
--- a/ui/src/locales/index.js
+++ b/ui/src/locales/index.js
@@ -26,7 +26,8 @@ export const i18n = createI18n({
   fallbackLocale: 'en',
   silentTranslationWarn: true,
   messages: messages,
-  silentFallbackWarn: true
+  silentFallbackWarn: true,
+  warnHtmlInMessage: 'off'
 })
 
 export function loadLanguageAsync (lang) {
diff --git a/ui/src/views/infra/ClusterAdd.vue 
b/ui/src/views/infra/ClusterAdd.vue
index cbf4876699..5450db9aed 100644
--- a/ui/src/views/infra/ClusterAdd.vue
+++ b/ui/src/views/infra/ClusterAdd.vue
@@ -269,10 +269,12 @@ export default {
       this.addCluster()
     },
     addCluster () {
+      let clustername = this.clustername
+
       if (this.hypervisor === 'VMware') {
         const clusternameVal = this.clustername
         this.url = `http://${this.host}/${this.dataCenter}/${clusternameVal}`
-        this.clustername = `${this.host}/${this.dataCenter}/${clusternameVal}`
+        clustername = `${this.host}/${this.dataCenter}/${clusternameVal}`
       }
       this.loading = true
       this.parentToggleLoading()
@@ -281,7 +283,7 @@ export default {
         hypervisor: this.hypervisor,
         clustertype: this.clustertype,
         podId: this.podId,
-        clustername: this.clustername,
+        clustername: clustername,
         url: this.url
       }
       if (this.ovm3pool) {
diff --git a/ui/src/views/infra/zone/ZoneWizardAddResources.vue 
b/ui/src/views/infra/zone/ZoneWizardAddResources.vue
index ad16ef30aa..bc19870776 100644
--- a/ui/src/views/infra/zone/ZoneWizardAddResources.vue
+++ b/ui/src/views/infra/zone/ZoneWizardAddResources.vue
@@ -137,14 +137,14 @@ export default {
       return this.prefillContent?.hypervisor || null
     },
     localstorageenabled () {
-      return this.prefillContent?.localstorageenabled?.value || false
+      return this.prefillContent?.localstorageenabled || false
     },
     localstorageenabledforsystemvm () {
-      return this.prefillContent?.localstorageenabledforsystemvm?.value || 
false
+      return this.prefillContent?.localstorageenabledforsystemvm || false
     },
     steps () {
       const steps = []
-      const hypervisor = this.prefillContent.hypervisor ? 
this.prefillContent.hypervisor.value : null
+      const hypervisor = this.prefillContent.hypervisor ? 
this.prefillContent.hypervisor : null
       steps.push({
         title: 'label.cluster',
         fromKey: 'clusterResource',
diff --git a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue 
b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue
index 8d4b28144e..5be870c796 100644
--- a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue
+++ b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue
@@ -143,7 +143,7 @@
       </a-button>
     </div>
     <a-modal
-      :visible="showError"
+      v-model:visible="showError"
       :title="`${$t('label.error')}!`"
       :maskClosable="false"
       :closable="true"
@@ -151,7 +151,7 @@
       @cancel="() => { showError = false }"
       centered
     >
-      <div v-ctrl-enter="showError = false">
+      <div v-ctrl-enter="() => showError = false">
         <span>{{ $t('message.required.traffic.type') }}</span>
         <div :span="24" class="action-button">
           <a-button @click="showError = false">{{ $t('label.cancel') 
}}</a-button>
@@ -161,7 +161,7 @@
     </a-modal>
     <a-modal
       :title="$t('label.edit.traffic.type')"
-      :visible="showEditTraffic"
+      v-model:visible="showEditTraffic"
       :closable="true"
       :maskClosable="false"
       centered
@@ -323,7 +323,7 @@ export default {
       return traffics
     },
     hypervisor () {
-      return this.prefillContent.hypervisor?.value || null
+      return this.prefillContent.hypervisor || null
     }
   },
   created () {
@@ -414,14 +414,22 @@ export default {
       const shouldHaveLabels = this.physicalNetworks.length > 1
       let isValid = true
       this.requiredTrafficTypes.forEach(type => {
+        if (!isValid) return false
         let foundType = false
         this.physicalNetworks.forEach(net => {
           net.traffics.forEach(traffic => {
+            if (!isValid) return false
             if (traffic.type === type) {
               foundType = true
             }
-            if (shouldHaveLabels && (!traffic.label || traffic.label.length 
=== 0)) {
-              isValid = false
+            if (this.hypervisor !== 'VMware') {
+              if (shouldHaveLabels && (!traffic.label || traffic.label.length 
=== 0)) {
+                isValid = false
+              }
+            } else {
+              if (shouldHaveLabels && (!traffic.vSwitchName || 
traffic.vSwitchName.length === 0)) {
+                isValid = false
+              }
             }
           })
         })
@@ -477,12 +485,12 @@ export default {
       const fields = {}
       if (this.hypervisor === 'VMware') {
         delete this.trafficInEdit.traffic.label
-        fields.vSwitchName = null
-        fields.vlanId = null
+        fields.vSwitchName = this.trafficInEdit?.traffic?.vSwitchName || null
+        fields.vlanId = this.trafficInEdit?.traffic?.vlanId || null
         if (traffic.type === 'guest') {
           fields.vSwitchName = this.trafficInEdit?.traffic?.vSwitchName || 
'vSwitch0'
         }
-        fields.vSwitchType = 'vmwaresvs'
+        fields.vSwitchType = this.trafficInEdit?.traffic?.vSwitchType || 
'vmwaresvs'
       } else {
         delete this.trafficInEdit.traffic.vSwitchName
         delete this.trafficInEdit.traffic.vlanId

Reply via email to