";
+ }
$show_syslog .= "
Recent Syslog Messages
";
echo $show_syslog;
print_syslogs(array('pagesize' => $config['frontpage']['syslog']['items'], 'priority' => $config['frontpage']['syslog']['priority']));
@@ -556,13 +561,19 @@
function show_eventlog($config)
{
// Show eventlog
- echo <<
-
-
Recent Eventlog Entries
-EVENTS;
+ $show_eventlog = "
";
+ if ($config['splitlog'] and in_array("syslog",$config['frontpage']['order']))
+ {
+ $show_eventlog .= "
";
+ }else{
+ $show_eventlog .= "
";
+ }
+ $show_eventlog .= "
Recent Eventlog Entries
";
+ echo $show_eventlog;
print_events(array('pagesize' => $config['frontpage']['eventlog']['items']));
- echo " \n
";
+ $show_eventlog = "
";
+ $show_eventlog .= "
Date' . PHP_EOL;
if ($list['device']) { $string .= ' Device | ' . PHP_EOL; }
if ($list['port']) { $string .= ' Entity | ' . PHP_EOL; }
- $string .= ' Message | ' . PHP_EOL;
+ if(!$splitview) { $string .= ' Message | ' . PHP_EOL; }
$string .= ' ' . PHP_EOL;
$string .= ' ' . PHP_EOL;
}
@@ -92,11 +94,12 @@
}
if (!$events['short']) { $string .= ' ' . $entry['link'] . ' | ' . PHP_EOL; }
}
+ if($splitview) { $string .= ' '; }
if ($events['short'])
{
- $string .= ' ' . $entry['link'] . ' ';
+ $string .= ' | ' . $entry['link'] . ' ';
} else {
- $string .= ' | ';
+ $string .= ' | ';
}
$string .= htmlspecialchars($entry['message']) . ' | ' . PHP_EOL;
$string .= '
' . PHP_EOL;
Index: html/includes/print/syslogs.inc.php
===================================================================
--- html/includes/print/syslogs.inc.php (revision 5326)
+++ html/includes/print/syslogs.inc.php (working copy)
@@ -36,6 +36,8 @@
$pagesize = (isset($vars['pagesize']) && !empty($vars['pagesize'])) ? $vars['pagesize'] : 10;
$start = $pagesize * $pageno - $pagesize;
+ $splitview = ($GLOBALS['config']['splitlog'] && $vars['section'] != "syslog" && in_array("eventlog",$GLOBALS['config']['frontpage']['order'])) ? true : false;
+
$priorities = $GLOBALS['config']['syslog']['priorities'];
$param = array();
@@ -141,7 +143,7 @@
$string .= ' Date | ' . PHP_EOL;
if ($list['device']) { $string .= ' Device | ' . PHP_EOL; }
if ($list['priority']) { $string .= ' Priority | ' . PHP_EOL; }
- $string .= ' Message | ' . PHP_EOL;
+ if (!$splitview) { $string .= ' Message | ' . PHP_EOL; }
$string .= ' ' . PHP_EOL;
$string .= ' ' . PHP_EOL;
}
@@ -174,12 +176,13 @@
if (!$short) { $string .= ' ' . nicecase($priorities[$entry['priority']]['name']) . ' (' . $entry['priority'] . ') | ' . PHP_EOL; }
}
$entry['program'] = (empty($entry['program'])) ? '[[EMPTY]]' : $entry['program'];
+ if ($splitview) { $string .= ' '; }
if ($short)
{
- $string .= ' ';
+ $string .= ' | ';
$string .= '' . $entry['program'] . ' : ';
} else {
- $string .= ' | ';
+ $string .= ' | ';
$string .= '' . $entry['program'] . ' : ';
}
$string .= htmlspecialchars($entry['msg']) . ' | ' . PHP_EOL;
Index: includes/defaults.inc.php
===================================================================
--- includes/defaults.inc.php (revision 5326)
+++ includes/defaults.inc.php (working copy)
@@ -286,6 +286,7 @@
$config['frontpage']['eventlog']['items'] = 15; // Only show the last XX items of the eventlog view
$config['frontpage']['syslog']['items'] = 25; // Only show the last XX items of the syslog view
$config['frontpage']['syslog']['priority'] = array('emerg','alert','crit','err','warning','notice'); // Show syslog entries only with this priorities (default: Notification)
+$config['splitlog'] = FALSE; // Set to TRUE to enable side by side syslog and eventlog on frontpage
// Map overview settings
$config['frontpage']['map']['api'] = "google-mc"; // Set to google-mc if you have a lot of devices. (Allowed: google, google-mc)