2 LuCI - Lua Configuration Interface
3 Copyright
2009 Jo-Philipp Wich
<xm@subsignal.org
>
5 Licensed under the Apache License, Version
2.0 (the
"License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-
2.0
11 $Id: firewall_zonelist.htm
5651 2009-
12-
26 00:
09:
47Z jow $
18 local utl = require
"luci.util"
19 local fwm = require
"luci.model.firewall".init()
20 local nwm = require
"luci.model.network".init()
23 local value = self:formvalue(section)
24 if not value or value ==
"-" then
25 value = self:cfgvalue(section) or self.default
28 local def = fwm:get_defaults()
29 local zone = fwm:get_zone(value)
34 <div style=
"padding:0.5em">
35 <label style=
"background-color:<%=zone:get_color()%>; padding:0.4em">
36 <strong><%=zone:name()%
>:
</strong>
39 for _, net in ipairs(zone:get_networks()) do
40 net = nwm:get_network(net)
45 <%- if net:name() == self.network then -%
>
46 <span style=
"background-color:#FFFFFF; border:1px solid #000000; padding:2px; font-weight:bold"><%=net:name()%
>:
48 <span style=
"background-color:#FFFFFF; border:1px solid #CCCCCC; padding:2px"><%=net:name()%
>:
52 for _, iface in ipairs(net and net:get_interfaces() or {}) do
55 <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" />
57 <% if nempty then %
><em><%:(empty)%
></em><% end %
>
60 <% if zempty then %
><em><%:(empty)%
></em><% end %
>
63 <% for _, fwd in ipairs(zone:get_forwardings_by(
"src")) do
66 <label style=
"background-color:<%=fz:get_color()%>; padding:0.4em">
67 <strong><%=fz:name()%
></strong>
71 <label style=
"border:1px dashed #AAAAAA; color:#AAAAAA; padding:0.3em">
72 <strong><small><em><%=zone:forward():upper()%
></em></small></strong>