From d147f1cc3b2c7c85a02838231c6d6a4c566056ac Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 1 May 2023 18:53:17 +0530 Subject: [PATCH] ui: fix custom offering cpuspeed during vm import (#7423) * ui: fix custom offering cpuspeed during import vm Fixes #7420 Signed-off-by: Abhishek Kumar * refactor Signed-off-by: Abhishek Kumar --------- Signed-off-by: Abhishek Kumar --- ui/src/views/tools/ImportUnmanagedInstance.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/src/views/tools/ImportUnmanagedInstance.vue b/ui/src/views/tools/ImportUnmanagedInstance.vue index 7aaa562e20b..1e5629ba51a 100644 --- a/ui/src/views/tools/ImportUnmanagedInstance.vue +++ b/ui/src/views/tools/ImportUnmanagedInstance.vue @@ -177,6 +177,7 @@ :maxCpu="getMaxCpu()" :minMemory="getMinMemory()" :maxMemory="getMaxMemory()" + :cpuSpeed="getCPUSpeed()" @update-iops-value="updateFieldValue" @update-compute-cpunumber="updateFieldValue" @update-compute-cpuspeed="updateFieldValue" @@ -522,6 +523,15 @@ export default { } return 'serviceofferingdetails' in this.computeOffering ? this.computeOffering.serviceofferingdetails.maxmemory * 1 : Number.MAX_SAFE_INTEGER }, + getCPUSpeed () { + if (!this.computeOffering) { + return 0 + } + if (this.computeOffering.cpuspeed) { + return this.computeOffering.cpuspeed * 1 + } + return this.resource.cpuspeed * 1 || 0 + }, fetchOptions (param, name, exclude) { if (exclude && exclude.length > 0) { if (exclude.includes(name)) {