System DNS configuration

This commit is contained in:
Alfredo Cardigliano 2020-11-26 19:34:10 +01:00
parent 72502711ea
commit 159564bd95
5 changed files with 130 additions and 87 deletions

View file

@ -22,7 +22,7 @@ local subpages = {
{name = "mode", nedge_only = false, label = i18n("nedge.setup_mode"), url = "mode.lua"},
{name = "network_interfaces", nedge_only = false, label = i18n("prefs.network_interfaces"), url = "interfaces.lua" },
{name = "network_setup", nedge_only = false, label = i18n("nedge.interfaces_configuration"), url = "network.lua"},
{name = "dhcp", nedge_only = false, label = i18n("nedge.dhcp_server"), url = "dhcp.lua", routing_only = true},
{name = "dhcp", nedge_only = true, label = i18n("nedge.dhcp_server"), url = "dhcp.lua", routing_only = true},
{name = "dns", nedge_only = true, label = i18n("nedge.dns_configuration"), url = "dns.lua", vlan_trunk = false},
{name = "captive_portal", nedge_only = true, label = i18n("prefs.toggle_captive_portal_title"), url = "captive_portal.lua", vlan_trunk = false},
{name = "shapers", nedge_only = true, label = i18n("nedge.shapers"), url="shapers.lua"},
@ -173,12 +173,17 @@ function system_setup_ui_utils.printPageBody(sys_config, print_page_body_callbac
local mode = sys_config:getOperatingMode()
for _, subpage in ipairs(subpages) do
if not is_nedge and subpage.nedge_only then
goto continue
elseif (subpage.routing_only == true) and (not sys_config:isMultipathRoutingEnabled()) then
goto continue
elseif (subpage.vlan_trunk == false) and (sys_config:isBridgeOverVLANTrunkEnabled()) then
goto continue
if not is_nedge then
if subpage.nedge_only then
goto continue
end
else -- nedge
if (subpage.routing_only == true) and (not sys_config:isMultipathRoutingEnabled()) then
goto continue
elseif (subpage.vlan_trunk == false) and (sys_config:isBridgeOverVLANTrunkEnabled()) then
goto continue
end
end
print("<a href=\""..ntop.getHttpPrefix().."/lua/")