From 4837cd73c1d79b17af443e0335cc04259505cd23 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Wed, 7 May 2008 15:10:35 +0000 Subject: 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 --- dansguardian-controller.lua | 71 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 12 deletions(-) (limited to 'dansguardian-controller.lua') 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 + -- cgit v1.2.3