This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/main by this push: new bb70da0fed9 add compute offering details in UI (#8563) bb70da0fed9 is described below commit bb70da0fed9177bf971893a11ad9e2aac7e38e86 Author: dahn <d...@onecht.net> AuthorDate: Thu Feb 8 19:29:50 2024 +0100 add compute offering details in UI (#8563) * add compute offering details in UI * Pearl's sugestions --- ui/src/components/view/DetailsTab.vue | 8 +++++++- ui/src/config/section/offering.js | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ui/src/components/view/DetailsTab.vue b/ui/src/components/view/DetailsTab.vue index b04830b3c3c..5f270964297 100644 --- a/ui/src/components/view/DetailsTab.vue +++ b/ui/src/components/view/DetailsTab.vue @@ -37,7 +37,7 @@ size="small" :dataSource="fetchDetails()"> <template #renderItem="{item}"> - <a-list-item v-if="item in dataResource && !customDisplayItems.includes(item)"> + <a-list-item v-if="(item in dataResource && !customDisplayItems.includes(item)) || (offeringDetails.includes(item) && dataResource.serviceofferingdetails)"> <div> <strong>{{ item === 'service' ? $t('label.supportedservices') : $t('label.' + String(item).toLowerCase()) }}</strong> <br/> @@ -91,6 +91,9 @@ </span> </div> </div> + <div v-else-if="$route.meta.name === 'computeoffering' && offeringDetails.includes(item)"> + {{ dataResource.serviceofferingdetails[item] }} + </div> <div v-else>{{ dataResource[item] }}</div> </div> </a-list-item> @@ -255,6 +258,9 @@ export default { } return null }, + offeringDetails () { + return ['maxcpunumber', 'mincpunumber', 'minmemory', 'maxmemory'] + }, ipV6Address () { if (this.dataResource.nic && this.dataResource.nic.length > 0) { return this.dataResource.nic.filter(e => { return e.ip6address }).map(e => { return e.ip6address }).join(', ') diff --git a/ui/src/config/section/offering.js b/ui/src/config/section/offering.js index 27e7d32073a..65daaf53ae0 100644 --- a/ui/src/config/section/offering.js +++ b/ui/src/config/section/offering.js @@ -47,6 +47,13 @@ export default { store.getters.apis.createServiceOffering.params.filter(x => x.name === 'rootdisksize').length > 0) { fields.splice(12, 0, 'rootdisksize') } + const detailFields = ['minmemory', 'maxmemory', 'mincpunumber', 'maxcpunumber'] + for (const field of detailFields) { + if (store.getters.apis.createServiceOffering && + store.getters.apis.createServiceOffering.params.filter(x => field === x.name).length > 0) { + fields.push(field) + } + } return fields }, resourceType: 'ServiceOffering',