-<form method="post" action="<%=REQUEST_URI%>">
- <div class="cbi-map">
- <fieldset class="cbi-section">
- <h3><%:Actions%></h3>
- <ul>
- <li><a href="<%=REQUEST_URI%>?zero=<%=mode%>"><%:Reset Counters%></a></li>
- <li><a href="<%=REQUEST_URI%>?restart=1"><%:Restart Firewall%></a></li>
- </ul>
- <br /><br />
-
- <% for _, tbl in ipairs(tables) do chaincnt = 0 %>
- <h3><%:Table%>: <%=tbl%></h3>
- <table class="cbi-section-table" style="font-size:90%">
- <% for _, chain in ipairs(ipt:chains(tbl)) do
- rowcnt = 0
- chaincnt = chaincnt + 1
- chaininfo = ipt:chain(tbl, chain)
- %>
- <tr class="cbi-section-table-titles cbi-rowstyle-<%=rowstyle()%>">
- <th class="cbi-section-table-cell" style="text-align:left" colspan="11">
- <br /><span id="rule_<%=tbl:lower()%>_<%=chain%>">
- <%:Chain%> <em><%=chain%></em>
- (<%- if chaininfo.policy then -%>
- <%:Policy%>: <em><%=chaininfo.policy%></em>, <%:Packets%>: <%=chaininfo.packets%>, <%:Traffic%>: <%=wba.byte_format(chaininfo.bytes)-%>
- <%- else -%>
- <%:References%>: <%=chaininfo.references-%>
- <%- end -%>)</span>
- </th>
+<div class="cbi-map" style="position: relative">
+
+ <form method="post" action="<%=url("admin/status/iptables_action")%>" style="position: absolute; right: 0">
+ <input type="hidden" name="token" value="<%=token%>" />
+ <input type="hidden" name="family" value="<%=mode%>" />
+ <input type="submit" class="cbi-button" name="zero" value="<%:Reset Counters%>" />
+ <input type="submit" class="cbi-button" name="restart" value="<%:Restart Firewall%>" />
+ </form>
+
+ <fieldset class="cbi-section">
+
+ <% for _, tbl in ipairs(tables) do chaincnt = 0 %>
+ <h3><%:Table%>: <%=tbl%></h3>
+ <table class="cbi-section-table" style="font-size:90%">
+ <% for _, chain in ipairs(ipt:chains(tbl)) do
+ rowcnt = 0
+ chaincnt = chaincnt + 1
+ chaininfo = ipt:chain(tbl, chain)
+ %>
+ <tr class="cbi-section-table-titles cbi-rowstyle-<%=rowstyle()%>">
+ <th class="cbi-section-table-cell" style="text-align:left" colspan="11">
+ <br /><span id="rule_<%=tbl:lower()%>_<%=chain%>">
+ <%:Chain%> <em><%=chain%></em>
+ (<%- if chaininfo.policy then -%>
+ <%:Policy%>: <em><%=chaininfo.policy%></em>, <%:Packets%>: <%=chaininfo.packets%>, <%:Traffic%>: <%=wba.byte_format(chaininfo.bytes)-%>
+ <%- else -%>
+ <%:References%>: <%=chaininfo.references-%>
+ <%- end -%>)</span>
+ </th>
+ </tr>
+ <tr class="cbi-section-table-descr">
+ <th class="cbi-section-table-cell"><%:Pkts.%></th>
+ <th class="cbi-section-table-cell"><%:Traffic%></th>
+ <th class="cbi-section-table-cell"><%:Target%></th>
+ <th class="cbi-section-table-cell"><%:Prot.%></th>
+ <th class="cbi-section-table-cell"><%:In%></th>
+ <th class="cbi-section-table-cell"><%:Out%></th>
+ <th class="cbi-section-table-cell"><%:Source%></th>
+ <th class="cbi-section-table-cell"><%:Destination%></th>
+ <th class="cbi-section-table-cell" style="width:30%"><%:Options%></th>
+ </tr>
+
+ <% for _, rule in ipairs(ipt:find({table=tbl, chain=chain})) do %>
+ <tr class="cbi-section-table-row cbi-rowstyle-<%=rowstyle()%>">
+ <td><%=rule.packets%></td>
+ <td style="white-space: nowrap"><%=wba.byte_format(rule.bytes)%></td>
+ <td><%=rule.target and link_target(tbl, rule.target) or "-"%></td>
+ <td><%=rule.protocol%></td>
+ <td><%=link_iface(rule.inputif)%></td>
+ <td><%=link_iface(rule.outputif)%></td>
+ <td><%=rule.source%></td>
+ <td><%=rule.destination%></td>
+ <td style="width:30%"><small><%=#rule.options > 0 and luci.util.pcdata(table.concat(rule.options, " ")) or "-"%></small></td>