summaryrefslogtreecommitdiffstats
path: root/ipsectools-details-html.lsp
blob: 564f5097b4e67eb4529d7043f3198b27821d384c (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
32
33
34
35
36
<% local data, viewlibrary, page_info = ... 
require("viewfunctions")
%>

<% viewlibrary.dispatch_component("status") %>

<H2><%= html.html_escape(data.label) %></H2>
<DL>
<%
if not data.value.show_isakmp or #data.value.show_isakmp.value == 0 then
	io.write("No status details available")
else
	for i,entry in pairs(data.value.show_isakmp.value) do
		if (type(entry) ==  "table") and (entry.Destination) and (entry.Destination.value) and (#entry.Destination.value > 0) then
			io.write("<H3><IMG SRC='<%= html.html_escape(page_info.staticdir) %>/tango/16x16/status/network-")
			if (tonumber(entry.St.value) < 9) then
				io.write("error")
			else
				io.write("idle")
			end
			io.write(".png' width='16' height='16'> ".. html.html_escape(entry.Destination.value) .. "</H3>")
			io.write("<TABLE>\n")
			local tags = {"Created","Source","Destination", "St", "Phase2details"}
			for j,tag in pairs(tags) do
				io.write("<TR><TD STYLE='font-weight:bold;width:120px;border:none;'>" .. 
					html.html_escape(entry[tag].label) .. "</TD><TD STYLE='border:none;'>"..string.gsub(html.html_escape(entry[tag].value), "\n", "<BR>"))
				if (entry[tag].descr) and (#entry[tag].descr > 0) then io.write(" (".. html.html_escape(entry[tag].descr) .. ")") end
				io.write("</TD></TR>")
			end
			io.write("</TABLE>")
		end
	end
end
--displayitem(data.value.ip_xfrm_policy)
%>
</DL>