summaryrefslogtreecommitdiffstats
path: root/dansguardian-controller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'dansguardian-controller.lua')
-rw-r--r--dansguardian-controller.lua19
1 files changed, 10 insertions, 9 deletions
diff --git a/dansguardian-controller.lua b/dansguardian-controller.lua
index 80dbec2..5c7a34d 100644
--- a/dansguardian-controller.lua
+++ b/dansguardian-controller.lua
@@ -1,29 +1,30 @@
-- the squid controller
+local mymodule = {}
-module (..., package.seeall)
+mymodule.default_action = "status"
-default_action = "status"
-
-status = function( self )
+mymodule.status = function( self )
return self.model.get_status()
end
-startstop = function( self )
+mymodule.startstop = function( self )
return self.handle_form(self, self.model.get_startstop, self.model.startstop_service, self.clientdata)
end
-general = function( self )
+mymodule.general = function( self )
return self.handle_form(self, self.model.read_general_config, self.model.update_general_config, self.clientdata, "Save", "Edit General Configuration", "General Configuration Set")
end
-listfiles = function( self )
+mymodule.listfiles = function( self )
return self.model.list_files()
end
-listconfigfiles = function( self )
+mymodule.listconfigfiles = function( self )
return self.model.list_config_files()
end
-edit = function( self )
+mymodule.edit = function( self )
return self.handle_form(self, function() return self.model.get_file(self.clientdata.filename) end, self.model.update_file, self.clientdata, "Save", "Edit File", "File Saved")
end
+
+return mymodule