mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Allows RESTful api custom_data.lua to accept fields without alias
This commit is contained in:
parent
2230673eb3
commit
9a8b77e0d7
2 changed files with 18 additions and 7 deletions
|
|
@ -51,7 +51,14 @@ end
|
|||
field_alias = field_alias:split(",") or {field_alias}
|
||||
|
||||
for _, fa in pairs(field_alias) do
|
||||
local field, alias = fa:split("=")
|
||||
-- Fields can be submitted as-is without an alias
|
||||
local field, alias = fa:split("=") or {fa}
|
||||
|
||||
-- If the alias hasn't been defined, alias is the actual field name
|
||||
if not alias then
|
||||
alias = field
|
||||
end
|
||||
|
||||
if host[field] then
|
||||
-- TODO: implement
|
||||
res[alias] = host[field]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue