forked from pi-hole/web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
queries.php
80 lines (75 loc) · 2.13 KB
/
queries.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
require "header.html";
?>
<!--
<div class="row">
<div class="col-md-12">
<button class="btn btn-info margin-bottom pull-right">Refresh Data</button>
</div>
</div>
-->
<div class="row">
<div class="col-md-12">
<div class="box" id="recent-queries">
<div class="box-header with-border">
<h3 class="box-title">Recent Queries</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<table id="all-queries" class="display table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th>Time</th>
<th>Type</th>
<th>Domain</th>
<th>Client</th>
<th>Status</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Time</th>
<th>Type</th>
<th>Domain</th>
<th>Client</th>
<th>Status</th>
</tr>
</tfoot>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
</div>
<!-- /.row -->
<?php
require "footer.php";
?>
<script type="text/javascript">
$(document).ready(function() {
tableApi = $('#all-queries').DataTable( {
"rowCallback": function( row, data, index ){
if (data[4] == "Pi-holed") {
$(row).css('color','red')
}
else{
$(row).css('color','green')
}
},
"ajax": "api.php?getAllQueries",
"autoWidth" : false,
"order" : [[0, "desc"]],
"columns": [
{ "width" : "20%", "type": "date" },
{ "width" : "10%" },
{ "width" : "40%" },
{ "width" : "15%" },
{ "width" : "15%" }
]
})
} );
function refreshData() {
tableApi.ajax.url("api.php?getAllQueries").load();
}
</script>