Fix for bringing back the top stats table for hosts graphs

This commit is contained in:
Guillaume Simon 2015-06-09 18:49:19 +02:00
parent 5ba7aeda9a
commit 62bc62edcb
3 changed files with 25 additions and 25 deletions

View file

@ -1552,4 +1552,27 @@ function maxRateToString(max_rate)
end
end
end
end
end
function makeTopStatsScriptsArray()
path = dirs.installdir .. "/scripts/lua/modules/top_scripts"
path = fixPath(path)
local files = ntop.readdir(path)
topArray = {}
for k,v in pairs(files) do
if(v ~= nil) then
value = {}
fn,ext = v:match("([^.]+).([^.]+)")
mod = require("top_scripts."..fn)
if(type(mod) ~= type(true)) then
value["name"] = mod.name
value["script"] = mod.infoScript
value["key"] = mod.infoScriptKey
value["levels"] = mod.numLevels
topArray[fn] = value
end
end
end
return(topArray)
end