applications/luci-olsr: Fixed to work with 0.5.6
[project/luci.git] / applications / luci-olsr / luasrc / view / status-olsr / index.htm
1 <%+header%>
2 <h1><%:olsr_links%></h1>
3 <p><%:olsr_links1%></p>
4 <br />
5 <table cellspacing="0" cellpadding="6">
6 <tr>
7 <th><%:destination%></th>
8 <th><%:local%></th>
9 <th>LQ</th>
10 <th>NLQ</th>
11 <th>ETX</th>
12 </tr>
13 <% for k, link in ipairs(links) do 
14         if link.Linkcost then
15                 link.LinkQuality, link.NLQ, link.ETX = link.Linkcost:match("(.*)/(.*)\t(.*)")
16         end
17         local color = "#bb3333"
18         
19         link.ETX = tonumber(link.ETX)
20         if link.ETX == 0 then
21                 color = "#bb3333"
22         elseif link.ETX < 4 then
23                 color = "#00cc00"
24         elseif link.ETX < 10 then
25                 color = "#ffcb05"
26         elseif link.ETX < 100 then
27                 color = "#ff6600"
28         end
29 %>
30 <tr>
31 <td><a href="http://<%=link["remote IP"]%>"><%=link["remote IP"]%></a></td>
32 <td><%=link["Local IP"]%></td>
33 <td><%=link.LinkQuality%></td>
34 <td><%=link.NLQ%></td>
35 <td style="background-color:<%=color%>"><%=link.ETX%></td>
36 </tr>
37 <% end %>
38 </table>
39 <br />
40 <h3><%:legend%>:</h3>
41 <ul>
42 <li><strong>LQ: </strong><%:olsrlinks_lq1%></li>
43 <li><strong>NLQ: </strong><%:olsrlinks_nlq1%></li>
44 <li><strong>ETX: </strong><%:olsrlinks_etx1%></li>
45 </ul>
46 <%+footer%>