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

@@ -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";
}
}