From cae1b3a11b96db59425c316ae5b8cef2baf30c31 Mon Sep 17 00:00:00 2001 From: utchoang Date: Tue, 21 Jun 2022 16:22:15 +0700 Subject: [PATCH 1/7] hide html warning in message --- ui/src/locales/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/src/locales/index.js b/ui/src/locales/index.js index d8ff08ff4a9d..29c828b64472 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) { From 70dea70ba2b4f3be8ea5b5223ca6ef8503b0eaca Mon Sep 17 00:00:00 2001 From: utchoang Date: Tue, 21 Jun 2022 17:01:45 +0700 Subject: [PATCH 2/7] hidden ip address step --- ui/src/views/infra/zone/ZoneWizardAddResources.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/views/infra/zone/ZoneWizardAddResources.vue b/ui/src/views/infra/zone/ZoneWizardAddResources.vue index 8a52ec91007c..fb556ffc7cef 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', From a033f0fe9f0201500d2496715ab72d002efb8da8 Mon Sep 17 00:00:00 2001 From: utchoang Date: Wed, 22 Jun 2022 08:11:29 +0700 Subject: [PATCH 3/7] refill value of edit tariff --- .../infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue index 8d4b28144e5b..aafe6ec70833 100644 --- a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue +++ b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue @@ -323,7 +323,7 @@ export default { return traffics }, hypervisor () { - return this.prefillContent.hypervisor?.value || null + return this.prefillContent.hypervisor || null } }, created () { @@ -477,12 +477,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 From a0f7115c0fa54a07d4cb69d30bdfd581ad07f6b7 Mon Sep 17 00:00:00 2001 From: utchoang Date: Wed, 22 Jun 2022 08:22:32 +0700 Subject: [PATCH 4/7] close modal when icon-close clicked --- .../views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue index aafe6ec70833..e3171a7b7ee2 100644 --- a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue +++ b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue @@ -143,7 +143,7 @@ Date: Wed, 22 Jun 2022 13:43:36 +0700 Subject: [PATCH 5/7] fixes modal not show when error --- ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue index e3171a7b7ee2..02f30a32744f 100644 --- a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue +++ b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue @@ -151,7 +151,7 @@ @cancel="() => { showError = false }" centered > -
+
{{ $t('message.required.traffic.type') }}
{{ $t('label.cancel') }} From 964b374be59f4558aee0bb6504a0d70b55fbc693 Mon Sep 17 00:00:00 2001 From: utchoang Date: Wed, 22 Jun 2022 16:18:03 +0700 Subject: [PATCH 6/7] check valid traffic label with VMWare --- .../zone/ZoneWizardPhysicalNetworkSetupStep.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue index 02f30a32744f..5be870c7964a 100644 --- a/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue +++ b/ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue @@ -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 + } } }) }) From 2666780a5b255b95b584f5868874b8bea39a7057 Mon Sep 17 00:00:00 2001 From: utchoang Date: Wed, 22 Jun 2022 16:26:07 +0700 Subject: [PATCH 7/7] remove automatic change clustername --- ui/src/views/infra/ClusterAdd.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/src/views/infra/ClusterAdd.vue b/ui/src/views/infra/ClusterAdd.vue index cbf487669976..5450db9aeddf 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) {