mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 04:38:28 +00:00
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:
@@ -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: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user