Running Alerts colorized depending on to their severity (#11210)

* Running Alerts colorized depending on to their severity

* extra alert styling to generic function

* .

* link from table alerts to alert_layout function

* info icon for information alert severity
This commit is contained in:
SourceDoctor
2020-03-01 15:50:45 +01:00
committed by GitHub
parent 335a238349
commit d2247ebda3
3 changed files with 33 additions and 17 deletions

View File

@@ -331,6 +331,33 @@ function print_graph_tag($args)
echo generate_graph_tag($args);
}//end print_graph_tag()
function alert_layout($severity)
{
switch ($severity) {
case 'critical':
$icon = 'exclamation';
$color = 'danger';
$background = 'danger';
break;
case 'warning':
$icon = 'warning';
$color = 'warning';
$background = 'warning';
break;
case 'ok':
$icon = 'check';
$color = 'success';
$background = 'success';
break;
default:
$icon = 'info';
$color = 'info';
$background = 'info';
}
return ['icon' => $icon,
'icon_color' => $color,
'background_color' => $background];
}
function generate_graph_tag($args)
{