Fixing loading of category in add and clone compute offering

This commit is contained in:
Landry JUGE 2026-03-18 22:03:59 +01:00
parent ba7b6dc984
commit 716d823fbf
2 changed files with 29 additions and 2 deletions

View File

@ -686,7 +686,9 @@ export default {
leaseexpiryaction: undefined,
vgpuProfiles: [],
vgpuProfileLoading: false,
externalDetailsEnabled: false
externalDetailsEnabled: false,
categories: [],
categoryLoading: false
}
},
created () {
@ -707,6 +709,7 @@ export default {
this.fetchDomainData()
this.fetchZoneData()
this.fetchGPUCards()
this.fetchCategories()
if (isAdmin()) {
this.fetchStorageTagData()
this.fetchDeploymentPlannerData()
@ -728,6 +731,14 @@ export default {
this.gpuCardLoading = false
})
},
fetchCategories () {
this.categoryLoading = true
getAPI('listServiceOfferingCategories', {}).then(json => {
this.categories = json.listserviceofferingcategoriesresponse.serviceofferingcategory || []
}).finally(() => {
this.categoryLoading = false
})
},
addDiskOffering () { this.showDiskOfferingModal = true },
fetchDiskOfferings () {
this.diskOfferingLoading = true

View File

@ -140,7 +140,9 @@ export default {
leaseexpiryaction: undefined,
vgpuProfiles: [],
vgpuProfileLoading: false,
externalDetailsEnabled: false
externalDetailsEnabled: false,
categories: [],
categoryLoading: false
}
},
beforeCreate () {
@ -252,6 +254,7 @@ export default {
this.fetchDomainData()
this.fetchZoneData()
this.fetchGPUCards()
this.fetchCategories()
if (isAdmin()) {
this.fetchStorageTagData()
this.fetchDeploymentPlannerData()
@ -397,6 +400,15 @@ export default {
this.gpuCardLoading = false
})
},
fetchCategories () {
this.categoryLoading = true
getAPI('listServiceOfferingCategories', {
}).then(json => {
this.categories = json.listserviceofferingcategoriesresponse.serviceofferingcategory || []
}).finally(() => {
this.categoryLoading = false
})
},
fetchDiskOfferings () {
this.diskOfferingLoading = true
getAPI('listDiskOfferings', {
@ -502,6 +514,10 @@ export default {
params.diskofferingid = values.diskofferingid
}
if (values.categoryid) {
params.categoryid = values.categoryid
}
if (values.vgpuprofile) {
params.vgpuprofileid = values.vgpuprofile
}