summaryrefslogtreecommitdiffstats
path: root/asterisk-controller.lua
blob: 25994a336aa9844e367c1b45f00038d97dc05ba3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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.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