Remember last state of the "Apply filtering" checkbox on the Query Log page. Store this browser- not server-wise so individual users can use their own prefered settings.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2020-03-31 20:15:01 +00:00
parent 6fdeee53ca
commit e328f51e17
2 changed files with 16 additions and 2 deletions

View File

@@ -155,7 +155,7 @@ if(strlen($showing) > 0)
</tr>
</tfoot>
</table>
<label><input type="checkbox" id="autofilter" checked="true">&nbsp;Apply filtering on click on Type, Domain, and Clients</label><br/>
<label><input type="checkbox" id="autofilter">&nbsp;Apply filtering on click on Type, Domain, and Clients</label><br/>
<button type="button" id="resetButton" hidden="true">Clear Filters</button>
</div>
<!-- /.box-body -->

View File

@@ -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"));
});
});