modules/admin-full: update iface status after saving uci changes
This commit is contained in:
parent
09c54d9ceb
commit
7a1fcbd6da
1 changed files with 16 additions and 8 deletions
|
@ -170,16 +170,24 @@ if has_firewall then
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- if current network is empty, print a warning
|
st = s:taboption("general", DummyValue, "__status", translate("Status"))
|
||||||
if not net:is_floating() and net:is_empty() then
|
|
||||||
st = s:taboption("general", DummyValue, "__status", translate("Status"))
|
local function set_status()
|
||||||
st.value = translate("There is no device assigned yet, please attach a network device in the \"Physical Settings\" tab")
|
-- if current network is empty, print a warning
|
||||||
else
|
if not net:is_floating() and net:is_empty() then
|
||||||
st = s:taboption("general", DummyValue, "__status", translate("Status"))
|
st.template = "cbi/dvalue"
|
||||||
st.template = "admin_network/iface_status"
|
st.network = nil
|
||||||
st.network = arg[1]
|
st.value = translate("There is no device assigned yet, please attach a network device in the \"Physical Settings\" tab")
|
||||||
|
else
|
||||||
|
st.template = "admin_network/iface_status"
|
||||||
|
st.network = arg[1]
|
||||||
|
st.value = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
m.on_init = set_status
|
||||||
|
m.on_after_save = set_status
|
||||||
|
|
||||||
|
|
||||||
p = s:taboption("general", ListValue, "proto", translate("Protocol"))
|
p = s:taboption("general", ListValue, "proto", translate("Protocol"))
|
||||||
p.default = net:proto()
|
p.default = net:proto()
|
||||||
|
|
Loading…
Reference in a new issue