diff options
Diffstat (limited to 'opennhrp-status-html.lsp')
-rw-r--r-- | opennhrp-status-html.lsp | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/opennhrp-status-html.lsp b/opennhrp-status-html.lsp index 6137246..1fa098a 100644 --- a/opennhrp-status-html.lsp +++ b/opennhrp-status-html.lsp @@ -29,18 +29,14 @@ end <DL> <? local myform = form.status -local tags = { "status", "version", } +local tags = { "status", "version","autostart", } informationform(myform,tags) ?> </DL> -<? ---[[ ?> <H2>PROGRAM SPECIFIC OPTIONS/INFORMATION</H2> <DL> <? ---local myform = form.status ---local tags = { "stats", } ---informationform(myform,tags) local myform = form.status.show io.write("\t<DT") @@ -49,21 +45,38 @@ io.write(">" .. myform.label .. "</DT>\n") io.write("\t\t<DD>\n") for k,v in pairs(myform.option or {}) do io.write("\t\t\t<TABLE STYLE='margin-bottom:10px;'>") - io.write("\n\t\t\t<TR><TD STYLE='font-weight:bold;'><IMG SRC='/static/tango/16x16/devices/computer.png' width='16' height='16' alt> Protocol-Address</TD><TD STYLE='font-weight:bold;'>" .. v["Protocol-Address"] .. "</TD></TR>\n") + io.write("\n\t\t\t<TR><TD STYLE='font-weight:bold;'><IMG SRC='/static/tango/16x16/places/network-server.png' width='16' height='16' alt> " .. k .. "</TD><TD></TD></TR>\n") for k1,v1 in pairs(v) do - if (k1 ~= "Protocol-Address") then - io.write("<TR><TD WIDTH='100px' STYLE='font-weight:bold;padding-left:30px;'>"..k1.."</TD><TD>"..v1.."</TD></TR>\n") + io.write("\n\t\t\t<TR STYLE='padding-bottom:10px;'><TD WIDTH='150px' STYLE='font-weight:bold;padding-left:20px;'><IMG SRC='/static/tango/16x16/status/") + + if (v1) and (string.lower(v1['Type']) == "incomplete") then + io.write("network-error") + elseif (v1) and (string.lower(v1['Type']) == "negative") then + io.write("network-offline") + elseif (v1) and (string.lower(v1['Flags']) == "up") then + io.write("network-idle") + elseif (v1) and (string.lower(v1['Flags']) == "used up") then + io.write("network-transmit-receive") + else + io.write("network-error") + end + io.write(".png' width='16' height='16' title='" .. v1["Tooltip"] .. "'> " .. v1["Protocol-Address"] .. "</TD><TD STYLE='font-weight:bold;'></TD></TR>\n") + for k2,v2 in pairs(v1) do + if (k2) and not ((string.lower(k2) == "protocol-address") or + (string.lower(k2) == "tooltip") or + (string.lower(k2) == "interface")) then + io.write("<TR><TD STYLE='font-weight:bold;padding-left:40px;'>"..k2.."</TD><TD>"..v2.."</TD></TR>\n") + end end + end + io.write("\t\t\t</TABLE>") end io.write("\t\t</DD>\n") ?> </DL> -<? --]] ?> - - <? --[[ DEBUG INFORMATION io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>") |