diff options
Diffstat (limited to 'shorewall-expert-html.lsp')
-rw-r--r-- | shorewall-expert-html.lsp | 64 |
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>") --]] ?> - |