From a13b7bd69200cec860d92fa21042a1d416e7becb Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 14 Jul 2017 22:50:09 +0200 Subject: [PATCH] Add an apply button to the new Audit log page (#532) * Add an apply button to the new Audit log page * The button is not actually called "Apply" --- auditlog.php | 10 +++++++++- gravity.php | 4 ++-- scripts/pi-hole/js/auditlog.js | 11 +++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/auditlog.php b/auditlog.php index 96d74577..cb3db9af 100644 --- a/auditlog.php +++ b/auditlog.php @@ -69,11 +69,19 @@
-

Important: Note that black- and whitelisted domains are not automatically applied on this page to avoid restarting the DNS service too often. Instead, go to Update Lists and run the update, to have the new settings become effective.

+

Important: Note that black- and whitelisted domains are not automatically applied on this page to avoid restarting the DNS service too often. Instead, click on this button, to have the new settings become effective:

+
+
+
+
+ +
+
+
diff --git a/gravity.php b/gravity.php index 5e736725..f11e6ab7 100644 --- a/gravity.php +++ b/gravity.php @@ -1,4 +1,4 @@ - diff --git a/scripts/pi-hole/js/auditlog.js b/scripts/pi-hole/js/auditlog.js index 3806896f..3aa9912c 100644 --- a/scripts/pi-hole/js/auditlog.js +++ b/scripts/pi-hole/js/auditlog.js @@ -89,9 +89,10 @@ $(document).ready(function() { $("#domain-frequency tbody").on( "click", "button", function () { var url = ($(this).parents("tr"))[0].innerText.split(" ")[0]; - if($(this).context.innerText === "Blacklist") + if($(this).context.innerText === " Blacklist") { add(url,"black"); + $("#gravityBtn").prop("disabled", false); } else { @@ -101,9 +102,10 @@ $(document).ready(function() { $("#ad-frequency tbody").on( "click", "button", function () { var url = ($(this).parents("tr"))[0].innerText.split(" ")[0].split(" ")[0]; - if($(this).context.innerText === "Whitelist") + if($(this).context.innerText === " Whitelist") { add(url,"white"); + $("#gravityBtn").prop("disabled", false); } else { @@ -111,3 +113,8 @@ $(document).ready(function() { } }); }); + + +$("#gravityBtn").on("click", function() { + window.location.replace("gravity.php?go"); +});