Fixed some Lua errors that caused some scripts to fail and this prevent reports from being properly displayed (e.g. the ASNs report in the dashboard)

This commit is contained in:
Luca Deri 2015-08-27 00:42:41 +02:00
parent 07e214a6b2
commit 7e220133a5
3 changed files with 16 additions and 7 deletions

View file

@ -406,8 +406,10 @@ function getCurrentTopGroups(ifid, ifname, max_num_entries, use_threshold,
if(num > 0) then rsp = rsp .. " }," end
rsp = rsp .. '\n\t\t { "label": "'.._key..'", "url": "'
..ntop.getHttpPrefix()..
'/lua/hosts_stats.lua?'..col..'='.._key..'", "name": "'
.._group[_key]["name"]..'", "value": '.._value
'/lua/hosts_stats.lua?'..col..'='.._key..'", "name": "'
if((_group[_key] ~= nil) and (_group[_key]["name"] ~= nil)) then rsp = rsp .. _group[_key]["name"] end
rsp = rsp ..'", "value": '.._value
num = num + 1
end
end