From e4d6b2f091b86db5ae41f9cc5442d6534251ddce Mon Sep 17 00:00:00 2001 From: Christos Koutsiaris Date: Sun, 4 Dec 2016 18:37:04 +0000 Subject: [PATCH 01/71] Some small changes in updateSummaryData --- js/pihole/index.js | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/js/pihole/index.js b/js/pihole/index.js index be6f9487..6b5382b2 100644 --- a/js/pihole/index.js +++ b/js/pihole/index.js @@ -182,36 +182,30 @@ function objectToArray(p){ // Functions to update data in page function updateSummaryData(runOnce) { + var setTimer = function(timeInMs) { + if (!runOnce) { + setTimeout(updateSummaryData, timeInMs); + } + }; $.getJSON("api.php?summary", function LoadSummaryData(data) { - //$("h3.statistic").addClass("glow"); - if ($("h3#ads_blocked_today").text() != data.ads_blocked_today) { - $("h3#ads_blocked_today").addClass("glow"); - } - if ($("h3#dns_queries_today").text() != data.dns_queries_today) { - $("h3#dns_queries_today").addClass("glow"); - } - if ($("h3#ads_percentage_today").text() != data.ads_percentage_today) { - $("h3#ads_percentage_today").addClass("glow"); - } - window.setTimeout(function(){ + ['ads_blocked_today', 'dns_queries_today', 'ads_percentage_today'].forEach(function(today) { + var todayElement = $("h3#" + today); + todayElement.text() != data[today] && todayElement.addClass("glow"); + }); + + window.setTimeout(function() { $("h3#ads_blocked_today").text(data.ads_blocked_today); $("h3#dns_queries_today").text(data.dns_queries_today); $("h3#domains_being_blocked").text(data.domains_being_blocked); $("h3#ads_percentage_today").text(data.ads_percentage_today + "%"); $("h3.statistic.glow").removeClass("glow") }, 500); - - updateSessionTimer(); }).done(function() { - if (runOnce !== true) { - setTimeout(updateSummaryData, 10000); - } + setTimer(10000); }).fail(function() { - if (runOnce !== true) { - setTimeout(updateSummaryData, (1000 * 60 * 5)); - } - });; + setTimer(300000); + }); } var failures = 0; From d89e47e83fa472762718e6f6b54bb20b291281a5 Mon Sep 17 00:00:00 2001 From: Christos Koutsiaris Date: Sun, 4 Dec 2016 18:44:33 +0000 Subject: [PATCH 02/71] switch to doublequotes --- js/pihole/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/pihole/index.js b/js/pihole/index.js index 6b5382b2..d6abaf68 100644 --- a/js/pihole/index.js +++ b/js/pihole/index.js @@ -189,7 +189,7 @@ function updateSummaryData(runOnce) { }; $.getJSON("api.php?summary", function LoadSummaryData(data) { - ['ads_blocked_today', 'dns_queries_today', 'ads_percentage_today'].forEach(function(today) { + ["ads_blocked_today", "dns_queries_today", "ads_percentage_today"].forEach(function(today) { var todayElement = $("h3#" + today); todayElement.text() != data[today] && todayElement.addClass("glow"); }); From fa254e258f871cef70b245331b4ea239b403ca74 Mon Sep 17 00:00:00 2001 From: Christos Koutsiaris Date: Sun, 4 Dec 2016 18:48:36 +0000 Subject: [PATCH 03/71] codacy bot --- js/pihole/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/pihole/index.js b/js/pihole/index.js index d6abaf68..b59b0a61 100644 --- a/js/pihole/index.js +++ b/js/pihole/index.js @@ -191,7 +191,7 @@ function updateSummaryData(runOnce) { ["ads_blocked_today", "dns_queries_today", "ads_percentage_today"].forEach(function(today) { var todayElement = $("h3#" + today); - todayElement.text() != data[today] && todayElement.addClass("glow"); + todayElement.text() !== data[today] && todayElement.addClass("glow"); }); window.setTimeout(function() { From f7cd5603cd117f7de5b011c2d262b31017125c77 Mon Sep 17 00:00:00 2001 From: Christos Koutsiaris Date: Sun, 4 Dec 2016 21:18:55 +0000 Subject: [PATCH 04/71] code review comments --- js/pihole/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/pihole/index.js b/js/pihole/index.js index b59b0a61..a1a9f6d4 100644 --- a/js/pihole/index.js +++ b/js/pihole/index.js @@ -201,6 +201,8 @@ function updateSummaryData(runOnce) { $("h3#ads_percentage_today").text(data.ads_percentage_today + "%"); $("h3.statistic.glow").removeClass("glow") }, 500); + + updateSessionTimer(); }).done(function() { setTimer(10000); }).fail(function() { From 9c7dc19d80dfbf85ffc7cc889c000f45637f7743 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 8 Dec 2016 16:39:44 +0100 Subject: [PATCH 05/71] Add custom login page --- header.php | 10 ++-------- php/loginpage.php | 19 +++++++++++++++++++ php/password.php | 6 ++++++ 3 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 php/loginpage.php diff --git a/header.php b/header.php index 6d92a4ad..0979d004 100644 --- a/header.php +++ b/header.php @@ -341,14 +341,8 @@ // // If auth is required and not set, i.e. no successfully logged in, // we show the reduced version of the summary (index) page - if(!$auth && (!isset($indexpage) || isset($_GET['login']))){ ?> - -
- Password:   -
- +
+
+ + +
+
+ +
+ + + + +
+
+
+
+
+ diff --git a/php/password.php b/php/password.php index 549771cd..1c1ce4c0 100644 --- a/php/password.php +++ b/php/password.php @@ -20,6 +20,8 @@ session_unset(); } + $wrongpassword = false; + // Test if password is set if(strlen($pwhash) > 0) { @@ -32,6 +34,10 @@ $_SESSION["hash"] = $pwhash; $auth = true; } + else + { + $wrongpassword = true; + } } // Compare auth hash with saved hash else if (isset($_SESSION["hash"])) From 0d7252e3f67c2658791f557338bbb4cf1f6ffc50 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 8 Dec 2016 16:44:12 +0100 Subject: [PATCH 06/71] Add lock.svg --- img/lock.svg | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 img/lock.svg diff --git a/img/lock.svg b/img/lock.svg new file mode 100644 index 00000000..1c6946e6 --- /dev/null +++ b/img/lock.svg @@ -0,0 +1,53 @@ + + + + Svg Vector Icons : http://www.onlinewebfonts.com/icon image/svg+xml From 2b5e3f4da91e60301603002c52eeeab63d7f52bb Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 9 Dec 2016 13:18:29 +0100 Subject: [PATCH 07/71] First draft of animated logo using pure SVG + CSS --- php/loginpage.php | 56 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/php/loginpage.php b/php/loginpage.php index af0d5973..bb61ca5c 100644 --- a/php/loginpage.php +++ b/php/loginpage.php @@ -1,8 +1,35 @@ +
+
+
+ + + + + + + + + + + + + + + + + + +
+
+
-
- -
@@ -17,3 +44,26 @@
+ + + + From eb3085110f9f1c07d5b0400d854bca8bda263b83 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 9 Dec 2016 13:58:07 +0100 Subject: [PATCH 08/71] Moving path draft --- php/loginpage.php | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/php/loginpage.php b/php/loginpage.php index bb61ca5c..076655f3 100644 --- a/php/loginpage.php +++ b/php/loginpage.php @@ -1,7 +1,7 @@
- + + - + @@ -22,9 +23,17 @@ - - - + + + + Protected page +
@@ -47,22 +56,19 @@ From c2686e6c4c3e20889e285ee3febb0e9cd017f95e Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 9 Dec 2016 14:10:48 +0100 Subject: [PATCH 09/71] Slightly blurred text and path --- php/loginpage.php | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/php/loginpage.php b/php/loginpage.php index 076655f3..fa00494c 100644 --- a/php/loginpage.php +++ b/php/loginpage.php @@ -1,28 +1,38 @@
-
+
- + - + - + + + + - + + + Protected area + + - - Protected page
-
+
From 847c58a4c79b0834550a12959b5349e06640f19e Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 9 Dec 2016 14:13:06 +0100 Subject: [PATCH 10/71] changed the placeholder from "Enter password to continue" to "Enter password to unlock" --- php/loginpage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/loginpage.php b/php/loginpage.php index fa00494c..980843f9 100644 --- a/php/loginpage.php +++ b/php/loginpage.php @@ -51,7 +51,7 @@
- + From b987b79b17ccbf73d8ebff5d2356e33775103b13 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 9 Dec 2016 16:45:21 +0100 Subject: [PATCH 11/71] Add maximum width of 400px --- php/loginpage.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/php/loginpage.php b/php/loginpage.php index 980843f9..b6696597 100644 --- a/php/loginpage.php +++ b/php/loginpage.php @@ -1,7 +1,7 @@
- + - - - - - - - - - - - - - - - - - - Protected area - - - - -
-
+
+
+
+
+
Pi-hole
+
-
-
+ From 994660b6c8a438ef38066aa2324bb1d0c4e6790f Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 15 Dec 2016 15:30:18 +0100 Subject: [PATCH 28/71] Hide size of log if logging is disabled --- settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.php b/settings.php index 2743bc71..ed2e7b0b 100644 --- a/settings.php +++ b/settings.php @@ -329,7 +329,7 @@ ?>
-

