Fixes traffic map crash hide entries if traffic map disabled

This commit is contained in:
Matteo Biscosi 2021-04-16 16:05:36 +02:00
parent 57155d1ecb
commit 89353e32fb
5 changed files with 42 additions and 3 deletions

View file

@ -40,7 +40,23 @@ local select_options = {}
-- generate the dropdown menu
for i,v in pairs(MODES) do
-- Check for pro hosts map only
if((v["pro"] ~= nil) and
(v["pro"] == true) and
(ntop.isPro() == false)) then
goto continue
end
-- Check for the visible functions
-- Do not add the entry into the menu if it is false
if((v["visible"] ~= nil) and
(v["visible"]() == false)) then
goto continue
end
select_options[#select_options+1] = '<option '.. (bubble_mode == v.mode and 'selected' or '') ..' value="'..tostring(v.mode)..'">'..v.label..'</option>'
::continue::
end
-- register the bubble chart for the hosts map