summaryrefslogtreecommitdiffstats
path: root/app/logfile-html.lsp
blob: 4299f8f4b0b7c855c6437256d7e852f14a3b5f2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<% local data, viewlibrary, page_info, session = ... %>
<% htmlviewfunctions = require("htmlviewfunctions") %>

<% htmlviewfunctions.displayinfo(data) %>

<% 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 %>