Skip to content
Snippets Groups Projects
Unverified Commit 08684e90 authored by Maciej Krüger's avatar Maciej Krüger
Browse files

web-private-wifi: add warning about mesh on wan

parent 408ef922
No related branches found
No related tags found
No related merge requests found
local uci = require("simple-uci").cursor()
local wireless = require 'gluon.wireless'
local util = require 'gluon.util'
-- where to read the configuration from
local primary_iface = 'wan_radio0'
......@@ -13,9 +14,26 @@ local s = f:section(Section, nil, translate(
.. 'at the same time.'
))
local uplink_interfaces = util.get_role_interfaces(uci, 'uplink')
local mesh_on_wan = false
for _, iface in ipairs(util.get_role_interfaces(uci, 'mesh')) do
if util.contains(uplink_interfaces, iface) then
mesh_on_wan = true
end
end
local enabled = s:option(Flag, "enabled", translate("Enabled"))
enabled.default = uci:get('wireless', primary_iface) and not uci:get_bool('wireless', primary_iface, "disabled")
local warning = s:element('model/warning', {
content = mesh_on_wan and translate(
'Meshing on WAN interface is enabled.' ..
'This can lead to problems.'
) or nil,
}, 'warning')
warning:depends(enabled, true)
local ssid = s:option(Value, "ssid", translate("Name (SSID)"))
ssid:depends(enabled, true)
ssid.datatype = "maxlength(32)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment