applications/luci-olsr: Fixed to work with 0.5.6

This commit is contained in:
Steven Barth 2008-07-05 16:27:31 +00:00
parent 2edc50aa43
commit bbe086c9ce
3 changed files with 10 additions and 2 deletions

View file

@ -157,11 +157,12 @@ function fetch_txtinfo(otable)
local lines = luci.util.split(tbl, "\n") local lines = luci.util.split(tbl, "\n")
local name = table.remove(lines, 1):sub(8) local name = table.remove(lines, 1):sub(8)
local keys = luci.util.split(table.remove(lines, 1), "\t") local keys = luci.util.split(table.remove(lines, 1), "\t")
local split = #keys - 1
data[name] = {} data[name] = {}
for j, line in ipairs(lines) do 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] = {} data[name][j] = {}
for k, key in pairs(keys) do for k, key in pairs(keys) do
data[name][j][key] = fields[k] data[name][j][key] = fields[k]

View file

@ -11,6 +11,9 @@
<th>ETX</th> <th>ETX</th>
</tr> </tr>
<% for k, link in ipairs(links) do <% 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" local color = "#bb3333"
link.ETX = tonumber(link.ETX) link.ETX = tonumber(link.ETX)

View file

@ -9,7 +9,11 @@
<th>ILQ</th> <th>ILQ</th>
<th>ETX</th> <th>ETX</th>
</tr> </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> <tr>
<td><a href="http://<%=route["Destination IP"]%>"><%=route["Destination IP"]%></a></td> <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> <td><a href="http://<%=route["Last hop IP"]%>"><%=route["Last hop IP"]%></a></td>