summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-10-13 16:26:59 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-10-13 16:26:59 +0000
commit7a1fcbd6da32115836197319514042012e038d9d (patch)
treec6f8da7b2d6e415261f26643f7493a61fa1051a2 /modules/admin-full
parent09c54d9ceb1b9f55899823e8bd332a9a9b0064db (diff)
modules/admin-full: update iface status after saving uci changes
Diffstat (limited to 'modules/admin-full')
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua24
1 files changed, 16 insertions, 8 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
index 1c413117e..4b581102e 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
@@ -170,16 +170,24 @@ if has_firewall then
end
--- if current network is empty, print a warning
-if not net:is_floating() and net:is_empty() then
- st = s:taboption("general", DummyValue, "__status", translate("Status"))
- st.value = translate("There is no device assigned yet, please attach a network device in the \"Physical Settings\" tab")
-else
- st = s:taboption("general", DummyValue, "__status", translate("Status"))
- st.template = "admin_network/iface_status"
- st.network = arg[1]
+st = s:taboption("general", DummyValue, "__status", translate("Status"))
+
+local function set_status()
+ -- if current network is empty, print a warning
+ if not net:is_floating() and net:is_empty() then
+ 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")
+ else
+ st.template = "admin_network/iface_status"
+ st.network = arg[1]
+ st.value = nil
+ end
end
+m.on_init = set_status
+m.on_after_save = set_status
+
p = s:taboption("general", ListValue, "proto", translate("Protocol"))
p.default = net:proto()