module (..., package.seeall) default_action = "status" -- Public methods status = function (self ) return ({logfile = self.model:get(), url = self.conf.script .. self.conf.prefix .. self.conf.controller} ) end delete = function (self) local filetodelete = self.clientdata.name or "" local me = ({deletestatus = self.model:delete(filetodelete)}) if (me.deletestatus.errtxt) then return me else redirect(self) end end view = function (self) local filetoview = self.clientdata.name or "" local content = { logfile=self.model:get_filedetails(filetoview)} if (filetoview ~= "") and (content.logfile.name ~= nil) then return content else redirect(self) end end download = view