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:
@@ -188,6 +188,7 @@ foreach ($rule_list as $rule) {
|
||||
}
|
||||
|
||||
$sub = dbFetchRows('SELECT * FROM alerts WHERE rule_id = ? ORDER BY `state` DESC, `id` DESC LIMIT 1', array($rule['id']));
|
||||
$severity = dbFetchCell('SELECT severity FROM alert_rules where id = ?', array($rule['id']));
|
||||
$ico = 'check';
|
||||
$col = 'success';
|
||||
$extra = '';
|
||||
@@ -200,9 +201,10 @@ foreach ($rule_list as $rule) {
|
||||
$status_msg = "All devices matching " . $rule['name'] . " are OK";
|
||||
}
|
||||
if ((int) $sub['state'] === 1 || (int) $sub['state'] === 2) {
|
||||
$ico = 'exclamation';
|
||||
$col = 'danger';
|
||||
$extra = 'danger';
|
||||
$alert_style = alert_layout($severity);
|
||||
$ico = $alert_style['icon'];
|
||||
$col = $alert_style['icon_color'];
|
||||
$extra = $alert_style['background_color'];
|
||||
$status_msg = "Some devices matching " . $rule['name'] . " are currently alerting";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user