Merge pull request #134 from laf/issue-133

Tidied up syslog on various pages to use bootstrap
This commit is contained in:
Paul Gear
2014-03-03 10:19:59 +10:00
3 changed files with 34 additions and 9 deletions

View File

@@ -42,10 +42,14 @@ if ($_POST['program'])
$sql = "SELECT *, DATE_FORMAT(timestamp, '%Y-%m-%d %T') AS date from syslog WHERE device_id = ? $where";
$sql .= " ORDER BY timestamp DESC LIMIT 1000";
echo("<table cellspacing=0 cellpadding=2 width=100%>");
echo(' <div class="panel panel-default panel-condensed">
<div class="panel-heading">
<strong>Eventlog entries</strong>
</div>
<table class="table table-hover table-condensed table-striped">');
foreach (dbFetchRows($sql, $param) as $entry) { include("includes/print-syslog.inc.php"); }
echo("</table>");
echo(' </table>
</div>');
$pagetitle[] = "Syslog";
?>

View File

@@ -135,13 +135,24 @@ echo('
if ($config['enable_syslog'])
{
echo("<div class=front-syslog>
<h3>Recent Syslog Messages</h3>
");
$sql = "SELECT *, DATE_FORMAT(timestamp, '%D %b %T') AS date from syslog ORDER BY timestamp DESC LIMIT 20";
$query = mysql_query($sql);
echo('<table class="table table-bordered">');
echo('<div class="container-fluid">
<div class="row">
<div class="col-md-12">
&nbsp;
</div>
</row>
<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">');
while ($entry = mysql_fetch_assoc($query))
{
$entry = array_merge($entry, device_by_id_cache($entry['device_id']));
@@ -150,6 +161,9 @@ if ($config['enable_syslog'])
}
echo("</table>");
echo("</div>");
echo("</div>");
echo("</div>");
echo("</div>");
} else {

View File

@@ -89,13 +89,20 @@ if ($_SESSION['userlevel'] >= '5')
$array = array_merge(array($_SESSION['user_id']), $array);
}
echo("<table cellspacing=0 cellpadding=2 width=100%>");
echo('<div class="panel panel-default panel-condensed">
<div class="panel-heading">
<strong>Eventlog entries</strong>
</div>
<table class="table table-hover table-condensed table-striped">');
foreach (dbFetchRows($sql, $array) as $entry)
{
$entry = array_merge($entry, device_by_id_cache($entry['device_id']));
include("includes/print-syslog.inc.php");
}
echo("</table>");
echo("</table>
</div>");
?>