summaryrefslogtreecommitdiffstats
path: root/dansguardian-controller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'dansguardian-controller.lua')
-rw-r--r--dansguardian-controller.lua40
1 files changed, 23 insertions, 17 deletions
diff --git a/dansguardian-controller.lua b/dansguardian-controller.lua
index e647954..c72d17c 100644
--- a/dansguardian-controller.lua
+++ b/dansguardian-controller.lua
@@ -222,28 +222,34 @@ category = function( self )
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
+ service.config.categories = self.model.get_categories()
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 info = self.model.get_category(self.clientdata.category, self.clientdata.object)
+ if not (info) then
+ redirect(self, "category")
+ end
+
+ -- Add a cmd button to the view
+ info.cmdsave = cfe({ name="cmdsave",
+ label="Save/Apply above settings",
+ value="Save",
+ type="submit",
+ disabled="yes",
+ errtxt="This button is not configured to work",
+ })
+
+ info.cmddelete = cfe({ name="cmddelete",
+ label="Permanently remove object",
+ value="Delete",
+ type="submit",
+ disabled="yes",
+ errtxt="This button is not configured to work",
+ })
local option = { script = ENV["SCRIPT_NAME"],
prefix = self.conf.prefix,
@@ -252,6 +258,6 @@ editcategories = function( self )
extra = ""
}
- return ( cfe ({ option = option, info = info }) )
+ return ( cfe ({ option = option, info = info, mhdebug=self.clientdata }) )
end