From dfe89b43114f54145221c8c3b67fe199dcc88e3a Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 19 Jan 2020 21:00:40 +0100 Subject: [PATCH 1/4] Remove null coalescing operator from list.php. This feature is only availabe in PHP 7. Signed-off-by: DL6ER --- list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list.php b/list.php index 3f24c07c..95fbcd1a 100644 --- a/list.php +++ b/list.php @@ -8,7 +8,7 @@ require "scripts/pi-hole/php/header.php"; -$list = $_GET['l'] ?? ''; +$list = isset($_GET['l']) ? $_GET['l'] : ''; if ($list == "white") { From f92812d4cd849b35a6dd60487bc0853ad18c0f63 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 19 Jan 2020 22:32:28 +0100 Subject: [PATCH 2/4] Substitute null client names by empty strings. Signed-off-by: DL6ER --- scripts/pi-hole/php/groups.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pi-hole/php/groups.php b/scripts/pi-hole/php/groups.php index ff6f7aa5..252e52cd 100644 --- a/scripts/pi-hole/php/groups.php +++ b/scripts/pi-hole/php/groups.php @@ -209,7 +209,7 @@ if ($_POST['action'] == 'get_groups') { // Loop over results $ips = array(); while ($res = $query->fetchArray(SQLITE3_ASSOC)) { - $ips[$res['ip']] = $res['name']; + $ips[$res['ip']] = $res['name'] !== null ? $res['name'] : ''; } $FTLdb->close(); From 5abbeb2eff9267d3062eeb1f35bd0dca3b50e18c Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 21 Jan 2020 23:34:08 +0100 Subject: [PATCH 3/4] Add extra label when blocking happend during deep CNAME inspection. Signed-off-by: DL6ER --- scripts/pi-hole/js/queries.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index 1422e1b4..e6c41507 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -228,6 +228,11 @@ $(document).ready(function() { buttontext = ""; } + // Add extra label when blocking happend during deep CNAME inspection + if (blocked && data.length > 6 && data[6] === "3") { + fieldtext += "
CNAME"; + } + $(row).addClass(colorClass); $("td:eq(4)", row).html(fieldtext); $("td:eq(6)", row).html(buttontext); From 88da85f5534bc8d2338bf64bf98ad3c3a8558e06 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 26 Jan 2020 02:46:38 +0100 Subject: [PATCH 4/4] Add responsive design to new group tables to ensure they render properly on very narrow screens. (#1137) Signed-off-by: DL6ER Co-authored-by: Dan Schaper --- scripts/pi-hole/js/groups-adlists.js | 4 ++++ scripts/pi-hole/js/groups-clients.js | 4 ++++ scripts/pi-hole/js/groups-domains.js | 4 ++++ scripts/pi-hole/js/groups.js | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/scripts/pi-hole/js/groups-adlists.js b/scripts/pi-hole/js/groups-adlists.js index 53a137ba..625a3f83 100644 --- a/scripts/pi-hole/js/groups-adlists.js +++ b/scripts/pi-hole/js/groups-adlists.js @@ -183,6 +183,10 @@ function initTable() { ""; $("td:eq(4)", row).html(button); }, + dom: + "<'row'<'col-sm-4'l><'col-sm-8'f>>" + + "<'row'<'col-sm-12'<'table-responsive'tr>>>" + + "<'row'<'col-sm-5'i><'col-sm-7'p>>", lengthMenu: [ [10, 25, 50, 100, -1], [10, 25, 50, 100, "All"] diff --git a/scripts/pi-hole/js/groups-clients.js b/scripts/pi-hole/js/groups-clients.js index 68fbed9e..bb07ea7b 100644 --- a/scripts/pi-hole/js/groups-clients.js +++ b/scripts/pi-hole/js/groups-clients.js @@ -189,6 +189,10 @@ function initTable() { ""; $("td:eq(2)", row).html(button); }, + dom: + "<'row'<'col-sm-4'l><'col-sm-8'f>>" + + "<'row'<'col-sm-12'<'table-responsive'tr>>>" + + "<'row'<'col-sm-5'i><'col-sm-7'p>>", lengthMenu: [ [10, 25, 50, 100, -1], [10, 25, 50, 100, "All"] diff --git a/scripts/pi-hole/js/groups-domains.js b/scripts/pi-hole/js/groups-domains.js index b83c5296..6646a957 100644 --- a/scripts/pi-hole/js/groups-domains.js +++ b/scripts/pi-hole/js/groups-domains.js @@ -200,6 +200,10 @@ function initTable() { ""; $("td:eq(5)", row).html(button); }, + dom: + "<'row'<'col-sm-4'l><'col-sm-8'f>>" + + "<'row'<'col-sm-12'<'table-responsive'tr>>>" + + "<'row'<'col-sm-5'i><'col-sm-7'p>>", lengthMenu: [ [10, 25, 50, 100, -1], [10, 25, 50, 100, "All"] diff --git a/scripts/pi-hole/js/groups.js b/scripts/pi-hole/js/groups.js index b7ec372c..2ea23c5b 100644 --- a/scripts/pi-hole/js/groups.js +++ b/scripts/pi-hole/js/groups.js @@ -144,6 +144,10 @@ $(document).ready(function() { $("td:eq(3)", row).html(button); } }, + dom: + "<'row'<'col-sm-4'l><'col-sm-8'f>>" + + "<'row'<'col-sm-12'<'table-responsive'tr>>>" + + "<'row'<'col-sm-5'i><'col-sm-7'p>>", lengthMenu: [ [10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]