Skip to content

Commit

Permalink
Add ability to filter for blocked queries in conjunction the client f…
Browse files Browse the repository at this point in the history
…ilter in the Query Log. Request such filtered data when clicking on a client in the Top Clients (blocked only) table on the dashboard.

Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Aug 2, 2020
1 parent 39a4532 commit 64a2419
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions api_FTL.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@
// Get specific domain only
sendRequestFTL("getallqueries-domain ".$_GET['domain']);
}
else if(isset($_GET['client']) && (isset($_GET['type']) && $_GET['type'] === "blocked"))
{
// Get specific client only
sendRequestFTL("getallqueries-client-blocked ".$_GET['client']);
}
else if(isset($_GET['client']))
{
// Get specific client only
Expand Down
4 changes: 4 additions & 0 deletions queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
$showing = "showing no queries (due to setting)";
}
}
else if(isset($_GET["type"]) && $_GET["type"] === "blocked")
{
$showing = "showing blocked";
}
else
{
// If filter variable is not set, we
Expand Down
2 changes: 1 addition & 1 deletion scripts/pi-hole/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ function updateTopClientsChart() {
url =
'<a href="queries.php?client=' +
clientip +
'" title="' +
'&type=blocked" title="' +
clientip +
'">' +
clientname +
Expand Down
4 changes: 4 additions & 0 deletions scripts/pi-hole/js/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ $(function () {
APIstring += "=100";
}

if ("type" in GETDict) {
APIstring += "&type=" + GETDict.type;
}

tableApi = $("#all-queries").DataTable({
rowCallback: function (row, data) {
// DNSSEC status
Expand Down

0 comments on commit 64a2419

Please sign in to comment.