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

@@ -132,20 +132,7 @@ foreach (dbFetchRows($sql, $param) as $alert) {
$hostname = '<div class="incident">' . generate_device_link($alert, format_hostname($alert, shorthost($alert['hostname']))) . '<div id="incident' . ($alert['id']) . '" class="collapse">' . $fault_detail . '</div></div>';
$severity = $alert['severity'];
switch ($severity) {
case 'critical':
$severity_ico = '<span class="alert-status label-danger">&nbsp;</span>';
break;
case 'warning':
$severity_ico = '<span class="alert-status label-warning">&nbsp;</span>';
break;
case 'ok':
$severity_ico = '<span class="alert-status label-success">&nbsp;</span>';
break;
default:
$severity_ico = '<span class="alert-status label-info">&nbsp;</span>';
break;
}
$severity_ico = '<span class="alert-status label-' . alert_layout($severity)['background_color'] . '">&nbsp;</span>';
if ($alert['state'] == 3) {
$severity .= ' <strong>+</strong>';