diff --git a/src/sunstone/etc/sunstone-server.conf b/src/sunstone/etc/sunstone-server.conf index 53ce93ec2e..17a84e1f79 100644 --- a/src/sunstone/etc/sunstone-server.conf +++ b/src/sunstone/etc/sunstone-server.conf @@ -244,4 +244,9 @@ color: "#e1ef08" warning: time: "-86400" - color: "#ef2808" \ No newline at end of file + color: "#ef2808" + +# This change the thresholds of dashboard resource usage +:threshold_min: 0 +:threshold_low: 33 +:threshold_high: 66 \ No newline at end of file diff --git a/src/sunstone/public/app/sunstone-config.js b/src/sunstone/public/app/sunstone-config.js index dd0a3dc4c9..62f31fd3f5 100644 --- a/src/sunstone/public/app/sunstone-config.js +++ b/src/sunstone/public/app/sunstone-config.js @@ -176,6 +176,11 @@ define(function(require) { "allTabs": function() { return Object.keys(_config["view"]["tabs"]); + }, + "thresholds":{ + "min":_config["user_config"]["threshold_min"], + "low":_config["user_config"]["threshold_low"], + "high":_config["user_config"]["threshold_high"] } }; diff --git a/src/sunstone/public/app/tabs/hosts-tab/datatable.js b/src/sunstone/public/app/tabs/hosts-tab/datatable.js index 2c4c3aa801..94a1880d3f 100644 --- a/src/sunstone/public/app/tabs/hosts-tab/datatable.js +++ b/src/sunstone/public/app/tabs/hosts-tab/datatable.js @@ -317,6 +317,9 @@ define(function(require) { } function quotaDashboard(html_tag, legend, font_large_size, font_small_size, quota) { + var min = SunstoneConfig.thresholds.min; + var low = SunstoneConfig.thresholds.low; + var high = SunstoneConfig.thresholds.high; return "
" + "
" + "" + legend + "" + @@ -324,7 +327,7 @@ define(function(require) { "
" + "
" + "
" + - " " + + " " + "
" + "
" + "
" + diff --git a/src/sunstone/views/index.erb b/src/sunstone/views/index.erb index eae5c99a07..2f95525588 100644 --- a/src/sunstone/views/index.erb +++ b/src/sunstone/views/index.erb @@ -37,7 +37,10 @@ 'vnc_wss' : '<%= session[:vnc_wss] %>', 'table_order' : '<%= session[:table_order] %>', 'default_view' : '<%= session[:default_view] %>', - 'page_length' : '<%= session[:page_length] %>' + 'page_length' : '<%= session[:page_length] %>', + 'threshold_min' : '<%= $conf[:threshold_min] %>', + 'threshold_low' : '<%= $conf[:threshold_low] %>', + 'threshold_high' : '<%= $conf[:threshold_high] %>', }, 'system_config' : { 'marketplace_url' : '<%= $conf[:marketplace_url] %>',