Commit cc4fd416 authored by Ted Trask's avatar Ted Trask

Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags

parent 72c892f9
......@@ -5,33 +5,31 @@ html = require("acf.html")
<% viewlibrary.dispatch_component("status") %>
<H2><%= html.html_escape(data.label) %></H2>
<DL>
<h2><%= html.html_escape(data.label) %></h2>
<%
if not data.value.show_isakmp or #data.value.show_isakmp.value == 0 then
io.write("No status details available")
io.write("<p>No status details available</p>")
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.wwwprefix..page_info.staticdir).."/tango/16x16/status/network-")
io.write("<h3><img src='"..html.html_escape(page_info.wwwprefix..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")
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>"))
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>")
io.write("</td></tr>")
end
io.write("</TABLE>")
io.write("</table>")
end
end
end
--htmlviewfunctions.displayitem(data.value.ip_xfrm_policy)
%>
</DL>
......@@ -2,29 +2,46 @@
<% htmlviewfunctions = require("htmlviewfunctions") %>
<% html = require("acf.html") %>
<script type="text/javascript">
if (typeof jQuery == 'undefined') {
document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>');
}
</script>
<script type="text/javascript">
if (typeof $.tablesorter == 'undefined') {
document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"><\/script>');
}
</script>
<script type="text/javascript">
$(document).ready(function() {
$("#list").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']});
});
</script>
<% htmlviewfunctions.displaycommandresults({"deletecert"}, session) %>
<% htmlviewfunctions.displaycommandresults({"uploadcert"}, session, true) %>
<H1><%= html.html_escape(view.label) %></H1>
<DL>
<TABLE>
<TR style="background:#eee;font-weight:bold;">
<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Action</TD>
<TD style="white-space:nowrap;text-align:left;" class="header">Certificate</TD>
</TR>
<h1><%= html.html_escape(view.label) %></h1>
<table id="list" class="tablesorter"><thead>
<tr>
<th>Action</th>
<th>Certificate</th>
</tr>
</thead><tbody>
<% for i,cert in ipairs(view.value) do %>
<TR>
<TD style="padding-right:20px;white-space:nowrap;">
<tr>
<td>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletecert?submit=true&cert="..cert, label="Delete "} %>
<% if not string.find(cert, "%-key") then %>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/viewcert?cert="..cert, label="View "} %>
<% end %>
</TD>
<TD style="white-space:nowrap;"><%= html.html_escape(cert) %></TD>
</TR>
</td>
<td><%= html.html_escape(cert) %></td>
</tr>
<% end %>
</TABLE></DL>
</tbody></table>
<% if viewlibrary.dispatch_component and viewlibrary.check_permission("uploadcert") then
viewlibrary.dispatch_component("uploadcert")
......
......@@ -2,7 +2,7 @@
<% htmlviewfunctions = require("htmlviewfunctions") %>
<% html = require("acf.html") %>
<H1><%= html.html_escape(form.label) %></H1>
<h1><%= html.html_escape(form.label) %></h1>
<%
form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
form.enctype = "multipart/form-data"
......
......@@ -3,7 +3,7 @@
<% html = require("acf.html") %>
<% if view.value.result then %>
<H1>Certificate Details</H1>
<h1>Certificate Details</h1>
<% htmlviewfunctions.displayitem(view.value.cert, 1, page_info) %>
<pre><%= html.html_escape(view.value.result.value) %></pre>
<% else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment