ipsectools-details-html.lsp 1.42 KB
Newer Older
Ted Trask's avatar
Ted Trask committed
1
<% local data, viewlibrary, page_info, session = ...
2
htmlviewfunctions = require("htmlviewfunctions")
3
html = require("acf.html")
4 5 6 7 8
%>

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

<%
9 10
local header_level = htmlviewfunctions.displaysectionstart(data, page_info)
local header_level2 = htmlviewfunctions.incrementheader(header_level)
11
if not data.value.show_isakmp or #data.value.show_isakmp.value == 0 then
12
	io.write("<p>No status details available</p>")
13 14 15
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
16
			htmlviewfunctions.displaysectionstart(cfe({label=entry.Destination.value}), page_info, header_level2)
17
			io.write("<table>\n")
18 19
			local tags = {"Created","Source","Destination", "St", "Phase2details"}
			for j,tag in pairs(tags) do
Ted Trask's avatar
Ted Trask committed
20
				io.write("<tr><td style='font-weight:bold;width:120px;border:none;'>" ..
21
					html.html_escape(entry[tag].label) .. "</td><td style='border:none;'>"..string.gsub(html.html_escape(entry[tag].value), "\n", "<br/>"))
22
				if (entry[tag].descr) and (#entry[tag].descr > 0) then io.write(" (".. html.html_escape(entry[tag].descr) .. ")") end
23
				io.write("</td></tr>")
24
			end
25
			io.write("</table>")
26
			htmlviewfunctions.displaysectionend(header_level2)
27 28 29
		end
	end
end
30
--htmlviewfunctions.displayitem(data.value.ip_xfrm_policy)
31
htmlviewfunctions.displaysectionend(header_level)
32
%>