mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Initial work to add user script templates
This commit is contained in:
parent
7493b02a07
commit
1dd93e7845
8 changed files with 36 additions and 18 deletions
|
|
@ -14,7 +14,8 @@ local user_script_template = classes.class()
|
|||
|
||||
-- ##############################################
|
||||
|
||||
function user_script_template:init()
|
||||
function user_script_template:init(user_script)
|
||||
self._user_script = user_script
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
|
@ -31,6 +32,21 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
-- @brief Render user script templates for all the available user script hooks
|
||||
-- @return The rendered template
|
||||
function user_script_template:render(hooks_conf)
|
||||
local res = {}
|
||||
local plugins_utils = require "plugins_utils"
|
||||
|
||||
for hook, hook_conf in pairs(hooks_conf) do
|
||||
res[hook] = plugins_utils.renderTemplate(self._user_script.plugin.key, self._user_script.gui.template, hook_conf)
|
||||
end
|
||||
|
||||
return res
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
return user_script_template
|
||||
|
||||
-- ##############################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue