diff --git a/queries.php b/queries.php index ebd06443..f511f8d1 100644 --- a/queries.php +++ b/queries.php @@ -134,6 +134,7 @@ if(strlen($showing) > 0) +
diff --git a/scripts/pi-hole/js/db_graph.js b/scripts/pi-hole/js/db_graph.js index 201cad5d..d543f16b 100644 --- a/scripts/pi-hole/js/db_graph.js +++ b/scripts/pi-hole/js/db_graph.js @@ -182,7 +182,7 @@ $(document).ready(function() { title: function(tooltipItem, data) { var label = tooltipItem[0].xLabel; var time = new Date(label); - var date = time.getFullYear()+"-"+padNumber(time.getMonth())+"-"+padNumber(time.getDate()); + var date = time.getFullYear()+"-"+padNumber(time.getMonth()+1)+"-"+padNumber(time.getDate()); var h = time.getHours(); var m = time.getMinutes(); var from = padNumber(h)+":"+padNumber(m)+":00"; diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index 72b4a002..a4aa51f3 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -96,6 +96,10 @@ function handleAjaxError( xhr, textStatus, error ) { tableApi.draw(); } +function autofilter(){ + return document.getElementById("autofilter").checked; +} + $(document).ready(function() { var status; @@ -189,24 +193,24 @@ $(document).ready(function() { "initComplete": function () { var api = this.api(); // Query type IPv4 / IPv6 - api.$("td:eq(1)").click( function () { api.search( this.innerHTML ).draw(); $("#resetButton").show(); } ); + api.$("td:eq(1)").click( function () { if(autofilter()){ api.search( this.innerHTML ).draw(); $("#resetButton").show(); }}); api.$("td:eq(1)").hover( - function () { this.title="Click to show only "+this.innerHTML+" queries"; this.style.color="#72afd2"; }, - function () { this.style.color=""; } + function () { this.title="Click to show only "+this.innerHTML+" queries"; this.style.color="#72afd2" }, + function () { this.style.color="" } ); api.$("td:eq(1)").css("cursor","pointer"); // Domain - api.$("td:eq(2)").click( function () { api.search( this.innerHTML ).draw(); $("#resetButton").show(); } ); + api.$("td:eq(2)").click( function () { if(autofilter()){ api.search( this.innerHTML ).draw(); $("#resetButton").show(); }}); api.$("td:eq(2)").hover( - function () { this.title="Click to show only queries with domain "+this.innerHTML; this.style.color="#72afd2"; }, - function () { this.style.color=""; } + function () { this.title="Click to show only queries with domain "+this.innerHTML; this.style.color="#72afd2" }, + function () { this.style.color="" } ); api.$("td:eq(2)").css("cursor","pointer"); // Client - api.$("td:eq(3)").click( function () { api.search( this.innerHTML ).draw(); $("#resetButton").show(); } ); + api.$("td:eq(3)").click( function () { if(autofilter()){ api.search( this.innerHTML ).draw(); $("#resetButton").show(); }}); api.$("td:eq(3)").hover( - function () { this.title="Click to show only queries made by "+this.innerHTML; this.style.color="#72afd2"; }, - function () { this.style.color=""; } + function () { this.title="Click to show only queries made by "+this.innerHTML; this.style.color="#72afd2" }, + function () { this.style.color="" } ); api.$("td:eq(3)").css("cursor","pointer"); } diff --git a/scripts/pi-hole/php/footer.php b/scripts/pi-hole/php/footer.php index d9ca6cec..43cc2041 100644 --- a/scripts/pi-hole/php/footer.php +++ b/scripts/pi-hole/php/footer.php @@ -48,7 +48,7 @@