webgui: Added ability to set warning percentage for CPU, mempools from device edit page (#5895)

This commit is contained in:
Robbie Penziol
2017-03-03 15:07:12 +00:00
committed by Neil Lathwood
parent 354bd2144d
commit afb838bc10
18 changed files with 399 additions and 12 deletions
+8 -2
View File
@@ -196,10 +196,16 @@ function generate_overlib_content($graph_array, $text)
}//end generate_overlib_content()
function get_percentage_colours($percentage)
function get_percentage_colours($percentage, $component_perc_warn = null)
{
$perc_warn = '75';
if (isset($component_perc_warn)) {
$perc_warn = round($component_perc_warn, 0);
}
$background = array();
if ($percentage > '90') {
if ($percentage > $perc_warn) {
$background['left'] = 'c4323f';
$background['right'] = 'C96A73';
} elseif ($percentage > '75') {