mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 09:20:10 +00:00
35 lines
803 B
Lua
35 lines
803 B
Lua
--
|
|
-- (C) 2013-26 - ntop.org
|
|
--
|
|
require "lua_utils_gui"
|
|
local json = require "dkjson"
|
|
|
|
local historical_format_utils = {}
|
|
|
|
-- #######################################
|
|
|
|
-- This function is us
|
|
function historical_format_utils.parseInfoJson(info, flow)
|
|
local info_field = {}
|
|
-- The field is serialized as a json, first deserialize then parse and format
|
|
if info and not isEmptyString(info) then
|
|
info = json.decode(info)
|
|
info_field = info
|
|
else
|
|
return {}
|
|
end
|
|
|
|
if (info.proto) and (table.len(info.proto) > 0) then
|
|
info_field.proto = format_proto_info({}, info.proto)
|
|
end
|
|
|
|
if not ntop.isnEdge() then
|
|
info_field.verdict = nil
|
|
end
|
|
|
|
return info_field
|
|
end
|
|
|
|
-- #######################################
|
|
|
|
return historical_format_utils
|