summaryrefslogtreecommitdiffstats
path: root/postgresql-controller.lua
blob: e7c6d137e1009b6b0d4ff1f48d13daf9220df715 (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
module(..., package.seeall)

-- Load libraries
require("controllerfunctions")

mvc = {}
mvc.on_load = function(self, parent)
	self.model.set_processname(string.match(self.conf.prefix, "[^/]+"))
end

default_action = "status"

function status(self)
	return self.model.getstatus()
end

function startstop(self)
	return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.clientdata)
end

function details(self)
	return self.model.getstatusdetails()
end

function listfiles(self)
	return self.model.getfilelist()
end

function expert(self)
	return controllerfunctions.handle_form(self, function() return self.model.getfiledetails(self.clientdata.filename) end, self.model.updatefiledetails, self.clientdata, "Save", "Edit Postgresql File", "File Saved")
end