Query Logging (size of log )

+

Query Logging (size of log )

Current status: From dbba1059bb28872dae48a00b62488fc71867f768 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 15 Dec 2016 20:42:31 +0100 Subject: [PATCH 29/71] Move variables out of if clause --- php/savesettings.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/php/savesettings.php b/php/savesettings.php index 7460305c..27fa763c 100644 --- a/php/savesettings.php +++ b/php/savesettings.php @@ -34,10 +34,11 @@ function validDomain($domain_name) "8.20.247.20" => "Comodo" ]; + $error = ""; + $success = ""; + if(isset($_POST["field"])) { - $error = ""; - $success = ""; // Process request switch ($_POST["field"]) { // Set DNS server From 52f448cad175a714255a332a27a86359af7b58a5 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Thu, 15 Dec 2016 20:43:06 +0000 Subject: [PATCH 30/71] played about with the layout. Looks nicer on fullscreen, boxed-layout, and mobile (in my opinion) --- php/loginpage.php | 86 ++++++++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 38 deletions(-) diff --git a/php/loginpage.php b/php/loginpage.php index 6d2c3a26..259399db 100644 --- a/php/loginpage.php +++ b/php/loginpage.php @@ -1,45 +1,55 @@ -

-
-
-
-
-
Pi-hole
-
-
-