diff options
Diffstat (limited to 'opennhrp-status-html.lsp')
-rw-r--r-- | opennhrp-status-html.lsp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/opennhrp-status-html.lsp b/opennhrp-status-html.lsp index 0d84bc1..765de12 100644 --- a/opennhrp-status-html.lsp +++ b/opennhrp-status-html.lsp @@ -49,28 +49,32 @@ for k,v in pairs(myform.option or {}) do for k1,v1 in pairs(v) do 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 + if (v1) and (string.lower(v1['Type']['value']) == "incomplete") then io.write("network-error") - elseif (v1) and (string.lower(v1['Type']) == "negative") then + elseif (v1) and (string.lower(v1['Type']['value']) == "negative") then io.write("network-offline") - elseif (v1) and (string.lower(v1['Flags']) == "up") then + elseif (v1) and (string.lower(v1['Flags']['value']) == "up") then io.write("network-idle") - elseif (v1) and (string.lower(v1['Flags']) == "used up") then + elseif (v1) and (string.lower(v1['Flags']['value']) == "used up") then io.write("network-transmit-receive") + elseif (v1) and (string.lower(v1['Flags']['value']) == "used up") then + io.write("network-offline") 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") + io.write(".png' width='16' height='16' title='" .. (v1['Type']['descr'] or "") .. "'> " .. v1["Protocol-Address"]['value'] .. "</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) - if (string.lower(k2) == "type") then - io.write(" <I>(" .. (v1['type_descr'] or "") .. ")</I>") + io.write("<TR><TD STYLE='font-weight:bold;padding-left:40px;'>"..k2.."</TD><TD>"..v2['value']) + if (v2['descr']) and (#v2['descr'] > 0) then + io.write(" <I>(" .. (v2['descr'] or "") .. ")</I>") end io.write("</TD></TR>\n") end +--]] end end |