From ea2cd07708ea335cdf7a6162cf68de4286454a86 Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Thu, 2 Sep 2021 00:08:26 +0700 Subject: [PATCH] UI - Scale VM - Fix compute offering selection not working (#5392) * scale VM: fix compute offering selection not working * hidden slider when cpuspeed empty & show customiops * remove logs * fix condition * fix condition for coltranned --- ui/src/components/view/InfoCard.vue | 2 +- ui/src/views/compute/ScaleVM.vue | 8 +++++--- ui/src/views/compute/wizard/ComputeSelection.vue | 10 +++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ui/src/components/view/InfoCard.vue b/ui/src/components/view/InfoCard.vue index 5fd0fab1a37..51d91c04a52 100644 --- a/ui/src/components/view/InfoCard.vue +++ b/ui/src/components/view/InfoCard.vue @@ -26,7 +26,7 @@ @click="$message.success(`${$t('label.copied.clipboard')} : ${name}`)" v-clipboard:copy="name" > - + diff --git a/ui/src/views/compute/ScaleVM.vue b/ui/src/views/compute/ScaleVM.vue index f2653405151..7b71d2efcbd 100644 --- a/ui/src/views/compute/ScaleVM.vue +++ b/ui/src/views/compute/ScaleVM.vue @@ -32,7 +32,7 @@ @handle-search-filter="($event) => fetchData($event)" /> @@ -120,14 +122,14 @@ export default { if (this.resource.state === 'Running') { return this.resource.cpunumber } - return 'serviceofferingdetails' in this.selectedOffering ? this.selectedOffering.serviceofferingdetails.mincpunumber * 1 : 1 + return this.selectedOffering?.serviceofferingdetails?.mincpunumber * 1 || 1 }, getMinMemory () { // We can only scale up while a VM is running if (this.resource.state === 'Running') { return this.resource.memory } - return 'serviceofferingdetails' in this.selectedOffering ? this.selectedOffering.serviceofferingdetails.minmemory * 1 : 32 + return this.selectedOffering?.serviceofferingdetails?.minmemory * 1 || 32 }, getMessage () { if (this.resource.hypervisor === 'VMware') { diff --git a/ui/src/views/compute/wizard/ComputeSelection.vue b/ui/src/views/compute/wizard/ComputeSelection.vue index 816e0c914b9..6f6e2a42860 100644 --- a/ui/src/views/compute/wizard/ComputeSelection.vue +++ b/ui/src/views/compute/wizard/ComputeSelection.vue @@ -25,7 +25,7 @@ :validate-status="errors.cpu.status" :help="errors.cpu.message"> - + - +