diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-05-06 15:11:55 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-05-06 15:11:55 +0000 |
commit | 210f1c930825f872aa6003f37a8908a63c2c91f5 (patch) | |
tree | 81fb2cc025a43173c17a5732053f208514810797 /dansguardian-category-html.lsp | |
parent | 236a2b6bf29167ace2fbca2273f3c9b246387b17 (diff) | |
download | acf-dansguardian-210f1c930825f872aa6003f37a8908a63c2c91f5.tar.bz2 acf-dansguardian-210f1c930825f872aa6003f37a8908a63c2c91f5.tar.xz |
Changing buttons to be cfe's (coming from controller) rather than created by the view-file.
Reorganized the view-files so they look a bit more like other ACF's.
git-svn-id: svn://svn.alpinelinux.org/acf/dansguardian/trunk@1108 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'dansguardian-category-html.lsp')
-rw-r--r-- | dansguardian-category-html.lsp | 71 |
1 files changed, 51 insertions, 20 deletions
diff --git a/dansguardian-category-html.lsp b/dansguardian-category-html.lsp index bbe1a20..1edcc71 100644 --- a/dansguardian-category-html.lsp +++ b/dansguardian-category-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,25 @@ 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, making web requests in behalf of the client, and inspecting the returned content before passing on to the client. DansGuardian uses phraselists to @@ -27,31 +46,27 @@ generally not necessary. DansGuardian must be used in combination with a "smart proxy", such as squid. <b>This page lets you manually add/remove categories for DansGuardian.</b></p> -<h1>Status</h1> -<form action="" method="POST"> -<dl><dt>dansguardian is:</dt><dd><b><? io.write( service.status ) ?></b></dd></dl> -<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> -</form> - -<p><pre class=error><? io.write( service.message ) ?></pre></p> - <p>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.</p> <h1>Categories</h1> -<p><pre class=error><? io.write( service.cfgerr ) ?></pre></p> <h2>Add Category</h2> <p> To add a category, or to add a file to an existing category, please fill in the corresponding information below. (Due to a limitation with DansGuardian, all categories must be lowercase.) </p> -<dl><dt>Category name</dt><dd><input type="text" name="newcat" value=""></dd></dl> -<dl><dt>Category files</dt><dd><input type="checkbox" name="cattype" value="w">weighted <input type="checkbox" name="cattype" value="b">banned <input type="checkbox" name="cattype" value="e">exception</dd></dl> -<dl><dt>Action</dt><dd><input class="submit" type="submit" name="cmd" value="add"></dd></dl> +<dl> +<dt>Category name</dt><dd><input class="text" type="text" name="newcat" value=""></dd> +<dt>Category files</dt><dd><input type="checkbox" name="cattype" value="w">weighted <input type="checkbox" name="cattype" value="b">banned <input type="checkbox" name="cattype" value="e">exception</dd> +<? +local myform = form.service +local tags = { "cmdadd", } +displayinfo(myform,tags) +?> +</dl> + +<p><pre class=error><? io.write( service.cfgerr ) ?></pre></p> <p></p> <h2>Delete Category</h2> @@ -61,12 +76,28 @@ delete the link in the corresponding phraselist above. You will also need to edi above if you delete a category. </p> <form action="" method="POST"> -<dl><dt>Categories available</dt><dd>(please check the ones you want to delete)</dd></dl> +<dl> +<dt>Categories available</dt><dd>(please check the ones you want to delete) <? for k,v in ipairs( config ) do - io.write( "<dl><dt></dt><dd><input type=\"checkbox\" name=\"cats\" value=\"" .. v .. "\"> " .. v .. "</dd></dl>\n" ) + io.write( "<BR><input type=\"checkbox\" name=\"cats\" value=\"" .. v .. "\"> " .. v .. "\n" ) end ?> -<dl><dt>Action</dt><dd><input class="submit" type="submit" name="cmd" value="delete"></dd></dl> +</DD> +<? +local myform = form.service +local tags = { "cmddelete", } +displayinfo(myform,tags) +?> +</dl> </form> +<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> |