* luci/app-olsr: fix olsr status pages

This commit is contained in:
Jo-Philipp Wich 2008-09-13 17:51:03 +00:00
parent db04fffe13
commit bedf65aed2
6 changed files with 19 additions and 19 deletions

View file

@ -72,8 +72,8 @@ function action_index()
end end
local function compare(a, b) local function compare(a, b)
local c = tonumber(a.ETX) local c = tonumber(a.Cost)
local d = tonumber(b.ETX) local d = tonumber(b.Cost)
if not c or c == 0 then if not c or c == 0 then
return false return false
@ -128,7 +128,7 @@ function action_topology()
end end
local function compare(a, b) local function compare(a, b)
return a["Destination IP"] < b["Destination IP"] return a["Dest. IP"] < b["Dest. IP"]
end end
table.sort(data.Topology, compare) table.sort(data.Topology, compare)
@ -145,7 +145,7 @@ function action_hna()
end end
local function compare(a, b) local function compare(a, b)
return a.Network < b.Network return a.Destination < b.Destination
end end
table.sort(data.HNA, compare) table.sort(data.HNA, compare)
@ -162,7 +162,7 @@ function action_mid()
end end
local function compare(a, b) local function compare(a, b)
return a.IP < b.IP return a["IP address"] < b["IP address"]
end end
table.sort(data.MID, compare) table.sort(data.MID, compare)

View file

@ -22,7 +22,7 @@ $Id$
</tr> </tr>
<% for k, route in ipairs(routes) do %> <% for k, route in ipairs(routes) do %>
<tr> <tr>
<td><%=route.Network%>/<%=route.Netmask%></td> <td><%=route.Destination%></td>
<td><a href="http://<%=route.Gateway%>"><%=route.Gateway%></a></td> <td><a href="http://<%=route.Gateway%>"><%=route.Gateway%></a></td>
</tr> </tr>
<% end %> <% end %>

View file

@ -27,23 +27,23 @@ $Id$
<% for k, link in ipairs(links) do <% for k, link in ipairs(links) do
local color = "#bb3333" local color = "#bb3333"
link.ETX = tonumber(link.ETX) or 0 link.Cost = tonumber(link.Cost) or 0
if link.ETX == 0 then if link.Cost == 0 then
color = "#bb3333" color = "#bb3333"
elseif link.ETX < 4 then elseif link.Cost < 4 then
color = "#00cc00" color = "#00cc00"
elseif link.ETX < 10 then elseif link.Cost < 10 then
color = "#ffcb05" color = "#ffcb05"
elseif link.ETX < 100 then elseif link.Cost < 100 then
color = "#ff6600" color = "#ff6600"
end end
%> %>
<tr> <tr>
<td><a href="http://<%=link["remote IP"]%>"><%=link["remote IP"]%></a></td> <td><a href="http://<%=link["Remote IP"]%>"><%=link["Remote IP"]%></a></td>
<td><%=link["Local IP"]%></td> <td><%=link["Local IP"]%></td>
<td><%=link.LinkQuality%></td> <td><%=link.LQ%></td>
<td><%=link.NLQ%></td> <td><%=link.NLQ%></td>
<td style="background-color:<%=color%>"><%=string.format("%.3f", link.ETX)%></td> <td style="background-color:<%=color%>"><%=string.format("%.3f", link.Cost)%></td>
</tr> </tr>
<% end %> <% end %>
</table> </table>

View file

@ -22,7 +22,7 @@ $Id$
</tr> </tr>
<% for k, mid in ipairs(mids) do %> <% for k, mid in ipairs(mids) do %>
<tr> <tr>
<td><a href="http://<%=mid.IP%>"><%=mid.IP%></a></td> <td><a href="http://<%=mid["IP address"]%>"><%=mid["IP address"]%></a></td>
<td><%=mid.Aliases%></td> <td><%=mid.Aliases%></td>
</tr> </tr>
<% end %> <% end %>

View file

@ -39,7 +39,7 @@ $Id$
%> %>
<tr> <tr>
<td><%=route.Destination%></td> <td><%=route.Destination%></td>
<td><%=route.Gateway%></td> <td><%=route["Gateway IP"]%></td>
<td><%=route.Interface%></td> <td><%=route.Interface%></td>
<td><%=route.Metric%></td> <td><%=route.Metric%></td>
<td style="background-color:<%=color%>"><%=string.format("%.3f", tonumber(route.ETX) or 0)%></td> <td style="background-color:<%=color%>"><%=string.format("%.3f", tonumber(route.ETX) or 0)%></td>

View file

@ -26,11 +26,11 @@ $Id$
<% for k, route in ipairs(routes) do <% for k, route in ipairs(routes) do
%> %>
<tr> <tr>
<td><a href="http://<%=route["Destination IP"]%>"><%=route["Destination IP"]%></a></td> <td><a href="http://<%=route["Dest. IP"]%>"><%=route["Dest. 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>
<td><%=route.LQ%></td> <td><%=route.LQ%></td>
<td><%=route.ILQ%></td> <td><%=route.NLQ%></td>
<td><%=string.format("%.3f", tonumber(route.ETX) or 0)%></td> <td><%=string.format("%.3f", tonumber(route.Cost) or 0)%></td>
</tr> </tr>
<% end %> <% end %>
</table> </table>