Merge pull request #1332 from pi-hole/tweak/dhcp_save_state

Remember last used sort column/direction on DHCP lease tables
This commit is contained in:
DL6ER
2020-05-25 20:05:45 +02:00
committed by GitHub
13 changed files with 62 additions and 109 deletions

View File

@@ -5,7 +5,7 @@
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */
/* global moment:false */
/* global moment:false, utils:false */
var tableApi;
@@ -399,24 +399,10 @@ $(document).ready(function () {
],
stateSave: true,
stateSaveCallback: function (settings, data) {
// Store current state in client's local storage area
localStorage.setItem("query_log_table", JSON.stringify(data));
utils.stateSaveCallback("query_log_table", data);
},
stateLoadCallback: function () {
// Receive previous state from client's local storage area
var data = localStorage.getItem("query_log_table");
// Return if not available
if (data === null) {
return null;
}
data = JSON.parse(data);
// Always start on the first page to show most recent queries
data.start = 0;
// Always start with empty search field
data.search.search = "";
// Apply loaded state to table
return data;
return utils.stateLoadCallback("query_log_table");
},
columnDefs: [
{