diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-05-14 11:38:29 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-05-14 11:38:29 +0000 |
commit | 9b8a758b54ffa703067c23b36b9ca801e8cb8d90 (patch) | |
tree | 4fa6857298bd82e0312c6b5d6302f3df8fe2be3d /shorewall-config-html.lsp | |
parent | a5375d0530f4d7f9c622a1f062cb3424eed43107 (diff) | |
download | acf-shorewall-9b8a758b54ffa703067c23b36b9ca801e8cb8d90.tar.bz2 acf-shorewall-9b8a758b54ffa703067c23b36b9ca801e8cb8d90.tar.xz |
Rebuilding the config-view-file to be more easy to use (and a bit more good looking).
git-svn-id: svn://svn.alpinelinux.org/acf/shorewall/trunk@1117 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'shorewall-config-html.lsp')
-rw-r--r-- | shorewall-config-html.lsp | 153 |
1 files changed, 140 insertions, 13 deletions
diff --git a/shorewall-config-html.lsp b/shorewall-config-html.lsp index 80e0e9f..41ca945 100644 --- a/shorewall-config-html.lsp +++ b/shorewall-config-html.lsp @@ -1,5 +1,29 @@ <? local form = ... require("viewfunctions") +--[[ DEBUG INFORMATION +io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>") +io.write(html.cfe_unpack(form)) +io.write("</span>") +--]] + +local descr = { + ['interfaces'] = { + ['labels'] = { "ZONE", "INTERFACES", "BROADCAST", "OPTIONS" }, + ['width'] = { "100", "100", "100", "*" } + }, + ['zones'] = { + ['labels'] = { "ZONE", "INTERFACES", "BROADCAST", "OPTIONS" }, + ['width'] = { "100", "100", "100", "*" } + }, + ['policy'] = { + ['labels'] = { "SOURCE", "DEST", "POLICY", "LOG LEVEL", "LIMIT:BURST" }, + ['width'] = { "100", "100", "100", "100" } + }, + ['rules'] = { + ['labels'] = { "ACTION", "SOURCE", "DEST", "PROTO", "DEST<BR>PORT", "SOURCE<BR>PORT(S)", "ORIGINAL<BR>DEST", "RATE<BR>LIMIT", "USER/<BR>GROUP", "MARK", }, + ['width'] = { "100", "70", "70", "70", "100", } + }, + } ?> <H1>SYSTEM INFO</H1> @@ -24,44 +48,147 @@ displayinfo(myform,tags) </DL> <H3>Interfaces</H3> +<? local myform = "interfaces" ?> <DL> -<? -local tags = { "interfaces", "interfaces_cmd", } -displayinfo(myform,tags) +<TABLE> +<TR> + <TD style="padding:0px;margin:0px;" class="header" WIDTH="17"><IMG SRC='/static/tango/16x16/actions/go-down.png' width='16' height='16' alt></TD> +<? for i=1,#descr[myform]['labels'] do ?> + <TD style="padding-right:10px;text-align:left;" class="header" WIDTH="<? io.write(descr[myform]['width'][i] or "*") ?>"><? io.write(descr[myform]['labels'][i] or "") ?></TD> +<? end ?> + <TD class="header" WIDTH="60"><IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record"></TD> +</TR> + +<? +for i=1, #form.config[myform]['option'] do ?> -</DL> +<TR> + <TD><IMG SRC='/static/tango/16x16/actions/go-<? if i == #form.config[myform]['option'] then io.write("bottom") else io.write("down") end ?>.png' width='16' height='16' alt></TD> + <? for ii=1,#descr[myform]['labels'] do ?> + <TD style="padding-right:10px;text-align:left;border-bottom:1px solid #ccc"><? io.write(form.config[myform]['option'][i][ii] or "") ?></TD> + <? end ?> + <TD style="padding-right:0px;text-align:left;border-bottom:1px solid #ccc"> +<IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record"> +<IMG SRC='/static/tango/16x16/actions/list-remove.png' width='16' height='16' title="Remove this record"> +<IMG SRC='/static/tango/16x16/actions/document-properties.png' width='16' height='16' title="Edit this record"> +</TD> + </TR> +<? +end +?> +</TABLE> +</DL> <H3>Defince zones</H3> +<? local myform = "zones" ?> <DL> -<? -local tags = { "zones", "zones_cmd", } -displayinfo(myform,tags) +<TABLE> +<TR> + <TD style="padding:0px;margin:0px;" class="header" WIDTH="17"><IMG SRC='/static/tango/16x16/actions/go-down.png' width='16' height='16' alt></TD> +<? for i=1,#descr[myform]['labels'] do ?> + <TD style="padding-right:10px;text-align:left;" class="header" WIDTH="<? io.write(descr[myform]['width'][i] or "*") ?>"><? io.write(descr[myform]['labels'][i] or "") ?></TD> +<? end ?> + <TD class="header" WIDTH="60"><IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record"></TD> +</TR> + +<? +for i=1, #form.config[myform]['option'] do +?> + +<TR> + <TD><IMG SRC='/static/tango/16x16/actions/go-<? if i == #form.config[myform]['option'] then io.write("bottom") else io.write("down") end ?>.png' width='16' height='16' alt></TD> + <? for ii=1,#descr[myform]['labels'] do ?> + <TD style="padding-right:10px;text-align:left;border-bottom:1px solid #ccc"><? io.write(form.config[myform]['option'][i][ii] or "") ?></TD> + <? end ?> + <TD style="padding-right:0px;text-align:left;border-bottom:1px solid #ccc"> +<IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record"> +<IMG SRC='/static/tango/16x16/actions/list-remove.png' width='16' height='16' title="Remove this record"> +<IMG SRC='/static/tango/16x16/actions/document-properties.png' width='16' height='16' title="Edit this record"> +</TD> + </TR> +<? +end ?> +</TABLE> </DL> <h3>Default policy</h3> +<? local myform = "policy" ?> <DL> -<? -local tags = { "policy", "policy_cmd",} -displayinfo(myform,tags) +<TABLE> +<TR> + <TD style="padding:0px;margin:0px;" class="header" WIDTH="17"><IMG SRC='/static/tango/16x16/actions/go-down.png' width='16' height='16' alt></TD> +<? for i=1,#descr[myform]['labels'] do ?> + <TD style="padding-right:10px;text-align:left;" class="header" WIDTH="<? io.write(descr[myform]['width'][i] or "*") ?>"><? io.write(descr[myform]['labels'][i] or "") ?></TD> +<? end ?> + <TD class="header" WIDTH="60"><IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record"></TD> +</TR> + +<? +for i=1, #form.config[myform]['option'] do ?> + +<TR> + <TD><IMG SRC='/static/tango/16x16/actions/go-<? if i == #form.config[myform]['option'] then io.write("bottom") else io.write("down") end ?>.png' width='16' height='16' alt></TD> + <? for ii=1,#descr[myform]['labels'] do ?> + <TD style="padding-right:10px;text-align:left;border-bottom:1px solid #ccc"><? io.write(form.config[myform]['option'][i][ii] or "") ?></TD> + <? end ?> + <TD style="padding-right:0px;text-align:left;border-bottom:1px solid #ccc"> +<IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record"> +<IMG SRC='/static/tango/16x16/actions/list-remove.png' width='16' height='16' title="Remove this record"> +<IMG SRC='/static/tango/16x16/actions/document-properties.png' width='16' height='16' title="Edit this record"> +</TD> + </TR> +<? +end +?> +</TABLE> </DL> <h3>Rules</h3> +<? local myform = "rules" +local val = {1,2,3,4,5,6,7,8,10,} +?> <DL> -<? -local tags = { "rules", "rules_cmd",} -displayinfo(myform,tags) +<TABLE> +<TR> + <TD style="padding:0px;margin:0px;" class="header" WIDTH="17"><IMG SRC='/static/tango/16x16/actions/go-down.png' width='16' height='16' alt></TD> +<? for k,i in pairs(val) do ?> + <TD style="padding-right:10px;text-align:left;" class="header" WIDTH="<? io.write(descr[myform]['width'][i] or "*") ?>"><? io.write(descr[myform]['labels'][i] or "") ?></TD> +<? end ?> + <TD class="header" WIDTH="60"><IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record"></TD> +</TR> + +<? +for i=1, #form.config[myform]['option'] do ?> + +<TR> + <TD><IMG SRC='/static/tango/16x16/actions/go-<? if i == #form.config[myform]['option'] then io.write("bottom") else io.write("down") end ?>.png' width='16' height='16' alt></TD> + <? for ii,vv in pairs(val) do ?> + <TD style="padding-right:10px;text-align:left;border-bottom:1px solid #ccc"><? io.write(form.config[myform]['option'][i][ii] or "") ?></TD> + <? end ?> + <TD style="padding-right:0px;text-align:left;border-bottom:1px solid #ccc"> +<IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record"> +<IMG SRC='/static/tango/16x16/actions/list-remove.png' width='16' height='16' title="Remove this record"> +<IMG SRC='/static/tango/16x16/actions/document-properties.png' width='16' height='16' title="Edit this record"> +</TD> + </TR> +<? +end +?> +</TABLE> </DL> + </form> <form name="cmd" action="<?= form.option.link ?>/<?= form.option.action ?>" method="POST"> <H1>MANAGEMENT</H1> <dl> <? +local myform = form.config local tags = { "check_cmd",} displayinfo(myform,tags) ?> |