summaryrefslogtreecommitdiffstats
path: root/shorewall-expert-html.lsp
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-02-01 18:14:36 +0000
committerMika Havela <mika.havela@gmail.com>2008-02-01 18:14:36 +0000
commit37b4a15a9a0e07504188b96567d500085b035b4d (patch)
tree9986b737683c22c8f5aafb47817ec1ab9b41efce /shorewall-expert-html.lsp
parent33dd344b2d2074c8838834e1c77336499b8cb068 (diff)
downloadacf-shorewall-37b4a15a9a0e07504188b96567d500085b035b4d.tar.bz2
acf-shorewall-37b4a15a9a0e07504188b96567d500085b035b4d.tar.xz
Changed shorewall so that it reports/uses cfe's instead!
git-svn-id: svn://svn.alpinelinux.org/acf/shorewall/trunk@682 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'shorewall-expert-html.lsp')
-rw-r--r--shorewall-expert-html.lsp64
1 files changed, 44 insertions, 20 deletions
diff --git a/shorewall-expert-html.lsp b/shorewall-expert-html.lsp
index 2e2c1da..5a27555 100644
--- a/shorewall-expert-html.lsp
+++ b/shorewall-expert-html.lsp
@@ -1,42 +1,66 @@
-<? local view = ... ?>
-<h1>SYSTEM INFO</h1>
+<? local form = ... ?>
+<?
+--[[ 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>")
+--]]
+?>
-<DL>
-<dt>Program status</dt>
-<DD><?= view.status.status ?></DD>
-</DL>
+<?
+function informationform(myform,tags)
+ io.write("<DL>")
+ for k,v in pairs(tags) do
+ if (myform[v]) then
+ local val = myform[v]
+ io.write("\t<DT")
+ if (#val.errtxt > 0) then io.write(" class='error'") end
+ io.write(">" .. val.label .. "</DT>\n")
-<DL>
-<dt>Program version</dt>
-<dd><?= view.status.version ?></dd>
-</DL>
+ io.write("\t\t<DD>" .. val.value .. "\n")
+ if (val.descr) and (#val.descr > 0) then io.write("\t\t<P CLASS='descr'>" .. string.gsub(val.descr, "\n", "<BR>") .. "</P>\n") end
+ if (#val.errtxt > 0) then io.write("\t\t<P CLASS='error'>" .. string.gsub(val.errtxt, "\n", "<BR>") .. "</P>\n") end
+ io.write("\t\t</DD>\n")
+ end
+ end
+ io.write("</DL>")
+end
+?>
+
+<H1>SYSTEM INFO</H1>
+<?
+local myform = form.status
+local tags = { "status", "version", }
+informationform(myform,tags)
+?>
<h1>CONFIGURATION</h1>
<h2>Expert config</h2>
<h3>List of configfiles</h3>
+<? local myform = form.config ?>
<TABLE>
<TR style="background:#eee;font-weight:bold;">
- <TD width="120px" align="left">File</TD>
- <TD width="60px" align="right" style="padding-right:10px">Size</TD>
- <TD align="left">Last Modified</TD>
+ <TD style="padding-right:20px;white-space:nowrap;">File</TD>
+ <TD style="padding-right:20px;white-space:nowrap;">Size</TD>
+ <TD style="white-space:nowrap;">Last Modified</TD>
</TR>
-<? for i = 1, table.maxn(view.filelist) do ?>
+<? for i = 1, table.maxn(myform) do ?>
<TR>
- <TD><?= html.link{value = view.url .. "/edit?name=" .. view.filelist[i].path , label=view.filelist[i].name } ?></TD>
- <TD style="padding-right:10px" align="right"><?= view.filelist[i].filedetails.size ?></TD>
- <TD><?= view.filelist[i].filedetails.mtime ?></TD>
+ <TD style="padding-right:20px;white-space:nowrap;"><?= html.link{value = "edit?name=" .. myform[i].value , label=myform[i].value } ?></TD>
+ <TD style="padding-right:20px;white-space:nowrap;"><?= myform[i].size ?></TD>
+ <TD style="white-space:nowrap;" width="90%"><?= myform[i].mtime ?></TD>
</TR>
<? end ?>
</TABLE>
<?
--[[ DEBUG INFORMATION
-require("debugs")
-io.write(debugs.variables(view))
+io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
+io.write(html.cfe_unpack(form))
+io.write("</span>")
--]]
?>
-