diff options
author | Mika Havela <mika.havela@gmail.com> | 2007-10-31 18:56:56 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2007-10-31 18:56:56 +0000 |
commit | ffb16c081fedc61e7924af04d1aa3697033a0db8 (patch) | |
tree | 819482a16457f3a1757acc3ddf03a979bd6d4c0b /app/logfiles/logfiles-model.lua | |
parent | 2ec5ea76a03509585a553e275fc38dd9fc89b235 (diff) | |
download | acf-core-ffb16c081fedc61e7924af04d1aa3697033a0db8.tar.bz2 acf-core-ffb16c081fedc61e7924af04d1aa3697033a0db8.tar.xz |
Added initial files for viewing logfiles.
These files might be placed in wrong subfolder, but that can be changed later.
Menuhints are modified after wiki "Alpine Configuration Framework Design".
css has small changes.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@237 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'app/logfiles/logfiles-model.lua')
-rw-r--r-- | app/logfiles/logfiles-model.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/logfiles/logfiles-model.lua b/app/logfiles/logfiles-model.lua new file mode 100644 index 0000000..6198107 --- /dev/null +++ b/app/logfiles/logfiles-model.lua @@ -0,0 +1,22 @@ +module (..., package.seeall) + +-- no initializer in model - use controller.init for that + +local function read_file ( path ) + local file = io.open(path) + if ( file ) then + local f = file:read("*a") or "unknown" + file:close() + return f + else + return "Cant find '" .. path .. "'" + end +end + +get = function (self,path) + local file_content = {} + file_content = cfe{value=read_file(path), name=path} + file_name = cfe{value=path, name=file_name} + return file_content, file_name +end + |