Fixed netbox startup

This commit is contained in:
Luca Deri 2024-06-26 18:29:31 +02:00
parent 1c79303502
commit 3d5707ac40
2 changed files with 13 additions and 13 deletions

View file

@ -2257,7 +2257,19 @@ if auth.has_capability(auth.capabilities.preferences) then
showNetboxConfiguration = true
end
if (_POST["toggle_netbox"]) then
showNetboxConfiguration = (_POST["toggle_netbox"] == "1")
showNetboxConfiguration = (_POST["toggle_netbox"] == "1")
if(showNetboxConfiguration == true) then
package.path = dirs.installdir .. "/pro/scripts/lua/modules/?.lua;" .. package.path
local netbox_manager = require("netbox_manager")
traceError(TRACE_NORMAL, TRACE_CONSOLE, "[NetBox] Initializing...\n")
if(netbox_manager.initialization_device_roles() == true) then
traceError(TRACE_NORMAL, TRACE_CONSOLE, "[NetBox] Initialization completed")
else
traceError(TRACE_NORMAL, TRACE_CONSOLE, "[NetBox] Initialization failed")
end
end
end
-- tprint(ntop.getPref("ntopng.prefs.toggle_netbox") .. " " .. tostring(showNetboxConfiguration))