mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 17:00:10 +00:00
Display Active Monitoring menu entry even when disabled
This commit is contained in:
parent
f94f784c0f
commit
aab41dd66e
3 changed files with 18 additions and 4 deletions
|
|
@ -15,6 +15,7 @@ local active_monitoring_utils = plugins_utils.loadModule("active_monitoring", "a
|
|||
|
||||
local graph_utils = require("graph_utils")
|
||||
local alert_utils = require("alert_utils")
|
||||
local user_scripts = require("user_scripts")
|
||||
|
||||
local ts_creation = plugins_utils.timeseriesCreationEnabled()
|
||||
|
||||
|
|
@ -37,6 +38,19 @@ local url = base_url
|
|||
local info = ntop.getInfo()
|
||||
local measurement_info
|
||||
|
||||
if(not user_scripts.isSystemScriptEnabled("active_monitoring")) then
|
||||
-- The active monitoring is disabled
|
||||
print[[<div class="alert alert-warning" role="alert">]]
|
||||
print(i18n("host_config.active_monitor_enable", {
|
||||
url=ntop.getHttpPrefix() .. '/lua/admin/edit_configset.lua?confset_id=0&subdir=system&user_script=active_monitoring#all'
|
||||
}))
|
||||
print[[</div>]]
|
||||
|
||||
dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if(not isEmptyString(host) and not isEmptyString(measurement)) then
|
||||
host = active_monitoring_utils.getHost(host, measurement)
|
||||
measurement_info = active_monitoring_utils.getMeasurementInfo(host.measurement)
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ return {
|
|||
menu_entry = {key = "active_monitor", i18n_title = "active_monitoring_stats.active_monitoring", section = "system_stats"},
|
||||
|
||||
is_shown = function()
|
||||
local user_scripts = require("user_scripts")
|
||||
|
||||
return(user_scripts.isSystemScriptEnabled("active_monitoring"))
|
||||
-- The active monitoring page is always shown. If the plugin is disabled,
|
||||
-- the page itself will show a warning
|
||||
return(true)
|
||||
end
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue