summaryrefslogtreecommitdiffstats
path: root/asterisk-controller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'asterisk-controller.lua')
-rw-r--r--asterisk-controller.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/asterisk-controller.lua b/asterisk-controller.lua
new file mode 100644
index 0000000..d771230
--- /dev/null
+++ b/asterisk-controller.lua
@@ -0,0 +1,23 @@
+-- the squid controller
+
+module (..., package.seeall)
+
+require("controllerfunctions")
+
+default_action = "status"
+
+status = function( self )
+ return self.model.get_status()
+end
+
+startstop = function( self )
+ return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.model.get_status, self.clientdata)
+end
+
+listfiles = function( self )
+ return self.model.list_files()
+end
+
+edit = function( self )
+ return controllerfunctions.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