Skip to content

Commit 780bb24

Browse files
authored
ui: fix gputype in add compute offering (#6646)
Fixes gpuType value in the add compute offering form during submit
1 parent ef2997c commit 780bb24

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

ui/src/views/offering/AddComputeOffering.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -885,9 +885,9 @@ export default {
885885
},
886886
handleGpuChange (val) {
887887
this.vGpuTypes = []
888-
for (var i in this.gpuTypes) {
889-
if (this.gpuTypes[i].value === val) {
890-
this.vGpuTypes = this.gpuTypes[i].vgpu
888+
for (var gpuType of this.gpuTypes) {
889+
if (gpuType.value === val) {
890+
this.vGpuTypes = gpuType.vgpu
891891
break
892892
}
893893
}
@@ -999,9 +999,7 @@ export default {
999999
params['serviceofferingdetails[1].key'] = 'pciDevice'
10001000
params['serviceofferingdetails[1].value'] = values.pcidevice
10011001
}
1002-
if ('vgputype' in values &&
1003-
this.vGpuTypes !== null && this.vGpuTypes !== undefined &&
1004-
values.vgputype > this.vGpuTypes.length) {
1002+
if ('vgputype' in values && this.arrayHasItems(this.vGpuTypes)) {
10051003
params['serviceofferingdetails[2].key'] = 'vgpuType'
10061004
params['serviceofferingdetails[2].value'] = this.vGpuTypes[values.vgputype]
10071005
}

0 commit comments

Comments
 (0)