mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Separate preferences menu from menu logic
This commit is contained in:
parent
cc00e652af
commit
b0814d9487
5 changed files with 359 additions and 321 deletions
|
|
@ -507,6 +507,13 @@ function areAlertsEnabled()
|
|||
(ntop.getPref("ntopng.prefs.disable_alerts_generation") ~= "1"))
|
||||
end
|
||||
|
||||
function hasAlertsDisabled()
|
||||
local prefs = ntop.getPrefs()
|
||||
return (prefs.has_cmdl_disable_alerts == true) or
|
||||
((_POST["disable_alerts_generation"] ~= nil) and (_POST["disable_alerts_generation"] == "1")) or
|
||||
((_POST["disable_alerts_generation"] == nil) and (ntop.getPref("ntopng.prefs.disable_alerts_generation") == "1"))
|
||||
end
|
||||
|
||||
function hasNagiosSupport()
|
||||
if prefs == nil then
|
||||
prefs = ntop.getPrefs()
|
||||
|
|
@ -3226,6 +3233,25 @@ function isBridgeInterface(ifstats)
|
|||
return (ifstats["bridge.device_a"] ~= nil) and (ifstats["bridge.device_b"] ~= nil)
|
||||
end
|
||||
|
||||
function hasBridgeInterfaces()
|
||||
local curif = ifname
|
||||
local ifnames = interface.getIfNames()
|
||||
local found = false
|
||||
|
||||
for _,ifname in pairs(ifnames) do
|
||||
interface.select(ifname)
|
||||
|
||||
local ifstats = interface.getStats()
|
||||
if isBridgeInterface(ifstats) then
|
||||
found = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
interface.select(curif)
|
||||
return found
|
||||
end
|
||||
|
||||
-- Returns true if the captive portal can be started with the current configuration
|
||||
function isCaptivePortalSupported(ifstats, prefs, skip_interface_check)
|
||||
if not ntop.isEnterprise() then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue