mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
server: Root disk size should be listed in GB at listServiceOffering (#5085)
* Root disk size should be listed in GB at listServiceOffering * Update UI to handle rootdisk size in GB instead of Bytes
This commit is contained in:
parent
8fe0ff854b
commit
1afcd823e0
@ -45,6 +45,13 @@ public class ServiceOfferingJoinDaoImpl extends GenericDaoBase<ServiceOfferingJo
|
||||
|
||||
private SearchBuilder<ServiceOfferingJoinVO> sofIdSearch;
|
||||
|
||||
/**
|
||||
* Constant used to convert GB into Bytes (or the other way around).
|
||||
* GB * MB * KB = Bytes //
|
||||
* 1024 * 1024 * 1024 = 1073741824
|
||||
*/
|
||||
private static final long GB_TO_BYTES = 1073741824;
|
||||
|
||||
protected ServiceOfferingJoinDaoImpl() {
|
||||
|
||||
sofIdSearch = createSearchBuilder();
|
||||
@ -123,7 +130,8 @@ public class ServiceOfferingJoinDaoImpl extends GenericDaoBase<ServiceOfferingJo
|
||||
}
|
||||
}
|
||||
|
||||
offeringResponse.setRootDiskSize(offering.getRootDiskSize());
|
||||
long rootDiskSizeInGb = (long) offering.getRootDiskSize() / GB_TO_BYTES;
|
||||
offeringResponse.setRootDiskSize(rootDiskSizeInGb);
|
||||
|
||||
return offeringResponse;
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
</div>
|
||||
<div v-else-if="$route.meta.name === 'computeoffering' && item === 'rootdisksize'">
|
||||
<div>
|
||||
{{ parseFloat( resource.rootdisksize / (1024.0 * 1024.0 * 1024.0)).toFixed(1) }} GB
|
||||
{{ resource.rootdisksize }} GB
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="['name', 'type'].includes(item)">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user