From bedf65aed20be9e24d6aa3b8eda56e009011b906 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 13 Sep 2008 17:51:03 +0000 Subject: [PATCH] * luci/app-olsr: fix olsr status pages --- .../luci-olsr/luasrc/controller/olsr.lua | 10 +++++----- .../luci-olsr/luasrc/view/status-olsr/hna.htm | 2 +- .../luci-olsr/luasrc/view/status-olsr/index.htm | 16 ++++++++-------- .../luci-olsr/luasrc/view/status-olsr/mid.htm | 2 +- .../luci-olsr/luasrc/view/status-olsr/routes.htm | 2 +- .../luasrc/view/status-olsr/topology.htm | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/applications/luci-olsr/luasrc/controller/olsr.lua b/applications/luci-olsr/luasrc/controller/olsr.lua index c0a7f5fe6..c80a75cc1 100644 --- a/applications/luci-olsr/luasrc/controller/olsr.lua +++ b/applications/luci-olsr/luasrc/controller/olsr.lua @@ -72,8 +72,8 @@ function action_index() end local function compare(a, b) - local c = tonumber(a.ETX) - local d = tonumber(b.ETX) + local c = tonumber(a.Cost) + local d = tonumber(b.Cost) if not c or c == 0 then return false @@ -128,7 +128,7 @@ function action_topology() end local function compare(a, b) - return a["Destination IP"] < b["Destination IP"] + return a["Dest. IP"] < b["Dest. IP"] end table.sort(data.Topology, compare) @@ -145,7 +145,7 @@ function action_hna() end local function compare(a, b) - return a.Network < b.Network + return a.Destination < b.Destination end table.sort(data.HNA, compare) @@ -162,7 +162,7 @@ function action_mid() end local function compare(a, b) - return a.IP < b.IP + return a["IP address"] < b["IP address"] end table.sort(data.MID, compare) diff --git a/applications/luci-olsr/luasrc/view/status-olsr/hna.htm b/applications/luci-olsr/luasrc/view/status-olsr/hna.htm index 35dec2d8e..e15a235f9 100644 --- a/applications/luci-olsr/luasrc/view/status-olsr/hna.htm +++ b/applications/luci-olsr/luasrc/view/status-olsr/hna.htm @@ -22,7 +22,7 @@ $Id$ <% for k, route in ipairs(routes) do %> -<%=route.Network%>/<%=route.Netmask%> +<%=route.Destination%> <%=route.Gateway%> <% end %> diff --git a/applications/luci-olsr/luasrc/view/status-olsr/index.htm b/applications/luci-olsr/luasrc/view/status-olsr/index.htm index 035d6dd1e..037151d1d 100644 --- a/applications/luci-olsr/luasrc/view/status-olsr/index.htm +++ b/applications/luci-olsr/luasrc/view/status-olsr/index.htm @@ -27,23 +27,23 @@ $Id$ <% for k, link in ipairs(links) do local color = "#bb3333" - link.ETX = tonumber(link.ETX) or 0 - if link.ETX == 0 then + link.Cost = tonumber(link.Cost) or 0 + if link.Cost == 0 then color = "#bb3333" - elseif link.ETX < 4 then + elseif link.Cost < 4 then color = "#00cc00" - elseif link.ETX < 10 then + elseif link.Cost < 10 then color = "#ffcb05" - elseif link.ETX < 100 then + elseif link.Cost < 100 then color = "#ff6600" end %> -"><%=link["remote IP"]%> +"><%=link["Remote IP"]%> <%=link["Local IP"]%> -<%=link.LinkQuality%> +<%=link.LQ%> <%=link.NLQ%> -<%=string.format("%.3f", link.ETX)%> +<%=string.format("%.3f", link.Cost)%> <% end %> diff --git a/applications/luci-olsr/luasrc/view/status-olsr/mid.htm b/applications/luci-olsr/luasrc/view/status-olsr/mid.htm index d82ac924a..0646bb5f6 100644 --- a/applications/luci-olsr/luasrc/view/status-olsr/mid.htm +++ b/applications/luci-olsr/luasrc/view/status-olsr/mid.htm @@ -22,7 +22,7 @@ $Id$ <% for k, mid in ipairs(mids) do %> -<%=mid.IP%> +"><%=mid["IP address"]%> <%=mid.Aliases%> <% end %> diff --git a/applications/luci-olsr/luasrc/view/status-olsr/routes.htm b/applications/luci-olsr/luasrc/view/status-olsr/routes.htm index 253a77126..27d967080 100644 --- a/applications/luci-olsr/luasrc/view/status-olsr/routes.htm +++ b/applications/luci-olsr/luasrc/view/status-olsr/routes.htm @@ -39,7 +39,7 @@ $Id$ %> <%=route.Destination%> -<%=route.Gateway%> +<%=route["Gateway IP"]%> <%=route.Interface%> <%=route.Metric%> <%=string.format("%.3f", tonumber(route.ETX) or 0)%> diff --git a/applications/luci-olsr/luasrc/view/status-olsr/topology.htm b/applications/luci-olsr/luasrc/view/status-olsr/topology.htm index c7bd93574..df10b7846 100644 --- a/applications/luci-olsr/luasrc/view/status-olsr/topology.htm +++ b/applications/luci-olsr/luasrc/view/status-olsr/topology.htm @@ -26,11 +26,11 @@ $Id$ <% for k, route in ipairs(routes) do %> -"><%=route["Destination IP"]%> +"><%=route["Dest. IP"]%> "><%=route["Last hop IP"]%> <%=route.LQ%> -<%=route.ILQ%> -<%=string.format("%.3f", tonumber(route.ETX) or 0)%> +<%=route.NLQ%> +<%=string.format("%.3f", tonumber(route.Cost) or 0)%> <% end %> -- 2.25.1