From: Steven Barth Date: Sat, 5 Jul 2008 16:27:31 +0000 (+0000) Subject: applications/luci-olsr: Fixed to work with 0.5.6 X-Git-Tag: 0.8.0~709 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bbe086c9ce76c6abbc26434462736bb8b42f2a6c;p=oweals%2Fluci.git applications/luci-olsr: Fixed to work with 0.5.6 --- diff --git a/applications/luci-olsr/luasrc/controller/olsr.lua b/applications/luci-olsr/luasrc/controller/olsr.lua index a00dc3c54..1eede4464 100644 --- a/applications/luci-olsr/luasrc/controller/olsr.lua +++ b/applications/luci-olsr/luasrc/controller/olsr.lua @@ -157,11 +157,12 @@ function fetch_txtinfo(otable) local lines = luci.util.split(tbl, "\n") local name = table.remove(lines, 1):sub(8) local keys = luci.util.split(table.remove(lines, 1), "\t") + local split = #keys - 1 data[name] = {} for j, line in ipairs(lines) do - local fields = luci.util.split(line, "\t") + local fields = luci.util.split(line, "\t", split) data[name][j] = {} for k, key in pairs(keys) do data[name][j][key] = fields[k] diff --git a/applications/luci-olsr/luasrc/view/status-olsr/index.htm b/applications/luci-olsr/luasrc/view/status-olsr/index.htm index dabacd15a..70329e76b 100644 --- a/applications/luci-olsr/luasrc/view/status-olsr/index.htm +++ b/applications/luci-olsr/luasrc/view/status-olsr/index.htm @@ -11,6 +11,9 @@ ETX <% for k, link in ipairs(links) do + if link.Linkcost then + link.LinkQuality, link.NLQ, link.ETX = link.Linkcost:match("(.*)/(.*)\t(.*)") + end local color = "#bb3333" link.ETX = tonumber(link.ETX) diff --git a/applications/luci-olsr/luasrc/view/status-olsr/topology.htm b/applications/luci-olsr/luasrc/view/status-olsr/topology.htm index 6ad9f5c67..7871e133e 100644 --- a/applications/luci-olsr/luasrc/view/status-olsr/topology.htm +++ b/applications/luci-olsr/luasrc/view/status-olsr/topology.htm @@ -9,7 +9,11 @@ ILQ ETX -<% for k, route in ipairs(routes) do %> +<% for k, route in ipairs(routes) do + if route.Linkcost then + route.LQ, route.ILQ, route.ETX = route.Linkcost:match("(.*)/(.*)\t(.*)") + end +%> "><%=route["Destination IP"]%> "><%=route["Last hop IP"]%>