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/04/29 10:28:34 UTC

[cloudstack-primate] branch master updated: dashboard: enforce stats threshold at 80% (#309)

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


The following commit(s) were added to refs/heads/master by this push:
     new ec0124c  dashboard: enforce stats threshold at 80% (#309)
ec0124c is described below

commit ec0124cd8d3266305a25992aec45593804ce6cda
Author: Abhishek Kumar <ab...@gmail.com>
AuthorDate: Wed Apr 29 15:58:25 2020 +0530

    dashboard: enforce stats threshold at 80% (#309)
    
    Fixes #308
    
    Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
---
 src/views/dashboard/CapacityDashboard.vue | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/views/dashboard/CapacityDashboard.vue b/src/views/dashboard/CapacityDashboard.vue
index 04d5518..f8f0e62 100644
--- a/src/views/dashboard/CapacityDashboard.vue
+++ b/src/views/dashboard/CapacityDashboard.vue
@@ -59,7 +59,8 @@
                 type="dashboard"
                 :status="getStatus(parseFloat(stat.percentused))"
                 :percent="parseFloat(stat.percentused)"
-                :format="percent => `${parseFloat(stat.percentused, 10).toFixed(2)}%`"
+                :format="percent => `${parseFloat(stat.percentused).toFixed(2)}%`"
+                :strokeColor="getStrokeColour(parseFloat(stat.percentused))"
                 :width="100" />
             </div>
             <template slot="footer"><center>{{ displayData(stat.name, stat.capacityused) }} / {{ displayData(stat.name, stat.capacitytotal) }}</center></template>
@@ -165,6 +166,12 @@ export default {
       }
       return 'normal'
     },
+    getStrokeColour (value) {
+      if (value >= 80) {
+        return 'red'
+      }
+      return 'primary'
+    },
     displayData (dataType, value) {
       switch (dataType) {
         case 'CPU':