From a604037d339a03db8f83ff78ecc20e0524a2b23b Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 20 Jun 2017 13:01:30 +0200 Subject: [PATCH 1/3] Add unique clients to summary --- index.php | 40 ++++++++++++++++++------------------- scripts/pi-hole/js/index.js | 10 +++++----- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/index.php b/index.php index 6c161299..bf901652 100644 --- a/index.php +++ b/index.php @@ -10,25 +10,12 @@ ?>
-
- -
-
-

---

-

Queries Blocked Last 24 Hours

-
-
- -
-
-
-
-

---

-

Queries Last 24 Hours

+

Total queries

+

---

@@ -38,13 +25,26 @@
-
+
-

---

-

Queries Blocked Last 24 Hours

+

Queries Blocked

+

--- (---)

- + +
+
+
+ +
+ +
+
+

Unique Clients

+

---

+
+
+
@@ -53,8 +53,8 @@
-

---

Domains on Blocklists

+

---

diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index ecb005af..6b0530f6 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -406,17 +406,17 @@ function updateSummaryData(runOnce) { } } - ["ads_blocked_today", "dns_queries_today", "ads_percentage_today"].forEach(function(today) { - var todayElement = $("h3#" + today); + ["ads_blocked_today", "dns_queries_today", "ads_percentage_today", "unique_clients"].forEach(function(today) { + var todayElement = $("span#" + today); todayElement.text() !== data[today] && todayElement.text() !== data[today] + "%" && - todayElement.addClass("glow"); + $("h3#" + today).addClass("glow"); }); window.setTimeout(function() { - ["ads_blocked_today", "dns_queries_today", "domains_being_blocked", "ads_percentage_today"].forEach(function(header, idx) { + ["ads_blocked_today", "dns_queries_today", "domains_being_blocked", "ads_percentage_today", "unique_clients"].forEach(function(header, idx) { var textData = (idx === 3 && data[header] !== "to") ? data[header] + "%" : data[header]; - $("h3#" + header).text(textData); + $("span#" + header).text(textData); }); $("h3.statistic.glow").removeClass("glow"); }, 500); From a72285745c4173374fc9d9db460fcc9ba3ca1192 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Tue, 20 Jun 2017 18:35:24 -0400 Subject: [PATCH 2/3] Rearrange summary stats to fit better --- index.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index bf901652..452073c8 100644 --- a/index.php +++ b/index.php @@ -14,7 +14,7 @@
-

Total queries

+

Total queries (- clients)

---

@@ -28,7 +28,7 @@

Queries Blocked

-

--- (---)

+

---

@@ -40,11 +40,11 @@
-

Unique Clients

-

---

+

Percent Blocked

+

---

- +
@@ -53,7 +53,7 @@
-

Domains on Blocklists

+

Domains on Blocklist

---

From d061355ff336e6a414d1dac11058461d1067e335 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Tue, 20 Jun 2017 18:53:10 -0400 Subject: [PATCH 3/3] Fix FTL offline message --- scripts/pi-hole/js/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index 6b0530f6..7689ccbf 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -375,8 +375,8 @@ function updateSummaryData(runOnce) { if("FTLnotrunning" in data) { - data["ads_blocked_today"] = "Lost"; - data["dns_queries_today"] = "connection"; + data["dns_queries_today"] = "Lost"; + data["ads_blocked_today"] = "connection"; data["ads_percentage_today"] = "to"; data["domains_being_blocked"] = "API"; // Adjust text