mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Report templates can now be defined in multiple paths
This commit is contained in:
parent
08edb2f567
commit
ffd2c2fc1e
1 changed files with 19 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ dashboard_utils.module_available = {
|
|||
-- ##############################################
|
||||
|
||||
-- Get all configured dashboard templates
|
||||
function dashboard_utils.get_templates(templates_dir)
|
||||
local function get_templates_from_dir(templates_dir)
|
||||
local templates = {}
|
||||
local info = ntop.getInfo()
|
||||
|
||||
|
|
@ -84,6 +84,24 @@ function dashboard_utils.get_templates(templates_dir)
|
|||
return templates
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
-- Get all configured dashboard templates
|
||||
function dashboard_utils.get_templates(templates_dirs)
|
||||
local templates = {}
|
||||
|
||||
if type(templates_dirs) == "string" then
|
||||
templates = get_templates_from_dir(templates_dirs)
|
||||
else -- array of dir
|
||||
for _, dir in ipairs(templates_dirs) do
|
||||
local dir_templates = get_templates_from_dir(dir)
|
||||
templates = table.merge(templates, dir_templates)
|
||||
end
|
||||
end
|
||||
|
||||
return templates
|
||||
end
|
||||
|
||||
-- #################################################################
|
||||
|
||||
return dashboard_utils
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue