mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
parent
0c96c49157
commit
4b29fa2af1
1 changed files with 14 additions and 3 deletions
|
|
@ -181,10 +181,21 @@ local function saveListsMetadataToRedis(lists)
|
|||
local metadata = {}
|
||||
|
||||
for list_name, list in pairs(lists or {}) do
|
||||
local meta = table.clone(list)
|
||||
meta.status = nil
|
||||
local default_prefs = BUILTIN_LISTS[list_name]
|
||||
local meta = {}
|
||||
local has_custom_pref = false
|
||||
|
||||
metadata[list_name] = meta
|
||||
-- Only save the preferences that differ from the default configuration
|
||||
for key, val in pairs(list) do
|
||||
if((key ~= "status") and (default_prefs[key] ~= val)) then
|
||||
meta[key] = val
|
||||
has_custom_pref = true
|
||||
end
|
||||
end
|
||||
|
||||
if(has_custom_pref) then
|
||||
metadata[list_name] = meta
|
||||
end
|
||||
end
|
||||
|
||||
ntop.setPref(METADATA_KEY, json.encode(metadata))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue