Develop new rest APi to save columns visibility and columns order in future #7389

This commit is contained in:
Lorenzo Vannucci 2023-05-15 21:03:17 +02:00
parent 5bf92eec23
commit 15504241d3
3 changed files with 21 additions and 25 deletions

View file

@ -4,6 +4,7 @@
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
local json = require "dkjson"
-- #####################################
@ -31,6 +32,8 @@ local function get_column_config()
local visible_columns = ntop.getCache(redis_key) or {}
if visible_columns == nil or visible_columns == "" then
visible_columns = {}
else
visible_columns = json.decode(visible_columns)
end
return(rest_utils.answer(rest_utils.consts.success.ok, visible_columns))
end