applications/luci-olsr: Make the default gateway yellow in neigbors overview, thanks...
[project/luci.git] / applications / luci-olsr / luasrc / view / status-olsr / neighbors.htm
1 <%#
2 LuCI - Lua Configuration Interface
3 Copyright 2008 Steven Barth <steven@midlink.org>
4 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id: index.htm 6619 2010-12-05 15:02:44Z soma $
13
14 -%>
15 <%+header%>
16 <h2><a id="content" name="content"><%:OLSR connections%></a></h2>
17 <p><%:Overview of currently established OLSR connections%></p>
18 <br />
19 <table class="smalltext" cellspacing="0" cellpadding="6">
20 <tr>
21 <th><%:Neighbour IP%></th>
22 <th><%:Hostname%></th>
23 <th><%:Local interface IP%></th>
24 <th><%:Device%></th>
25 <th>LQ</th>
26 <th>NLQ</th>
27 <th>ETX</th>
28 </tr>
29 <% for k, link in ipairs(links) do
30         local color = "#bb3333"
31
32         link.Cost = tonumber(link.Cost) or 0
33         if link.Cost == 0 then
34                 color = "#bb3333"
35         elseif link.Cost < 4 then
36                 color = "#00cc00"
37         elseif link.Cost < 10 then
38                 color = "#ffcb05"
39         elseif link.Cost < 100 then
40                 color = "#ff6600"
41         end
42
43         defaultgw_color = ""
44         if link.defaultgw == 1 then
45                 defaultgw_color = "#ffff99"
46         end
47 %>
48 <tr>
49 <td style="background-color:<%=defaultgw_color%>"><a href="http://<%=link["Remote IP"]%>/cgi-bin-status.html"><%=link["Remote IP"]%></a></td>
50 <td style="background-color:<%=defaultgw_color%>"><a href="http://<%=link["Hostname"]%>/cgi-bin-status.html"><%=link["Hostname"]%></a></td>
51 <td style="background-color:<%=defaultgw_color%>"><%=link["Local IP"]%></td>
52 <td style="background-color:<%=defaultgw_color%>"><%=link["Local Device"]%></td>
53 <td style="background-color:<%=defaultgw_color%>"><%=link.LQ%></td>
54 <td style="background-color:<%=defaultgw_color%>"><%=link.NLQ%></td>
55 <td style="background-color:<%=color%>"><%=string.format("%.3f", link.Cost)%></td>
56 </tr>
57 <% end %>
58 </table>
59 <br />
60 <h3><%:Legend%>:</h3>
61 <ul>
62 <li><strong>LQ: </strong><%:Success rate of packages received from the neighbour%></li>
63 <li><strong>NLQ: </strong><%:Success rate of packages sent to the neighbour%></li>
64 <li><strong>ETX: </strong><%:Expected retransmission count%></li>
65 </ul>
66 <%+footer%>