From 1afcd823e004a744b8a613b99a2cf26051decb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Beims=20Br=C3=A4scher?= Date: Wed, 9 Jun 2021 02:44:18 -0300 Subject: [PATCH] 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 --- .../api/query/dao/ServiceOfferingJoinDaoImpl.java | 10 +++++++++- ui/src/components/view/DetailsTab.vue | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java b/server/src/main/java/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java index 87b03748dbc..9950b90a2f2 100644 --- a/server/src/main/java/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java +++ b/server/src/main/java/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java @@ -45,6 +45,13 @@ public class ServiceOfferingJoinDaoImpl extends GenericDaoBase 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
- {{ parseFloat( resource.rootdisksize / (1024.0 * 1024.0 * 1024.0)).toFixed(1) }} GB + {{ resource.rootdisksize }} GB