Merge pull request #1717 from vitalisator/syslog

Syslog
This commit is contained in:
Neil Lathwood
2015-08-21 22:05:11 +01:00
+24 -22
View File
@@ -1,28 +1,30 @@
<?php
$sql = "SELECT *, DATE_FORMAT(timestamp, '".$config['dateformat']['mysql']['compact']."') AS date from syslog ORDER BY timestamp DESC LIMIT 20";
$common_output[] = '
<table id="syslog" class="table table-hover table-condensed table-striped">
<thead>
<tr>
<th data-column-id="timestamp" data-order="desc">Datetime</th>
<th data-column-id="device_id">Hostname</th>
<th data-column-id="program">Program</th>
<th data-column-id="msg">Message</th>
</tr>
</thead>
</table>
$syslog_output = '
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default panel-condensed">
<div class="panel-heading">
<strong>Syslog entries</strong>
</div>
<table class="table table-hover table-condensed table-striped">';
<script>
foreach (dbFetchRows($sql) as $entry) {
$entry = array_merge($entry, device_by_id_cache($entry['device_id']));
include 'includes/print-syslog.inc.php';
}
var syslog_grid = $("#syslog").bootgrid({
ajax: true,
post: function ()
{
return {
id: "syslog",
device: "' .mres($vars['device']) .'",
};
},
url: "ajax_table.php"
});
$syslog_output .= '
</table>
</div>
</div>
</div>
</div>
</script>
';
$common_output[] = $syslog_output;