summaryrefslogtreecommitdiffstats
path: root/iptables-filterrules-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'iptables-filterrules-html.lsp')
-rw-r--r--iptables-filterrules-html.lsp41
1 files changed, 41 insertions, 0 deletions
diff --git a/iptables-filterrules-html.lsp b/iptables-filterrules-html.lsp
new file mode 100644
index 0000000..7011016
--- /dev/null
+++ b/iptables-filterrules-html.lsp
@@ -0,0 +1,41 @@
+<% local data, viewlibrary, page_info, session = ... %>
+<% require("htmlviewfunctions") %>
+
+<% htmlviewfunctions.displaycommandresults({"editchain", "deletechain", "createrule", "deleterule", "editrule", "createchain"}, session) %>
+
+<H1><%= html.html_escape(data.label) %></H1>
+<DL>
+ <TABLE>
+ <% local tab = data.value.table %>
+ <% for j,chain in ipairs(data.value) do %>
+ <TR><TD>
+ <% if chain.policy then %>
+ <a href="<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller.."/editchain?chain="..chain.name.."&table="..tab.."&redir="..page_info.orig_action) %>"><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/actions/document-properties.png' width='16' height='16' title="Edit Chain"></a>
+ <% else %>
+ <a href="<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller.."/deletechain?submit=true&chain="..chain.name.."&table="..tab.."&redir="..page_info.orig_action) %>"><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/actions/list-remove.png' width='16' height='16' title="Delete Chain"></a>
+ <% end %>
+ <%= html.html_escape(chain.name) %>
+ <% if chain.policy then io.write(" ("..html.html_escape(chain.policy)..")\n") end %>
+ <% if chain.references then io.write(" ("..html.html_escape(chain.references).." references)\n") end %>
+ </TD></TR>
+ <% for j,line in ipairs(chain) do %>
+ <TABLE>
+ <TR><TD WIDTH='80px' STYLE='padding-left:40px'>
+ <a href="<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller.."/createrule?table="..tab.."&chain="..chain.name.."&position="..j.."&redir="..page_info.orig_action) %>"><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/actions/list-add.png' width='16' height='16' title="Insert Rule"></a>
+ <a href="<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller.."/deleterule?submit=true&table="..tab.."&chain="..chain.name.."&position="..j.."&redir="..page_info.orig_action) %>"><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/actions/list-remove.png' width='16' height='16' title="Delete Rule"></a>
+ <a href="<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller.."/editrule?table="..tab.."&chain="..chain.name.."&position="..j.."&redir="..page_info.orig_action) %>"><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/actions/document-properties.png' width='16' height='16' title="Edit Rule"></a>
+ </TD>
+ <TD WIDTH='50px'><%= html.html_escape(line.packets) %></TD><TD WIDTH='50px'><%= html.html_escape(line.bytes) %></TD>
+ <TD><%= html.html_escape(line.rule) %></TD>
+ </TR>
+ </TABLE>
+ <% end %>
+ <TABLE>
+ <TR><TD WIDTH='80px' STYLE='padding-left:40px'>
+ <a href="<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller.."/createrule?table="..tab.."&chain="..chain.name.."&redir="..page_info.orig_action) %>"><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/actions/list-add.png' width='16' height='16' title="Append Rule"></a>
+ </TD></TR>
+ </TABLE>
+ <% end %>
+ <TR><TD><a href="<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller.."/createchain?table="..tab.."&redir="..page_info.orig_action) %>"><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/actions/list-add.png' width='16' height='16' title="Create Chain"></a></TD></TR>
+ </TABLE>
+</DL>