applications/luci-olsr: Fixed to work with 0.5.6
authorSteven Barth <steven@midlink.org>
Sat, 5 Jul 2008 16:27:31 +0000 (16:27 +0000)
committerSteven Barth <steven@midlink.org>
Sat, 5 Jul 2008 16:27:31 +0000 (16:27 +0000)
applications/luci-olsr/luasrc/controller/olsr.lua
applications/luci-olsr/luasrc/view/status-olsr/index.htm
applications/luci-olsr/luasrc/view/status-olsr/topology.htm

index a00dc3c5479256537862e68fc9b1a434a3b58b50..1eede4464990ff087b543a63d44d43743eeb233b 100644 (file)
@@ -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] 
index dabacd15a7cf4e209e207171dfef8ae6f6eb3b65..70329e76bed1aef2f6ff57b97e99f0245cb4245a 100644 (file)
@@ -11,6 +11,9 @@
 <th>ETX</th>
 </tr>
 <% 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)
index 6ad9f5c673e783177349190a9bcd389aef5b785a..7871e133e3163eaedcc9662c74cd20e7ff45739e 100644 (file)
@@ -9,7 +9,11 @@
 <th>ILQ</th>
 <th>ETX</th>
 </tr>
-<% 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
+%>
 <tr>
 <td><a href="http://<%=route["Destination IP"]%>"><%=route["Destination IP"]%></a></td>
 <td><a href="http://<%=route["Last hop IP"]%>"><%=route["Last hop IP"]%></a></td>