mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 00:40:10 +00:00
Fixes host packet page is blank (#5824)
This commit is contained in:
parent
529ee2c8e5
commit
7fbef1798f
1 changed files with 9 additions and 10 deletions
|
|
@ -966,37 +966,36 @@ end
|
|||
local tots = 0 for key, value in pairs(host["pktStats.sent"]["size"]) do tots = tots + value end
|
||||
local totr = 0 for key, value in pairs(host["pktStats.recv"]["size"]) do totr = totr + value end
|
||||
|
||||
if((tots > 0) or (totr > 0)) then
|
||||
print('<tr><th class="text-start">'..i18n("packets_page.sent_vs_rcvd_distribution")..'</th>')
|
||||
if(tots > 0) then
|
||||
print('<td colspan=1><div class="pie-chart" id="sizeSentDistro"></div></td>')
|
||||
else
|
||||
print('<td colspan=1> </td>')
|
||||
print('<td colspan=1>~</td>')
|
||||
end
|
||||
|
||||
if(totr > 0) then
|
||||
print('<td colspan=1><div class="pie-chart" id="sizeRecvDistro"></div></td>')
|
||||
else
|
||||
print('<td colspan=1> </td>')
|
||||
print('<td colspan=1>~</td>')
|
||||
end
|
||||
print('</tr>')
|
||||
end
|
||||
|
||||
|
||||
local has_tcp_distro = (host["tcp.packets.rcvd"] + host["tcp.packets.sent"] > 0)
|
||||
local has_arp_distro = (not isEmptyString(host["mac"])) and (host["mac"] ~= "00:00:00:00:00:00") and (ifs.type ~= "zmq")
|
||||
|
||||
if(has_tcp_distro and has_arp_distro) then
|
||||
print('<tr><th class="text-start">'..i18n("packets_page.tcp_flags_vs_arp_distribution")..'</th><td colspan=1><div class="pie-chart" id="flagsDistro"></div></td><td colspan=1><div class="pie-chart" id="arpDistro"></div></td></tr>')
|
||||
print('<tr><th class="text-start">'..i18n("packets_page.tcp_flags_vs_arp_distribution")..'</th><td colspan=1><div class="pie-chart" id="flagsDistro"></div></td><td colspan=1><div class="pie-chart" id="arpDistro"></div></td></tr>')
|
||||
else
|
||||
if (has_tcp_distro) then
|
||||
print('<tr><th class="text-start">'..i18n("packets_page.tcp_flags_distribution")..'</th><td colspan=5><div class="pie-chart" id="flagsDistro"></div></td></tr>')
|
||||
end
|
||||
if (has_arp_distro) then
|
||||
print('<tr><th class="text-start">'..i18n("packets_page.tcp_flags_distribution")..'</th><td colspan=5><div class="pie-chart" id="flagsDistro"></div></td></tr>')
|
||||
elseif (has_arp_distro) then
|
||||
if (macinfo ~= nil) and (macinfo["arp_requests.sent"] + macinfo["arp_requests.rcvd"] + macinfo["arp_replies.sent"] + macinfo["arp_replies.rcvd"] > 0) then
|
||||
print('<tr><th class="text-start">'..i18n("packets_page.arp_distribution")..'</th><td colspan=5><div class="pie-chart" id="arpDistro"></div></td></tr>')
|
||||
end
|
||||
else
|
||||
print('<tr><th class="text-start">'..i18n("packets_page.tcp_flags_distribution")..'</th>') print('<td colspan=5>~</td></tr>')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hostinfo2json(host_info)
|
||||
print [[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue