mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-05 02:16:39 +00:00
Fixes search on protocols info field and added verdict
This commit is contained in:
parent
16e090549d
commit
7e75e7506c
12 changed files with 176 additions and 49 deletions
35
scripts/lua/modules/historical_format_utils.lua
Normal file
35
scripts/lua/modules/historical_format_utils.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
--
|
||||
-- (C) 2013-24 - 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue