commit
096f739477
@ -63,6 +63,7 @@ files["package/**/luasrc/lib/gluon/config-mode/*"] = {
|
|||||||
"translate",
|
"translate",
|
||||||
"translatef",
|
"translatef",
|
||||||
"Value",
|
"Value",
|
||||||
|
"Element",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -518,6 +518,11 @@ textarea {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.gluon-warning {
|
||||||
|
@extend .gluon-section-descr;
|
||||||
|
background: lighten($ffyellow, 35);
|
||||||
|
}
|
||||||
|
|
||||||
.error500 {
|
.error500 {
|
||||||
border: 1px dotted #ff0000;
|
border: 1px dotted #ff0000;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
<%- if self.title or self.content then -%>
|
||||||
|
<div class="gluon-warning"<%=
|
||||||
|
attr("id", id) ..
|
||||||
|
attr("data-index", self.index) ..
|
||||||
|
attr("data-depends", self:deplist(self.deps))
|
||||||
|
%>>
|
||||||
|
<%- if self.content then -%>
|
||||||
|
<%=self.content%>
|
||||||
|
<%- else -%>
|
||||||
|
<b><%=self.title%></b><br>
|
||||||
|
<%=self.description%>
|
||||||
|
<%- end -%>
|
||||||
|
</div>
|
||||||
|
<%- end -%>
|
@ -196,7 +196,6 @@ function Template:__init__(template)
|
|||||||
self.template = template
|
self.template = template
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local AbstractValue = class(Node)
|
local AbstractValue = class(Node)
|
||||||
M.AbstractValue = AbstractValue
|
M.AbstractValue = AbstractValue
|
||||||
|
|
||||||
@ -411,6 +410,25 @@ function TextValue:__init__(...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local Element = class(Node)
|
||||||
|
M.Element = Element
|
||||||
|
|
||||||
|
function Element:__init__(template, kv, ...)
|
||||||
|
Node.__init__(self, ...)
|
||||||
|
|
||||||
|
self.default = nil
|
||||||
|
self.size = nil
|
||||||
|
self.optional = false
|
||||||
|
|
||||||
|
self.template = template
|
||||||
|
|
||||||
|
for key, value in pairs(kv) do
|
||||||
|
self[key] = value
|
||||||
|
end
|
||||||
|
|
||||||
|
self.error = false
|
||||||
|
end
|
||||||
|
|
||||||
local Section = class(Node)
|
local Section = class(Node)
|
||||||
M.Section = Section
|
M.Section = Section
|
||||||
|
|
||||||
@ -427,6 +445,11 @@ function Section:option(t, ...)
|
|||||||
return obj
|
return obj
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Section:element(...)
|
||||||
|
local obj = Element(...)
|
||||||
|
self:append(obj)
|
||||||
|
return obj
|
||||||
|
end
|
||||||
|
|
||||||
local Form = class(Node)
|
local Form = class(Node)
|
||||||
M.Form = Form
|
M.Form = Form
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
local uci = require("simple-uci").cursor()
|
local uci = require("simple-uci").cursor()
|
||||||
local wireless = require 'gluon.wireless'
|
local wireless = require 'gluon.wireless'
|
||||||
|
local util = require 'gluon.util'
|
||||||
|
|
||||||
-- where to read the configuration from
|
-- where to read the configuration from
|
||||||
local primary_iface = 'wan_radio0'
|
local primary_iface = 'wan_radio0'
|
||||||
@ -13,9 +14,26 @@ local s = f:section(Section, nil, translate(
|
|||||||
.. 'at the same time.'
|
.. '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"))
|
local enabled = s:option(Flag, "enabled", translate("Enabled"))
|
||||||
enabled.default = uci:get('wireless', primary_iface) and not uci:get_bool('wireless', primary_iface, "disabled")
|
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)"))
|
local ssid = s:option(Value, "ssid", translate("Name (SSID)"))
|
||||||
ssid:depends(enabled, true)
|
ssid:depends(enabled, true)
|
||||||
ssid.datatype = "maxlength(32)"
|
ssid.datatype = "maxlength(32)"
|
||||||
|
Loading…
Reference in New Issue
Block a user