You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sh...@apache.org on 2022/08/17 06:23:27 UTC

[cloudstack] branch 4.17 updated: ui: fix gputype in add compute offering (#6646)

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

shwstppr 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 780bb2474cd ui: fix gputype in add compute offering (#6646)
780bb2474cd is described below

commit 780bb2474cd0105e64d36be9affd263b8eebcca0
Author: Abhishek Kumar <ab...@gmail.com>
AuthorDate: Wed Aug 17 11:53:22 2022 +0530

    ui: fix gputype in add compute offering (#6646)
    
    Fixes gpuType value in the add compute offering form during submit
---
 ui/src/views/offering/AddComputeOffering.vue | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/ui/src/views/offering/AddComputeOffering.vue b/ui/src/views/offering/AddComputeOffering.vue
index 3fa25e869a9..2022a53b186 100644
--- a/ui/src/views/offering/AddComputeOffering.vue
+++ b/ui/src/views/offering/AddComputeOffering.vue
@@ -885,9 +885,9 @@ export default {
     },
     handleGpuChange (val) {
       this.vGpuTypes = []
-      for (var i in this.gpuTypes) {
-        if (this.gpuTypes[i].value === val) {
-          this.vGpuTypes = this.gpuTypes[i].vgpu
+      for (var gpuType of this.gpuTypes) {
+        if (gpuType.value === val) {
+          this.vGpuTypes = gpuType.vgpu
           break
         }
       }
@@ -999,9 +999,7 @@ export default {
           params['serviceofferingdetails[1].key'] = 'pciDevice'
           params['serviceofferingdetails[1].value'] = values.pcidevice
         }
-        if ('vgputype' in values &&
-          this.vGpuTypes !== null && this.vGpuTypes !== undefined &&
-          values.vgputype > this.vGpuTypes.length) {
+        if ('vgputype' in values && this.arrayHasItems(this.vGpuTypes)) {
           params['serviceofferingdetails[2].key'] = 'vgpuType'
           params['serviceofferingdetails[2].value'] = this.vGpuTypes[values.vgputype]
         }