modules/admin-full: update iface status after saving uci changes

This commit is contained in:
Jo-Philipp Wich 2011-10-13 16:26:59 +00:00
parent 09c54d9ceb
commit 7a1fcbd6da

View file

@ -170,15 +170,23 @@ if has_firewall then
end end
st = s:taboption("general", DummyValue, "__status", translate("Status"))
local function set_status()
-- if current network is empty, print a warning -- if current network is empty, print a warning
if not net:is_floating() and net:is_empty() then if not net:is_floating() and net:is_empty() then
st = s:taboption("general", DummyValue, "__status", translate("Status")) st.template = "cbi/dvalue"
st.network = nil
st.value = translate("There is no device assigned yet, please attach a network device in the \"Physical Settings\" tab") st.value = translate("There is no device assigned yet, please attach a network device in the \"Physical Settings\" tab")
else else
st = s:taboption("general", DummyValue, "__status", translate("Status"))
st.template = "admin_network/iface_status" st.template = "admin_network/iface_status"
st.network = arg[1] 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"))