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)
18 local function render_zone(zone)
20 <label class="zonebadge" style="background-color:<%=zone:get_color()%>">
21 <strong><%=zone:name()%></strong>
22 <div class="cbi-tooltip">
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())%> src="<%=resource%>/icons/<%=iface:type()%><%=iface:is_up() and "" or "_disabled"%>.png" />
38 <% if nempty then %><em><%:(empty)%></em><% end %>
41 <% if zempty then %><span class="ifacebadge"><em><%:(empty)%></em></span><% end %>
49 <div class="zone-forwards">
50 <div class="zone-src">
51 <%=render_zone(zone)%>
54 <div class="zone-dest">
56 for _, fwd in ipairs(zone:get_forwardings_by("src")) do
65 <label class="zonebadge zonebadge-empty">
66 <strong><%=def:forward():upper()%></strong>