libs/cbi: don't filter bridge ports in firewall zone widget
[project/luci.git] / libs / cbi / luasrc / view / cbi / firewall_zonelist.htm
index 9418695..4f4106b 100644 (file)
@@ -48,10 +48,11 @@ $Id$
                <label<%=attr("for", cbid .. "." .. zone:name())%> style="background-color:<%=zone:get_color()%>; padding:0.5em">
                        <strong><%=zone:name()%>:</strong>
                        <%
-                               local empty = true
+                               local zempty = true
                                for _, net in ipairs(zone:get_networks()) do
                                        net = nwm:get_network(net)
                                        if net then
+                                               zempty = false
                        %>
                                &nbsp;
                                <%- if net:name() == self.network then -%>
@@ -60,15 +61,16 @@ $Id$
                                        <span style="background-color:#FFFFFF; border:1px solid #CCCCCC; padding:2px"><%=net:name()%>:
                                <%- end -%>
                                <%
+                                       local nempty = true
                                        for _, iface in ipairs(net and net:get_interfaces() or {}) do
-                                               if not iface:is_bridgeport() then
-                                                       empty = false
+                                               nempty = false
                                 %>
                                        <img<%=attr("title", iface:get_i18n())%> style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/<%=iface:type()%><%=iface:is_up() and "" or "_disabled"%>.png" />
-                               <% end end %>
+                               <% end %>
+                               <% if nempty then %><em><%:(no interfaces attached)%></em><% end %>
                                </span>
                        <% end end %>
-                       <% if empty then %><em><%:a_s_ipt_zone_empty (no interfaces attached)%></em><% end %>
+                       <% if zempty then %><em><%:(no interfaces attached)%></em><% end %>
                </label>
        </li>
        <% end end %>
@@ -77,8 +79,8 @@ $Id$
        <li style="padding:0.5em">
                <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio"<%=attr("id", cbid .. "_new") .. attr("name", cbid) .. attr("value", "-") .. ifattr(not selected, "checked", "checked")%> /> &nbsp;
                <div style="background-color:<%=fwm.zone.get_color()%>; padding:0.5em; display:inline">
-                       <label<%=attr("for", cbid .. "_new")%>><em><%:a_s_ipt_zone_unspec_create unspecified -or- create:%>&nbsp;</em></label>
-                       <input style="width:6em" type="text"<%=attr("name", cbid .. ".newzone") .. ifattr(not selected, "value", self.default)%> onfocus="document.getElementById('<%=cbid%>_new').checked=true" />
+                       <label<%=attr("for", cbid .. "_new")%>><em><%:unspecified -or- create:%>&nbsp;</em></label>
+                       <input style="width:6em" type="text"<%=attr("name", cbid .. ".newzone") .. ifattr(not selected, "value", luci.http.formvalue(cbid .. ".newzone") or self.default)%> onfocus="document.getElementById('<%=cbid%>_new').checked=true" />
                </div>
        </li>
        <% end %>