ui: fix custom offering cpuspeed during vm import (#7423)

* ui: fix custom offering cpuspeed during import vm

Fixes #7420

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* refactor

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

---------

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2023-05-01 18:53:17 +05:30 committed by GitHub
parent b84744d9a5
commit d147f1cc3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)) {