libs/web: track submit state in network_ifacelist widget, fixes deselecting all membe...
[project/luci.git] / libs / web / luasrc / view / cbi / network_ifacelist.htm
index 0dc93f9..192bcac 100644 (file)
@@ -3,12 +3,15 @@
 <%-
        local utl = require "luci.util"
        local net = require "luci.model.network".init()
+       local cbeid = luci.cbi.FEXIST_PREFIX .. self.config .. "." .. section .. "." .. self.option
 
        local iface
        local ifaces = net:get_interfaces()
-       local value = self:formvalue(section)
-
-       if not value or value == "" then
+       local value
+       
+       if self.map:formvalue(cbeid) == "1" then
+               value = self:formvalue(section) or self.default or ""
+       else
                value = self:cfgvalue(section) or self.default
        end
 
@@ -29,6 +32,7 @@
        end
 -%>
 
+<input type="hidden" name="<%=cbeid%>" value="1" />
 <ul style="margin:0; list-style-type:none">
        <% for _, iface in ipairs(ifaces) do
             local link = iface:adminlink()
@@ -45,7 +49,7 @@
                        <% if link then -%><a href="<%=link%>"><% end -%>
                        <img title="<%=iface:get_type_i18n()%>" style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/<%=iface:type()%><%=iface:is_up() and "" or "_disabled"%>.png" />
                        <% if link then -%></a><% end -%>
-                       <%=iface:get_i18n()%><% local n = iface:get_network(); if n then %> (<a href="<%=n:adminlink()%>"><%=n:name()%></a>)<% end %>
+                       <%=pcdata(iface:get_i18n())%><% local n = iface:get_network(); if n then %> (<a href="<%=n:adminlink()%>"><%=n:name()%></a>)<% end %>
                </label>
        </li>
        <% end end %>