2010-11-01 19:39:57 +00:00
< %+cbi/valueheader%>
< %-
local utl = require "luci.util"
local fwm = require "luci.model.firewall".init()
local nwm = require "luci.model.network".init()
local zone, fwd, fz
local value = self:formvalue(section)
if not value or value == "-" then
value = self:cfgvalue(section) or self.default
end
local def = fwm:get_defaults()
local zone = fwm:get_zone(value)
local empty = true
-%>
< % if zone then %>
2012-02-15 17:50:25 +00:00
< div style = "white-space:nowrap" >
< label class = "zonebadge" style = "background-color:<%=zone:get_color()%>" >
2010-11-01 19:39:57 +00:00
< strong > < %=zone:name()%>:< / strong >
2012-02-15 17:50:25 +00:00
< %-
2010-11-01 19:39:57 +00:00
local zempty = true
for _, net in ipairs(zone:get_networks()) do
net = nwm:get_network(net)
if net then
zempty = false
2012-02-15 17:50:25 +00:00
-%>
2012-02-15 16:00:23 +00:00
< span class = "ifacebadge<% if net:name() == self.network then %> ifacebadge-active<% end %>" > < %=net:name()%>:
2010-11-01 19:39:57 +00:00
< %
local nempty = true
2011-09-24 03:49:17 +00:00
for _, iface in ipairs(net:is_bridge() and net:get_interfaces() or { net:get_interface() }) do
2010-11-01 19:39:57 +00:00
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 %>
< % if nempty then %>< em > < %:(empty)%>< / em > < % end %>
< / span >
2012-02-15 17:50:25 +00:00
< %- end end -%>
< %- if zempty then %>< em > < %:(empty)%>< / em > < % end -%>
2010-11-01 19:39:57 +00:00
< / label >
2011-05-03 03:31:30 +00:00
  ⇒  
2010-11-01 19:39:57 +00:00
< % for _, fwd in ipairs(zone:get_forwardings_by("src")) do
fz = fwd:dest_zone()
2017-09-07 13:29:45 +00:00
if fz then
empty = false %>
2012-02-15 17:50:25 +00:00
< label class = "zonebadge" style = "background-color:<%=fz:get_color()%>" >
2010-11-01 19:39:57 +00:00
< strong > < %=fz:name()%>< / strong >
2011-05-03 03:20:15 +00:00
< / label >  
2017-09-07 13:29:45 +00:00
< % end end %>
2010-11-01 19:39:57 +00:00
< % if empty then %>
2012-02-15 17:50:25 +00:00
< label class = "zonebadge zonebadge-empty" >
< strong > < %=zone:forward():upper()%>< / strong >
2010-11-01 19:39:57 +00:00
< / label >
< % end %>
< / div >
< % end %>
< %+cbi/valuefooter%>