From 4d6481ffa963dd4d1fe1fb49e6ecec0126728d30 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 24 Apr 2022 09:16:13 +0200 Subject: [PATCH 1/2] Add QUERY_SPECIAL_DOMAIN as new query status Signed-off-by: DL6ER --- scripts/pi-hole/js/db_queries.js | 7 ++++++- scripts/pi-hole/js/queries.js | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/pi-hole/js/db_queries.js b/scripts/pi-hole/js/db_queries.js index aba0ea41b..91300be07 100644 --- a/scripts/pi-hole/js/db_queries.js +++ b/scripts/pi-hole/js/db_queries.js @@ -292,8 +292,13 @@ $(function () { "Blocked (database is busy)"; blocked = true; break; + case 16: + fieldtext = + "Blocked (special domain)"; + blocked = true; + break; default: - fieldtext = "Unknown"; + fieldtext = "Unknown (" + parseInt(data[4], 10) + ")"; } $(row).addClass(blocked === true ? "blocked-row" : "allowed-row"); diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index 851efd945..b603db661 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -218,6 +218,11 @@ $(function () { "Blocked (database is busy)"; blocked = true; break; + case "16": + fieldtext = + "Blocked (special domain)"; + blocked = true; + break; default: fieldtext = "Unknown (" + parseInt(data[4], 10) + ")"; } From c4481cacb5052dd8deb1ca42b160bd7e69e0221b Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 24 Apr 2022 15:52:40 +0200 Subject: [PATCH 2/2] Review comments Signed-off-by: DL6ER --- db_queries.php | 1 + scripts/pi-hole/js/db_queries.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/db_queries.php b/db_queries.php index 8ce45f10d..e283b01ca 100644 --- a/db_queries.php +++ b/db_queries.php @@ -56,6 +56,7 @@

+

diff --git a/scripts/pi-hole/js/db_queries.js b/scripts/pi-hole/js/db_queries.js index 91300be07..f502dff49 100644 --- a/scripts/pi-hole/js/db_queries.js +++ b/scripts/pi-hole/js/db_queries.js @@ -146,6 +146,10 @@ function getQueryTypes() { queryType.push(15); } + if ($("#type_special_domain").prop("checked")) { + queryType.push(16); + } + return queryType.join(","); } @@ -184,7 +188,7 @@ function refreshTableData() { var APIstring = "api_db.php?getAllQueries&from=" + from + "&until=" + until; // Check if query type filtering is enabled var queryType = getQueryTypes(); - if (queryType !== "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15") { + if (queryType !== "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16") { APIstring += "&types=" + queryType; }