blob: 58fb0f01ecf323b877e2b4901e5bf3ce293e102e (
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
32
33
|
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 "", self.clientdata.grep)
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
tail = function (self)
if self.clientdata.offset then
self.conf.viewtype = "ajax"
end
return self.model.tail(self.clientdata.name, self.clientdata.offset, self.clientdata.grep)
end
|