summaryrefslogtreecommitdiffstats
path: root/dansguardian-advanced-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'dansguardian-advanced-html.lsp')
-rw-r--r--dansguardian-advanced-html.lsp71
1 files changed, 47 insertions, 24 deletions
diff --git a/dansguardian-advanced-html.lsp b/dansguardian-advanced-html.lsp
index 0f6b78a..73e6015 100644
--- a/dansguardian-advanced-html.lsp
+++ b/dansguardian-advanced-html.lsp
@@ -1,4 +1,5 @@
<?
+require("viewfunctions")
local form = ...
local data = form.option
local service = form.service
@@ -6,7 +7,7 @@
local srv1fill = ""
local srv2fill = "disabled"
- if service.status == "running" then
+ if form.info.status.value == "Enabled" then
srv1fill = "disabled"
srv2fill = ""
end
@@ -18,7 +19,24 @@
end
?>
-<h1>Content Filter</h1>
+
+<?
+--[[ 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>")
+--]]
+?>
+
+<H1>SYSTEM INFO</H1>
+<DL>
+<?
+local myform = form.info
+local tags = { "status", "version", "autostart", }
+displayinfo(myform,tags,"viewonly")
+?>
+</DL>
+
<h2>General Information</h2>
<p>
DansGuardian is web content filtering software. It works as a web proxy,
@@ -32,32 +50,37 @@ generally not necessary. DansGuardian must be used in combination with a
This page lets you manually configure the filter rule files for DansGuardian.
</p>
-<h2>Status</h2>
-<dl><dt>Program version</dt><dd><? io.write( form.info.version.value ) ?></dd></dl>
-<dl><dt>Process status</dt><dd><? io.write( form.info.status.value ) ?></dd></dl>
-<dl><dt>Process information</dt><dd>This process runs as a service. When you make and save changes, the configuration
-files for the service are changed. However, the changes will not be <i>applied</i>
-until you restart the service.</dd></dl>
-<form action="" method="POST">
-<dl><dt>Daemon control</dt>
-<dd><input class="submit" type="submit" name="srvcmd" value="start" <? io.write( srv1fill ) ?>>
-<input class="submit" type="submit" name="srvcmd" value="stop" <? io.write( srv2fill ) ?>>
-<input class="submit" type="submit" name="srvcmd" value="restart" <? io.write( srv2fill ) ?>></dd></dl>
-<p class="error"><? io.write( service.message ) ?></p>
-</form>
+<h1>Configuration</h1>
+<? if (#service.cfgerr > 0) then ?>
+<h2>Errors</h2>
+<DL><DT>Config errors</DT>
+<DD><pre class=error><? io.write( service.cfgerr ) ?></pre></DD>
+</DL>
+<? end ?>
-<h2>Configuration</h2>
-<pre class=error><? io.write( service.cfgerr ) ?></pre>
-<h3>Files</h3>
-<p>
-Click on one of the files to edit it.
-</p>
+<h2>Files</h2>
+<DL>
+<TABLE>
+ <TR style="background:#eee;font-weight:bold;">
+ <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">File</TD>
+ <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Size</TD>
+ <TD style="white-space:nowrap;text-align:left;" class="header">Last Modified</TD>
+ </TR>
-<table>
<?
for k,v in ipairs( config.files ) do
- io.write( "<tr><td><a href=\"" .. data.script .. data.prefix .. data.controller .. "/edit?name=" .. v .. "\">" .. v .. "</a></td></tr>\n" )
+ io.write( "<tr><td><a href=\"" .. data.script .. data.prefix .. data.controller .. "/edit?name=" .. v.path .. "\">" .. v.path .. "</a></td><td>" .. (v.size or "--") .."</td><td>" .. (v.mtime or "--") .."</td></tr>\n" )
end
?>
-</table>
+</TABLE>
+</DL>
+<h1>MANAGEMENT</h1>
+<form action="" method="POST">
+<dl>
+<DT>Daemon control</DT><dd><input class="submit" type="submit" name="srvcmd" value="start" <? io.write( srv1fill ) ?>>
+<input class="submit" type="submit" name="srvcmd" value="stop" <? io.write( srv2fill ) ?>>
+<input class="submit" type="submit" name="srvcmd" value="restart" <? io.write( srv2fill ) ?>>
+<? if (service.message) and (service.message.descr) and (#service.message.descr > 0) then ?><pre><? io.write( service.message.descr ) ?></pre><? end ?></dd>
+</dl>
+</form>