mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
Print alert state and a matching glyphic
- Print alert state on default front page and on alert-log page. Prints the state and a matching glyphicon.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
$hostname = gethostbyid($alert_entry['device_id']);
|
||||
$alert_state = $alert_entry['state'];
|
||||
|
||||
echo('<tr>
|
||||
<td>
|
||||
@@ -14,8 +15,26 @@ if (!isset($alert_entry['device'])) {
|
||||
</td>");
|
||||
}
|
||||
|
||||
echo("<td>".htmlspecialchars($alert_entry['name']) . "</td>
|
||||
echo("<td>".htmlspecialchars($alert_entry['name']) . "</td>");
|
||||
|
||||
</tr>");
|
||||
if ($alert_state!='') {
|
||||
if ($alert_state=='0') {
|
||||
echo("<td><b><span class='glyphicon glyphicon-ok' style='color:green'></span> Ok</b></td>");
|
||||
}
|
||||
elseif ($alert_state=='1') {
|
||||
echo("<td><b><span class='glyphicon glyphicon-remove' style='color:red'></span> Alert</b></td>");
|
||||
}
|
||||
elseif ($alert_state=='2') {
|
||||
echo("<td><b><span class='glyphicon glyphicon-info-sign' style='color:lightgrey'></span> Ack</b></td>");
|
||||
}
|
||||
elseif ($alert_state=='3') {
|
||||
echo("<td><b><span class='glyphicon glyphicon-arrow-down' style='color:orange'></span> Worse</b></td>");
|
||||
}
|
||||
elseif ($alert_state=='4') {
|
||||
echo("<td><b><span class='glyphicon glyphicon-arrow-up' style='color:khaki'></span> Better</b></td>");
|
||||
}
|
||||
}
|
||||
|
||||
echo("</tr>");
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user