mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
parent
1051c7a3cd
commit
7d93d3b5be
2 changed files with 44 additions and 13 deletions
|
|
@ -3223,22 +3223,53 @@ end
|
|||
-- ##########################################
|
||||
|
||||
function historicalProtoHostHref(ifId, host, l4_proto, ndpi_proto_id, info)
|
||||
if ntop.isPro() and ntop.getPrefs().is_dump_flows_to_mysql_enabled == true then
|
||||
local hist_url = ntop.getHttpPrefix().."/lua/pro/db_explorer.lua?search=true&ifid="..ifId
|
||||
if ntop.isPro() then
|
||||
local now = os.time()
|
||||
local ago1h = now - 3600
|
||||
|
||||
hist_url = hist_url.."&epoch_end="..tostring(now)
|
||||
if((host ~= nil) and (host ~= "")) then hist_url = hist_url.."&"..hostinfo2url(host) end
|
||||
if((l4_proto ~= nil) and (l4_proto ~= "")) then
|
||||
hist_url = hist_url.."&l4proto="..l4_proto
|
||||
local prefs = ntop.getPrefs()
|
||||
if prefs.is_dump_flows_to_clickhouse_enabled then
|
||||
local hist_url = ntop.getHttpPrefix().."/lua/pro/db_search.lua?"
|
||||
local params = {epoch_end = now, epoch_begin = ago1h, ifid = ifId}
|
||||
|
||||
if host then
|
||||
local host_k = hostinfo2hostkey(host)
|
||||
if isEmptyString(host_k) then
|
||||
host_k = host
|
||||
end
|
||||
params["ip"] = host_k..";eq"
|
||||
end
|
||||
if l4_proto then
|
||||
params["l4proto"] = l4_proto..";eq"
|
||||
end
|
||||
if ndpi_proto_id then
|
||||
params["l7proto"] = ndpi_proto_id..";eq"
|
||||
end
|
||||
|
||||
local url_params = table.tconcat(params, "=", "&")
|
||||
|
||||
print(' ')
|
||||
-- print('<span class="badge bg-info">')
|
||||
print('<a href="'..hist_url..url_params..'" title="'..i18n("db_explorer.last_hour_flows")..'"><i class="fas fa-search-plus fa-lg"></i></a>')
|
||||
-- print('</span>')
|
||||
|
||||
elseif prefs.is_dump_flows_to_mysql_enabled then
|
||||
local hist_url = ntop.getHttpPrefix().."/lua/pro/db_explorer.lua?search=true&ifid="..ifId
|
||||
hist_url = hist_url.."&epoch_end="..tostring(now)
|
||||
|
||||
if((host ~= nil) and (host ~= "")) then hist_url = hist_url.."&"..hostinfo2url(host) end
|
||||
if((l4_proto ~= nil) and (l4_proto ~= "")) then
|
||||
hist_url = hist_url.."&l4proto="..l4_proto
|
||||
end
|
||||
|
||||
if((ndpi_proto_id ~= nil) and (ndpi_proto_id ~= "")) then hist_url = hist_url.."&protocol="..ndpi_proto_id end
|
||||
if((info ~= nil) and (info ~= "")) then hist_url = hist_url.."&info="..info end
|
||||
|
||||
print(' ')
|
||||
-- print('<span class="badge bg-info">')
|
||||
print('<a href="'..hist_url..'&epoch_begin='..tostring(ago1h)..'" title="'..i18n("db_explorer.last_hour_flows")..'"><i class="fas fa-search-plus fa-lg"></i></a>')
|
||||
-- print('</span>')
|
||||
end
|
||||
if((ndpi_proto_id ~= nil) and (ndpi_proto_id ~= "")) then hist_url = hist_url.."&protocol="..ndpi_proto_id end
|
||||
if((info ~= nil) and (info ~= "")) then hist_url = hist_url.."&info="..info end
|
||||
print(' ')
|
||||
-- print('<span class="badge bg-info">')
|
||||
print('<a href="'..hist_url..'&epoch_begin='..tostring(ago1h)..'" title="'..i18n("db_explorer.last_hour_flows")..'"><i class="fas fa-search-plus fa-lg"></i></a>')
|
||||
-- print('</span>')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue