mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Fix for top scripts: the code was not discarding non .lua files
This commit is contained in:
parent
5f7d8ae2ec
commit
83fe0afb99
4 changed files with 172 additions and 163 deletions
|
|
@ -1606,16 +1606,18 @@ function makeTopStatsScriptsArray()
|
|||
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
|
||||
if(string.ends(k, ".lua")) then
|
||||
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
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue