mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Loads plugins templates from /modules when no template is found
This commit is contained in:
parent
c62c2c232e
commit
15d4672f7e
1 changed files with 7 additions and 0 deletions
|
|
@ -1000,8 +1000,15 @@ end
|
|||
function plugins_utils.renderTemplate(plugin_name, template_file, context)
|
||||
init_runtime_paths()
|
||||
|
||||
-- Locate the template file under the plugin directory
|
||||
local full_path = os_utils.fixPath(plugins_utils.getPluginTemplatesDir(plugin_name) .. "/" .. template_file)
|
||||
|
||||
-- If no template is found...
|
||||
if not ntop.exists(full_path) then
|
||||
-- Attempt at locating the template class under modules (global to ntopng)
|
||||
full_path = os_utils.fixPath(dirs.installdir .. "/scripts/lua/modules/user_script_templates/"..template_file)
|
||||
end
|
||||
|
||||
return template_utils.gen(full_path, context, true --[[ using full path ]])
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue