4 local utl = require "luci.util"
5 local fwm = require "luci.model.firewall".init()
6 local nwm = require "luci.model.network".init()
9 local value = self:formvalue(section)
10 if not value or value == "-" then
11 value = self:cfgvalue(section) or self.default
14 local def = fwm:get_defaults()
15 local zone = fwm:get_zone(value)
20 <div style="white-space:nowrap">
21 <label class="zonebadge" style="background-color:<%=zone:get_color()%>">
22 <strong><%=zone:name()%>:</strong>
25 for _, net in ipairs(zone:get_networks()) do
26 net = nwm:get_network(net)
30 <span class="ifacebadge<% if net:name() == self.network then %> ifacebadge-active<% end %>"><%=net:name()%>:
33 for _, iface in ipairs(net:is_bridge() and net:get_interfaces() or { net:get_interface() }) do
36 <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" />
38 <% if nempty then %><em><%:(empty)%></em><% end %>
41 <%- if zempty then %><em><%:(empty)%></em><% end -%>
44 <% for _, fwd in ipairs(zone:get_forwardings_by("src")) do
47 <label class="zonebadge" style="background-color:<%=fz:get_color()%>">
48 <strong><%=fz:name()%></strong>
52 <label class="zonebadge zonebadge-empty">
53 <strong><%=zone:forward():upper()%></strong>