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

default_action = "status"

-- Public methods

status = function (self )
	return self.model.get()
end

delete = function (self)
	return self:redirect_to_referrer(self.model.delete(self.clientdata.name or ""))
end

view = function (self)
	return self.model.get_filedetails(self.clientdata.name or "")
end

download = function (self)
	local filestatus = view(self)
	local filecontent = filestatus.value.filecontent
	filecontent.label = basename(filestatus.value.filename.value)
	self.conf.viewtype = "stream"
	
	return filecontent
end