mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Refactors user_scripts into checks (lua)
This commit is contained in:
parent
3c3aa5a25f
commit
76fd315d1b
222 changed files with 980 additions and 981 deletions
|
|
@ -10,15 +10,15 @@ require "lua_utils"
|
|||
local page_utils = require("page_utils")
|
||||
local format_utils = require("format_utils")
|
||||
local template = require "template_utils"
|
||||
local user_scripts = require "user_scripts"
|
||||
local checks = require "checks"
|
||||
local json = require "dkjson"
|
||||
local alert_exclusions = require "alert_exclusions"
|
||||
local alert_consts = require "alert_consts"
|
||||
local rest_utils = require "rest_utils"
|
||||
local auth = require "auth"
|
||||
local user_scripts_utils = require("user_scripts_utils")
|
||||
local checks_utils = require("checks_utils")
|
||||
|
||||
if not auth.has_capability(auth.capabilities.user_scripts) then
|
||||
if not auth.has_capability(auth.capabilities.checks) then
|
||||
rest_utils.answer(rest_utils.consts.err.not_granted)
|
||||
return
|
||||
end
|
||||
|
|
@ -27,15 +27,15 @@ sendHTTPContentTypeHeader('text/html')
|
|||
|
||||
-- get config parameters like the id and name
|
||||
local script_subdir = _GET["subdir"]
|
||||
local script_filter = _GET["user_script"]
|
||||
local script_filter = _GET["check"]
|
||||
local search_filter = _GET["search_script"]
|
||||
-- If not nil, exclusions are printed for this particular host
|
||||
local host = _GET["host"]
|
||||
|
||||
local configset = user_scripts.getConfigset()
|
||||
local script_type = user_scripts.getScriptType(script_subdir)
|
||||
local configset = checks.getConfigset()
|
||||
local script_type = checks.getScriptType(script_subdir)
|
||||
|
||||
local scripts = user_scripts.load(getSystemInterfaceId(), script_type, script_subdir)
|
||||
local scripts = checks.load(getSystemInterfaceId(), script_type, script_subdir)
|
||||
|
||||
if not haveAdminPrivileges() or not configset then
|
||||
return
|
||||
|
|
@ -43,7 +43,7 @@ end
|
|||
|
||||
|
||||
-- create a table that holds localization about hooks name
|
||||
local titles = user_scripts_utils.load_configset_titles()
|
||||
local titles = checks_utils.load_configset_titles()
|
||||
|
||||
local sub_menu_entries = {
|
||||
['host'] = {
|
||||
|
|
@ -76,7 +76,7 @@ for key, sub_menu in pairsByField(sub_menu_entries, 'order', asc) do
|
|||
}
|
||||
end
|
||||
|
||||
page_utils.print_navbar(host and i18n("edit_user_script.exclusion_list_host_x", {host = host}) or i18n("edit_user_script.exclusion_list"), '#', navbar_menu)
|
||||
page_utils.print_navbar(host and i18n("edit_check.exclusion_list_host_x", {host = host}) or i18n("edit_check.exclusion_list"), '#', navbar_menu)
|
||||
|
||||
local context = {
|
||||
script_list = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue