summaryrefslogtreecommitdiffstats
path: root/opennhrp-show-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-09-18 19:32:39 +0000
committerTed Trask <ttrask01@yahoo.com>2008-09-18 19:32:39 +0000
commit4d42ae72cb319eaff33374f61fec515ee374bdbb (patch)
treec34451e4a6e16de74b1fafdee27bc8777f9fdd5b /opennhrp-show-html.lsp
parent6c92185343afd2a6af20868de2f61337c7288554 (diff)
downloadacf-opennhrp-4d42ae72cb319eaff33374f61fec515ee374bdbb.tar.bz2
acf-opennhrp-4d42ae72cb319eaff33374f61fec515ee374bdbb.tar.xz
Modified opennhrp to parse show result and display nicely.
git-svn-id: svn://svn.alpinelinux.org/acf/opennhrp/trunk@1476 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'opennhrp-show-html.lsp')
-rw-r--r--opennhrp-show-html.lsp44
1 files changed, 43 insertions, 1 deletions
diff --git a/opennhrp-show-html.lsp b/opennhrp-show-html.lsp
index fce8a79..4074cf8 100644
--- a/opennhrp-show-html.lsp
+++ b/opennhrp-show-html.lsp
@@ -8,5 +8,47 @@ end %>
<H1><%= data.label %></H1>
<DL>
-<% displayitem(data) %>
+<%
+displayitem(data.value.status)
+if #data.value.peers_list then
+%>
+<DT><%= data.value.peers_list.label %></DT>
+<DD>
+<% for intf,addresses in pairs(data.value.peers_list.value) do %>
+ <TABLE STYLE='margin-bottom:10px;'>
+ <TR><TD STYLE='font-weight:bold;border:none;'><IMG SRC='/skins/static/tango/16x16/places/network-server.png' width='16' height='16' alt> <%= intf %></TD><TD STYLE='border:none;'></TD></TR>
+<% for i,entries in ipairs(addresses) do
+ io.write("<TR STYLE='padding-bottom:10px;'><TD WIDTH='150px' STYLE='font-weight:bold;padding-left:20px;border:none;'><IMG SRC='/skins/static/tango/16x16/status/")
+
+ if entries.Type and (entries.Type.value == "incomplete") then
+ io.write("network-error")
+ elseif entries.Type and (entries.Type.value == "negative") then
+ io.write("network-offline")
+ elseif entries.Flags and (entries.Flags.value == "up") then
+ io.write("network-idle")
+ elseif entries.Flags and (entries.Flags.value == "used up") then
+ io.write("network-transmit-receive")
+ elseif entries.Flags and (entries.Flags.value == "used up") then
+ io.write("network-offline")
+ else
+ io.write("network-error")
+ end
+ io.write(".png' width='16' height='16' title='" .. (entries.Type.descr or "") .. "'> " .. entries["Protocol-Address"].value .. "</TD><TD STYLE='font-weight:bold;border:none;'></TD></TR>\n")
+
+ for j,entry in pairs(entries) do
+ if j ~= "Protocol-Address" then
+ io.write("<TR><TD STYLE='font-weight:bold;padding-left:40px;border:none;'>"..entry.label.."</TD><TD STYLE='border:none;'>"..entry.value)
+ if entry.descr then
+ io.write(" <I>(" .. entry.descr .. ")</I>")
+ end
+ io.write("</TD></TR>\n")
+ end
+ end
+ end
+ io.write("\t\t\t</TABLE>")
+ end
+%>
+</DD>
+<% end %>
</DL>
+