summaryrefslogtreecommitdiffstats
path: root/dansguardian-controller.lua
diff options
context:
space:
mode:
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
+