Index: html/pages/front/default.php =================================================================== --- html/pages/front/default.php (revision 5326) +++ html/pages/front/default.php (working copy) @@ -544,7 +544,12 @@ { // Show syslog $show_syslog = "<div class=\"row\">"; - $show_syslog .= " <div class=\"col-md-12 \">"; + if ($config['splitlog'] and in_array("eventlog",$config['frontpage']['order'])) + { + $show_syslog .= " <div class=\"col-md-6 \">"; + }else{ + $show_syslog .= " <div class=\"col-md-12 \">"; + } $show_syslog .= " <h3 class=\"bill\">Recent Syslog Messages</h3>"; 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 <<<EVENTS - <div class="row"> - <div class="col-md-12"> - <h3 class="bill">Recent Eventlog Entries</h3> -EVENTS; + $show_eventlog = "<div class=\"row\">"; + if ($config['splitlog'] and in_array("syslog",$config['frontpage']['order'])) + { + $show_eventlog .= "<div class=\"col-md-6\">"; + }else{ + $show_eventlog .= "<div class=\"col-md-12\">"; + } + $show_eventlog .= "<h3 class=\"bill\">Recent Eventlog Entries</h3>"; + echo $show_eventlog; print_events(array('pagesize' => $config['frontpage']['eventlog']['items'])); - echo " </div>\n</div>"; + $show_eventlog = " </div>"; + $show_eventlog .= "</div"; + echo $show_eventlog; } // End show_eventlog // EOF Index: html/includes/print/events.inc.php =================================================================== --- html/includes/print/events.inc.php (revision 5326) +++ html/includes/print/events.inc.php (working copy) @@ -30,7 +30,9 @@ { // Get events array $events = get_events_array($vars); - + + $splitview = ($GLOBALS['config']['splitlog'] && $vars['section'] != "eventlog" && in_array("syslog",$GLOBALS['config']['frontpage']['order'])) ? true : false ; + if (!$events['count']) { // There have been no entries returned. Print the warning. @@ -49,7 +51,7 @@ $string .= ' <th>Date</th>' . PHP_EOL; if ($list['device']) { $string .= ' <th>Device</th>' . PHP_EOL; } if ($list['port']) { $string .= ' <th>Entity</th>' . PHP_EOL; } - $string .= ' <th>Message</th>' . PHP_EOL; + if(!$splitview) { $string .= ' <th>Message</th>' . PHP_EOL; } $string .= ' </tr>' . PHP_EOL; $string .= ' </thead>' . PHP_EOL; } @@ -92,11 +94,12 @@ } if (!$events['short']) { $string .= ' <td>' . $entry['link'] . '</td>' . PHP_EOL; } } + if($splitview) { $string .= ' </tr><tr> '; } if ($events['short']) { - $string .= ' <td class="syslog">' . $entry['link'] . ' '; + $string .= ' <td ' . ($splitview ? 'colspan=3' : 'colspan=1') . 'class="syslog">' . $entry['link'] . ' '; } else { - $string .= ' <td>'; + $string .= ' <td ' . ($splitview ? 'colspan=3' : 'colspan=1') . '>'; } $string .= htmlspecialchars($entry['message']) . '</td>' . PHP_EOL; $string .= ' </tr>' . 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 .= ' <th>Date</th>' . PHP_EOL; if ($list['device']) { $string .= ' <th>Device</th>' . PHP_EOL; } if ($list['priority']) { $string .= ' <th>Priority</th>' . PHP_EOL; } - $string .= ' <th>Message</th>' . PHP_EOL; + if (!$splitview) { $string .= ' <th>Message</th>' . PHP_EOL; } $string .= ' </tr>' . PHP_EOL; $string .= ' </thead>' . PHP_EOL; } @@ -174,12 +176,13 @@ if (!$short) { $string .= ' <td style="color: ' . $priorities[$entry['priority']]['color'] . '; white-space: nowrap;">' . nicecase($priorities[$entry['priority']]['name']) . ' (' . $entry['priority'] . ')</td>' . PHP_EOL; } } $entry['program'] = (empty($entry['program'])) ? '[[EMPTY]]' : $entry['program']; + if ($splitview) { $string .= ' </tr><tr> '; } if ($short) { - $string .= ' <td class="syslog">'; + $string .= ' <td ' . ($splitview ? 'colspan=3' : 'colspan=1') . 'class="syslog">'; $string .= '<strong style="color: ' . $priorities[$entry['priority']]['color'] . ';">' . $entry['program'] . '</strong> : '; } else { - $string .= ' <td>'; + $string .= ' <td ' . ($splitview ? 'colspan=3' : 'colspan=1') . '>'; $string .= '<strong>' . $entry['program'] . '</strong> : '; } $string .= htmlspecialchars($entry['msg']) . '</td>' . 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)