Skip to content

Commit 716d823

Browse files
author
Landry JUGE
committed
Fixing loading of category in add and clone compute offering
1 parent ba7b6dc commit 716d823

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

ui/src/components/offering/ComputeOfferingForm.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,9 @@ export default {
686686
leaseexpiryaction: undefined,
687687
vgpuProfiles: [],
688688
vgpuProfileLoading: false,
689-
externalDetailsEnabled: false
689+
externalDetailsEnabled: false,
690+
categories: [],
691+
categoryLoading: false
690692
}
691693
},
692694
created () {
@@ -707,6 +709,7 @@ export default {
707709
this.fetchDomainData()
708710
this.fetchZoneData()
709711
this.fetchGPUCards()
712+
this.fetchCategories()
710713
if (isAdmin()) {
711714
this.fetchStorageTagData()
712715
this.fetchDeploymentPlannerData()
@@ -728,6 +731,14 @@ export default {
728731
this.gpuCardLoading = false
729732
})
730733
},
734+
fetchCategories () {
735+
this.categoryLoading = true
736+
getAPI('listServiceOfferingCategories', {}).then(json => {
737+
this.categories = json.listserviceofferingcategoriesresponse.serviceofferingcategory || []
738+
}).finally(() => {
739+
this.categoryLoading = false
740+
})
741+
},
731742
addDiskOffering () { this.showDiskOfferingModal = true },
732743
fetchDiskOfferings () {
733744
this.diskOfferingLoading = true

ui/src/views/offering/CloneComputeOffering.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ export default {
140140
leaseexpiryaction: undefined,
141141
vgpuProfiles: [],
142142
vgpuProfileLoading: false,
143-
externalDetailsEnabled: false
143+
externalDetailsEnabled: false,
144+
categories: [],
145+
categoryLoading: false
144146
}
145147
},
146148
beforeCreate () {
@@ -252,6 +254,7 @@ export default {
252254
this.fetchDomainData()
253255
this.fetchZoneData()
254256
this.fetchGPUCards()
257+
this.fetchCategories()
255258
if (isAdmin()) {
256259
this.fetchStorageTagData()
257260
this.fetchDeploymentPlannerData()
@@ -397,6 +400,15 @@ export default {
397400
this.gpuCardLoading = false
398401
})
399402
},
403+
fetchCategories () {
404+
this.categoryLoading = true
405+
getAPI('listServiceOfferingCategories', {
406+
}).then(json => {
407+
this.categories = json.listserviceofferingcategoriesresponse.serviceofferingcategory || []
408+
}).finally(() => {
409+
this.categoryLoading = false
410+
})
411+
},
400412
fetchDiskOfferings () {
401413
this.diskOfferingLoading = true
402414
getAPI('listDiskOfferings', {
@@ -502,6 +514,10 @@ export default {
502514
params.diskofferingid = values.diskofferingid
503515
}
504516
517+
if (values.categoryid) {
518+
params.categoryid = values.categoryid
519+
}
520+
505521
if (values.vgpuprofile) {
506522
params.vgpuprofileid = values.vgpuprofile
507523
}

0 commit comments

Comments
 (0)