mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Add badge with services in serach results
This commit is contained in:
parent
c423197cb8
commit
1fe0ae2bd6
2 changed files with 11 additions and 0 deletions
|
|
@ -500,6 +500,16 @@ for k, v in pairsByField(hosts, 'name', asc) do
|
|||
if v.mac then
|
||||
results[#results + 1] = build_result(v.label, v.mac, "mac", v.links, v.badges)
|
||||
elseif v.ip then
|
||||
|
||||
-- Add badge for services
|
||||
local info = interface.getHostMinInfo(v.ip)
|
||||
if info and info.services then
|
||||
if not v.badges then v.badges = {} end
|
||||
for s,_ in pairs(info.services) do
|
||||
add_badge(v.badges, s:upper())
|
||||
end
|
||||
end
|
||||
|
||||
results[#results + 1] = build_result(v.label, v.ip, "ip", v.links, v.badges)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue