diff options
author | Mika Havela <mika.havela@gmail.com> | 2007-11-01 16:29:17 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2007-11-01 16:29:17 +0000 |
commit | 6e1c67f38c43b88b4f098ced3279e2227c593e53 (patch) | |
tree | 4d92e20679cf490e4de849ad9a6b8dbeafafe16c /logfiles-controller.lua | |
parent | 5af4aa8ec50c8c335a5884900a997d260b274ea9 (diff) | |
download | acf-alpine-baselayout-6e1c67f38c43b88b4f098ced3279e2227c593e53.tar.bz2 acf-alpine-baselayout-6e1c67f38c43b88b4f098ced3279e2227c593e53.tar.xz |
Initial code for logfile browsing
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@243 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'logfiles-controller.lua')
-rw-r--r-- | logfiles-controller.lua | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/logfiles-controller.lua b/logfiles-controller.lua new file mode 100644 index 0000000..1770754 --- /dev/null +++ b/logfiles-controller.lua @@ -0,0 +1,33 @@ +module (..., package.seeall) + +-- Cause an http redirect to our "read" action +-- We use the self.conf table because it already has prefix,controller,etc +-- The redir code is defined in the application error handler (acf-controller) +local list_redir = function (self) + self.conf.action = "read" + self.conf.type = "redir" + error (self.conf) +end + +mvc={} +mvc.on_load = function(self, parent) + if (self.worker[self.conf.action] == nil ) or ( self.conf.action == "init" ) then + self.worker[self.conf.action] = list_redir(self) + end +end + +-- Public methods + +read = function (self ) + return ({logfile = self.model:get("/var/log/mini_httpd.log")} ) +end + +--update = function (self) +-- return nil +--end + +--delete = function (self) +-- return nil +--end + +--create = update |