webui: Add bootgrid for authlog page, and fix poll-log searchbar layout on smaller screens (#6805)

This commit is contained in:
Aldemir Akpinar
2017-06-09 19:50:56 +01:00
committed by Neil Lathwood
parent 5966eaec8d
commit 57c9151363
2 changed files with 12 additions and 5 deletions
+10 -3
View File
@@ -1,8 +1,8 @@
<?php
echo "<h3>Authlog</h3>";
if ($_SESSION['userlevel'] >= '10') {
echo '<table class="table table-hover table-condensed">';
echo "<th>Timestamp</th><th>User</th><th>IP Address</th><th>Result</th>";
echo '<table id="authlogtable" class="table table-hover table-condensed">';
echo "<thead><th data-column-id='timestamp'>Timestamp</th><th data-column-id='user'>User</th><th data-column-id='ip'>IP Address</th><th data-column-id='authres'>Result</th></thead><tbody>";
foreach (dbFetchRows("SELECT *,DATE_FORMAT(datetime, '".$config['dateformat']['mysql']['compact']."') as humandate FROM `authlog` ORDER BY `datetime` DESC LIMIT 0,250") as $entry) {
if ($bg == $list_colour_a) {
$bg = $list_colour_b;
@@ -28,7 +28,14 @@ if ($_SESSION['userlevel'] >= '10') {
$pagetitle[] = 'Authlog';
echo '</table>';
echo '</tbody></table>';
} else {
include 'includes/error-no-perm.inc.php';
}//end if
?>
<script>
$('#authlogtable').bootgrid({
rowCount: [50, 100, 250, -1],
columnSelection: true,
});
</script>
+2 -2
View File
@@ -19,10 +19,10 @@ if (isset($vars['filter'])) {
<script>
searchbar = "<div id=\"{{ctx.id}}\" class=\"{{css.header}}\"><div class=\"row\">"+
"<div class=\"col-sm-9 actionBar\"><span class=\"pull-left\">"+
"<div class=\"col-sm-8 actionBar\"><span class=\"pull-left\">"+
"<a href='<?php echo generate_url(array('page' => 'poll-log')); ?>' class='btn btn-primary btn-sm'>All devices</a> "+
"<a href='<?php echo generate_url(array('page' => 'poll-log', 'filter' => 'unpolled')); ?>' class='btn btn-danger btn-sm'>Unpolled devices</a>"+
"</div><div class=\"col-sm-3 actionBar\"><p class=\"{{css.search}}\"></p><p class=\"{{css.actions}}\"></p></div>";
"</div><div class=\"col-sm-4 actionBar\"><p class=\"{{css.search}}\"></p><p class=\"{{css.actions}}\"></p></div>";
var grid = $("#poll-log").bootgrid({
ajax: true,