From 269bd09823066f25c98ea92271045f6fc0ea289b Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 23 Sep 2017 13:24:23 +0200 Subject: [PATCH] Allow one-click filtering on "Type", "Domain", and "Client" --- scripts/pi-hole/js/queries.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index 54c3ea71..06a1a2f6 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -185,7 +185,16 @@ $(document).ready(function() { "targets": -1, "data": null, "defaultContent": "" - } ] + } ], + "initComplete": function () { + var api = this.api(); + // Query type IPv4 / IPv6 + api.$('td:eq(1)').click( function () { api.search( this.innerHTML ).draw(); } ); + // Domain + api.$('td:eq(2)').click( function () { api.search( this.innerHTML ).draw(); } ); + // Client + api.$('td:eq(3)').click( function () { api.search( this.innerHTML ).draw(); } ); + } }); $("#all-queries tbody").on( "click", "button", function () { var data = tableApi.row( $(this).parents("tr") ).data();