summaryrefslogtreecommitdiffstats
path: root/dansguardian-controller.lua
blob: 37470bd9d80e58fd9df0c5ac7d24903e30bd5669 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-- 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

general = function( self )
	return controllerfunctions.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 )
	return self.model.list_files()
end

listconfigfiles = function( self )
	return self.model.list_config_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