diff --git a/ui/src/components/offering/ComputeOfferingForm.vue b/ui/src/components/offering/ComputeOfferingForm.vue index af071fe7c5b..fef48037fa9 100644 --- a/ui/src/components/offering/ComputeOfferingForm.vue +++ b/ui/src/components/offering/ComputeOfferingForm.vue @@ -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 diff --git a/ui/src/views/offering/CloneComputeOffering.vue b/ui/src/views/offering/CloneComputeOffering.vue index 07ce8852add..8ed257fecf4 100644 --- a/ui/src/views/offering/CloneComputeOffering.vue +++ b/ui/src/views/offering/CloneComputeOffering.vue @@ -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 }