Minor fix for interfaces with no packets visibility

This commit is contained in:
Luca Deri 2019-04-15 14:33:23 +02:00
parent bf96e0e34c
commit a10c6483a2
2 changed files with 8 additions and 5 deletions

View file

@ -232,6 +232,7 @@ else
end
end
if((host["packets.sent"] + host["packets.rcvd"]) > 0) then
if(page == "packets") then
print("<li class=\"active\"><a href=\"#\">" .. i18n("packets") .. "</a></li>\n")
elseif not have_nedge then
@ -243,6 +244,7 @@ elseif not have_nedge then
print("<li><a href=\""..url.."&page=packets\">" .. i18n("packets") .. "</a></li>")
end
end
end
if(page == "ports") then
print("<li class=\"active\"><a href=\"#\">" .. i18n("ports") .. "</a></li>\n")
@ -732,12 +734,16 @@ end
<table class="table table-bordered table-striped">
]]
if(host["bytes.sent"] > 0) then
tot = 0 for key, value in pairs(host["pktStats.sent"]) do tot = tot + value end
if(tot > 0) then
print('<tr><th class="text-left">'..i18n("packets_page.sent_distribution")..'</th><td colspan=5><div class="pie-chart" id="sizeSentDistro"></div></td></tr>')
end
if(host["bytes.rcvd"] > 0) then
tot = 0 for key, value in pairs(host["pktStats.recv"]) do tot = tot + value end
if(tot > 0) then
print('<tr><th class="text-left">'..i18n("packets_page.received_distribution")..'</th><td colspan=5><div class="pie-chart" id="sizeRecvDistro"></div></td></tr>')
end
if (host["tcp.packets.rcvd"] + host["tcp.packets.sent"] > 0) then
print('<tr><th class="text-left">'..i18n("packets_page.tcp_flags_distribution")..'</th><td colspan=5><div class="pie-chart" id="flagsDistro"></div></td></tr>')
end