commit 4f6198094cf4134179d1f9c9fa8f79759a27c87e
[project/luci.git] / modules / freifunk / luasrc / view / freifunk-olsr / routes.htm
1 <%+header%>
2 <h1><%:olsrlinks OLSR-Routen%></h1>
3 <br />
4 <table cellspacing="0" cellpadding="6">
5 <tr>
6 <th><%:destination Ziel%></th>
7 <th><%:gateway Gateway%></th>
8 <th><%:interface Schnittstelle%></th>
9 <th><%:metric Metrik%></th>
10 <th>ETX</th>
11 </tr>
12 <% for k, route in ipairs(routes) do
13 local color = "#bb3333"
14
15 route.ETX = tonumber(route.ETX)
16 if route.ETX == 0 then
17 color = "#bb3333"
18 elseif route.ETX < 4 then
19 color = "#00cc00"
20 elseif route.ETX < 10 then
21 color = "#ffcb05"
22 elseif route.ETX < 100 then
23 color = "#ff6600"
24 end
25 %>
26 <tr>
27 <td><%=route.Destination%></td>
28 <td><%=route.Gateway%></td>
29 <td><%=route.Interface%></td>
30 <td><%=route.Metric%></td>
31 <td style="background-color:<%=color%>"><%=route.ETX%></td>
32 </tr>
33 <% end %>
34 </table>
35 <br />
36 <%+footer%>