mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
webui: New eventlog severity classification (#5830)
* New event log severity model * Revert "New event log severity model" This reverts commit0783527af8
. * New event log severity model * Fixed spaces vs tabs * Learning the format requirements * Learning the format requirements * Moved the colours in to the stylesheet * change SQL file to stop conflicting * refactor log_event so severity isn't last, but reference is. * keep having to move the file due to new PR conflicts * Revert "keep having to move the file due to new PR conflicts" This reverts commitf3030e7218
. * extended support to dashboard and eventlog page * formatting
This commit is contained in:
committed by
Neil Lathwood
parent
a75ec7ab31
commit
5bfd23e7eb
@ -711,46 +711,6 @@ function print_optionbar_end()
|
||||
}//end print_optionbar_end()
|
||||
|
||||
|
||||
function geteventicon($message)
|
||||
{
|
||||
if ($message == 'Device status changed to Down from check') {
|
||||
$icon = 'fa-bookmark';
|
||||
$icon_colour = 'red';
|
||||
}
|
||||
|
||||
if ($message == 'Device status changed to Up from check') {
|
||||
$icon = 'fa-bookmark';
|
||||
$icon_colour = 'green';
|
||||
}
|
||||
|
||||
if ($message == 'Interface went down' || $message == 'Interface changed state to Down' || $message == 'ifOperStatus: up -> down') {
|
||||
$icon = 'fa-bookmark';
|
||||
$icon_colour = 'red';
|
||||
}
|
||||
|
||||
if ($message == 'Interface went up' || $message == 'Interface changed state to Up' || $message == 'ifOperStatus: down -> up') {
|
||||
$icon = 'fa-bookmark';
|
||||
$icon_colour = 'green';
|
||||
}
|
||||
|
||||
if ($message == 'Interface disabled' || $message == 'ifAdminStatus: up -> down') {
|
||||
$icon = 'fa-bookmark';
|
||||
$icon_colour = 'grey';
|
||||
}
|
||||
|
||||
if ($message == 'Interface enabled' || $message == 'ifAdminStatus: down -> up') {
|
||||
$icon = 'fa-bookmark';
|
||||
$icon_colour = 'green';
|
||||
}
|
||||
|
||||
if (isset($icon)) {
|
||||
return array('icon' => $icon,'colour' => $icon_colour);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}//end geteventicon()
|
||||
|
||||
|
||||
function overlibprint($text)
|
||||
{
|
||||
return "onmouseover=\"return overlib('".$text."');\" onmouseout=\"return nd();\"";
|
||||
@ -1426,3 +1386,31 @@ function array_to_htmljson($data)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $eventlog_severity
|
||||
* @return $eventlog_severity_icon
|
||||
*/
|
||||
function eventlog_severity($eventlog_severity)
|
||||
{
|
||||
switch ($eventlog_severity) {
|
||||
case 1:
|
||||
return "severity-ok"; //OK
|
||||
break;
|
||||
case 2:
|
||||
return "severity-info"; //Informational
|
||||
break;
|
||||
case 3:
|
||||
return "severity-notice"; //Notice
|
||||
break;
|
||||
case 4:
|
||||
return "severity-warning"; //Warning
|
||||
break;
|
||||
case 5:
|
||||
return "severity-critical"; //Critical
|
||||
break;
|
||||
default:
|
||||
return "severity-unknown"; //Unknown
|
||||
break;
|
||||
}
|
||||
} // end eventlog_severity
|
||||
|
Reference in New Issue
Block a user