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