summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 %>