mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user