You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2020/05/06 21:57:28 UTC
[cloudstack-primate] 01/02: dashboard: convert GB to TB for storage
metrics if applicable
This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git
commit cbe49b3de67522c3b21b2fc43f3fe41d1028dd48
Author: Rohit Yadav <ro...@shapeblue.com>
AuthorDate: Thu May 7 03:05:09 2020 +0530
dashboard: convert GB to TB for storage metrics if applicable
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
---
src/views/dashboard/CapacityDashboard.vue | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/views/dashboard/CapacityDashboard.vue b/src/views/dashboard/CapacityDashboard.vue
index f8f0e62..8e1c97f 100644
--- a/src/views/dashboard/CapacityDashboard.vue
+++ b/src/views/dashboard/CapacityDashboard.vue
@@ -182,7 +182,12 @@ export default {
case 'STORAGE_ALLOCATED':
case 'SECONDARY_STORAGE':
case 'CAPACITY_TYPE_LOCAL_STORAGE':
- value = parseFloat(value / (1024 * 1024 * 1024.0), 10).toFixed(2) + ' GB'
+ value = parseFloat(value / (1024 * 1024 * 1024.0), 10).toFixed(2)
+ if (value >= 1024.0) {
+ value = parseFloat(value / 1024.0).toFixed(2) + ' TB'
+ } else {
+ value = value + ' GB'
+ }
break
}
return value