diff --git a/queries.php b/queries.php index 51c543e6..20c65305 100644 --- a/queries.php +++ b/queries.php @@ -155,7 +155,7 @@ if(strlen($showing) > 0) -
+
diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index 118ba9ac..6d6ec97d 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -108,7 +108,7 @@ function handleAjaxError(xhr, textStatus) { } function autofilter() { - return document.getElementById("autofilter").checked; + return $("#autofilter").prop("checked"); } $(document).ready(function() { @@ -508,4 +508,18 @@ $(document).ready(function() { tableApi.search("").draw(); $("#resetButton").hide(); }); + + var chkbox_data = localStorage.getItem("query_log_filter_chkbox"); + if (chkbox_data !== null) { + // Restore checkbox state + $("#autofilter").prop("checked", chkbox_data === "true"); + } else { + // Initialize checkbox + $("#autofilter").prop("checked", true); + localStorage.setItem("query_log_filter_chkbox", true); + } + + $("#autofilter").click(function() { + localStorage.setItem("query_log_filter_chkbox", $("#autofilter").prop("checked")); + }); });