summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2015-07-31 16:49:22 +0000
committerTed Trask <ttrask01@yahoo.com>2015-07-31 16:49:22 +0000
commita6f16048944ab1fccdd4b7ca099cc401c90cd81e (patch)
treecf545cd3b8378c874e305618cd93aed1e878fe4e /app
parent324e9e431f5f0a047357b5cc39586710b05bce34 (diff)
downloadacf-core-a6f16048944ab1fccdd4b7ca099cc401c90cd81e.tar.bz2
acf-core-a6f16048944ab1fccdd4b7ca099cc401c90cd81e.tar.xz
First cut at logfile-html.lsp view, only works with busybox syslog
Diffstat (limited to 'app')
-rw-r--r--app/Makefile1
-rw-r--r--app/logfile-html.lsp28
2 files changed, 29 insertions, 0 deletions
diff --git a/app/Makefile b/app/Makefile
index 93b8eb8..2b93f30 100644
--- a/app/Makefile
+++ b/app/Makefile
@@ -33,6 +33,7 @@ APP_DIST= \
filedetails-html.lsp\
expert-html.lsp\
debug-html.lsp\
+ logfile-html.lsp\
EXTRA_DIST=README Makefile
DISTFILES=$(APP_DIST) $(EXTRA_DIST)
diff --git a/app/logfile-html.lsp b/app/logfile-html.lsp
new file mode 100644
index 0000000..13766ef
--- /dev/null
+++ b/app/logfile-html.lsp
@@ -0,0 +1,28 @@
+<% local data, viewlibrary, page_info, session = ... %>
+
+<% if viewlibrary and viewlibrary.dispatch_component then
+ local clientdata = {}
+ if data.value[1] then
+ -- We have an array of logfile structures
+ for i,l in ipairs(data.value) do
+ clientdata = {}
+ for n,v in pairs(l) do
+ clientdata[n] = v
+ end
+ if clientdata.facility and clientdata.facility ~= "" then
+ clientdata.facility = nil
+ clientdata.filename = "/var/log/messages"
+ end
+ viewlibrary.dispatch_component("alpine-baselayout/logfiles/view", clientdata)
+ end
+ else
+ for n,v in pairs(data.value) do
+ clientdata[n] = v.value
+ end
+ if clientdata.facility and clientdata.facility ~= "" then
+ clientdata.facility = nil
+ clientdata.filename = "/var/log/messages"
+ end
+ viewlibrary.dispatch_component("alpine-baselayout/logfiles/view", clientdata)
+ end
+end %>