mirror of
https://github.com/pi-hole/web.git
synced 2026-05-08 09:39:05 +01:00
Add checkbox on Query Log to be able to disable filtering on click
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -134,6 +134,7 @@ if(strlen($showing) > 0)
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<label><input type="checkbox" id="autofilter" checked="true"> Apply filtering on click on Type, Domain, and Clients</label><br/>
|
||||
<button type="button" id="resetButton" hidden="true">Clear Filters</button>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
@@ -96,6 +96,10 @@ function handleAjaxError( xhr, textStatus, error ) {
|
||||
tableApi.draw();
|
||||
}
|
||||
|
||||
function autofilter(){
|
||||
return document.getElementById("autofilter").checked;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var status;
|
||||
|
||||
@@ -189,21 +193,21 @@ $(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="" }
|
||||
);
|
||||
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="" }
|
||||
);
|
||||
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="" }
|
||||
|
||||
Reference in New Issue
Block a user