summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-01-14 19:57:30 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-01-14 19:57:30 +0000
commit5355d11e2c9716ec16b4bedfc4f137f727d3d968 (patch)
treea4406d64f4c51fd43759e9da1b4265cec9e9b11d
parentcd34034b871b5391b14866a2fc761f00069bce2e (diff)
libs/web: some fixes for network_ifacelist widget
-rw-r--r--libs/web/luasrc/view/cbi/network_ifacelist.htm10
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/web/luasrc/view/cbi/network_ifacelist.htm b/libs/web/luasrc/view/cbi/network_ifacelist.htm
index c4d392e9e..1cedc02b7 100644
--- a/libs/web/luasrc/view/cbi/network_ifacelist.htm
+++ b/libs/web/luasrc/view/cbi/network_ifacelist.htm
@@ -19,7 +19,12 @@ $Id$
local iface
local ifaces = net:get_interfaces()
- local value = (self:formvalue(section) or self.default)
+ local value = self:formvalue(section)
+
+ if not value or value == "" then
+ value = self:cfgvalue(section) or self.default
+ end
+
local checked = { }
if value then
@@ -46,7 +51,8 @@ $Id$
attr("type", self.widget or "radio") ..
attr("id", cbid .. "." .. iface:name()) ..
attr("name", cbid) .. attr("value", iface:name()) ..
- ifattr(checked[iface:name()], "checked", "checked")
+ ifattr(checked[iface:name()], "checked", "checked") ..
+ ifattr(iface:type() == "wifi" and not iface:is_up(), "disabled", "disabled")
%> /> &nbsp;
<label<%=attr("for", cbid .. "." .. iface:name())%>>
<% if link then -%><a href="<%=link%>"><% end -%>