summaryrefslogtreecommitdiffstats
path: root/dansguardian-controller.lua
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-05-07 15:10:35 +0000
committerMika Havela <mika.havela@gmail.com>2008-05-07 15:10:35 +0000
commit4837cd73c1d79b17af443e0335cc04259505cd23 (patch)
tree2fe3ec56dc7d3f97c57b910dbae046393c367487 /dansguardian-controller.lua
parent210f1c930825f872aa6003f37a8908a63c2c91f5 (diff)
downloadacf-dansguardian-4837cd73c1d79b17af443e0335cc04259505cd23.tar.bz2
acf-dansguardian-4837cd73c1d79b17af443e0335cc04259505cd23.tar.xz
Saving work for today.
Sketching on a idea on howto edit categories (now showing if a category exists but is not configured to be used/activated in the main config). git-svn-id: svn://svn.alpinelinux.org/acf/dansguardian/trunk@1109 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'dansguardian-controller.lua')
-rw-r--r--dansguardian-controller.lua71
1 files changed, 59 insertions, 12 deletions
diff --git a/dansguardian-controller.lua b/dansguardian-controller.lua
index 9b19314..e647954 100644
--- a/dansguardian-controller.lua
+++ b/dansguardian-controller.lua
@@ -2,8 +2,26 @@
module (..., package.seeall)
-default_action = "general"
+default_action = "status"
+status = function( self )
+
+ local info = {
+ status=self.model.get_status(),
+ version = self.model.get_dansguardian_version(),
+ autostart = self.model.get_autostart(),
+ srvctrl = { value = srvctrl}
+ }
+
+ local option = { script = ENV["SCRIPT_NAME"],
+ prefix = self.conf.prefix,
+ controller = self.conf.controller,
+ action = self.conf.action,
+ extra = ""
+ }
+
+ return ( cfe ({ option = option, info = info }) )
+end
general = function( self )
local service = {}
@@ -190,21 +208,50 @@ category = function( self )
label="Action",
value="Add",
type="submit",
- disabled="yes",
- errtxt="This button is currently out of order",
})
- service.cmddelete = cfe({
- name="cmddelete",
- label="Action",
- value="Delete",
- type="submit",
- disabled="yes",
- errtxt="This button is currently out of order",
+ service.cmdaddvalue = cfe({
+ name="cmdaddvalue",
+ value="",
+ type="text",
})
- service.config = self.model.get_categories()
-
+ service.config = {}
+ service.config.categories = cfe({
+ name="categories",
+ label="Categories available",
+ value={},
+ })
+ for k,v in pairs(self.model.get_categories()) do
+ local types = { weighted, banned, exception }
+
+-- for k,v in pairs(types) do
+-- if (fs.is_file(
+ --table.insert(weighted, cfe({type="link", value="value", name="name", label="label",}))
+-- end
+
+ table.insert(service.config.categories.value, v )
+ end
+
return ( cfe ({ option = option, service = service, info = info }) )
end
+editcategories = function( self )
+
+ local info = {
+ status=self.model.get_status(),
+ version = self.model.get_dansguardian_version(),
+ autostart = self.model.get_autostart(),
+ srvctrl = { value = srvctrl}
+ }
+
+ local option = { script = ENV["SCRIPT_NAME"],
+ prefix = self.conf.prefix,
+ controller = self.conf.controller,
+ action = self.conf.action,
+ extra = ""
+ }
+
+ return ( cfe ({ option = option, info = info }) )
+end
+