Merge pull request #2772 from ffgraz/warn2
gluon-web-model: fix issue with warning blocking save on private-wifi
This commit is contained in:
commit
1780bafafc
@ -1,4 +1,4 @@
|
|||||||
<%- if self.title or self.content then -%>
|
<%- if not self.hide then -%>
|
||||||
<div class="gluon-warning"<%=
|
<div class="gluon-warning"<%=
|
||||||
attr("id", id) ..
|
attr("id", id) ..
|
||||||
attr("data-index", self.index) ..
|
attr("data-index", self.index) ..
|
||||||
|
@ -429,6 +429,23 @@ function Element:__init__(template, kv, ...)
|
|||||||
self.error = false
|
self.error = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Element:parse(http)
|
||||||
|
if not self.datatype then
|
||||||
|
self.state = M.FORM_VALID
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
return AbstractValue:parse(http)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Element:validate()
|
||||||
|
if not self.datatype then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
AbstractValue:validate()
|
||||||
|
end
|
||||||
|
|
||||||
local Section = class(Node)
|
local Section = class(Node)
|
||||||
M.Section = Section
|
M.Section = Section
|
||||||
|
|
||||||
|
@ -27,10 +27,11 @@ 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', {
|
local warning = s:element('model/warning', {
|
||||||
content = mesh_on_wan and translate(
|
content = translate(
|
||||||
'Meshing on WAN interface is enabled. ' ..
|
'Meshing on WAN interface is enabled. ' ..
|
||||||
'This can lead to problems.'
|
'This can lead to problems.'
|
||||||
) or nil,
|
),
|
||||||
|
hide = not mesh_on_wan,
|
||||||
}, 'warning')
|
}, 'warning')
|
||||||
warning:depends(enabled, true)
|
warning:depends(enabled, true)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user