Added copyright-tags to templates
[project/luci.git] / applications / luci-olsr / luasrc / view / status-olsr / index.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$
13
14 -%>
15 <%+header%>
16 <h1><%:olsr_links%></h1>
17 <p><%:olsr_links1%></p>
18 <br />
19 <table cellspacing="0" cellpadding="6">
20 <tr>
21 <th><%:destination%></th>
22 <th><%:local%></th>
23 <th>LQ</th>
24 <th>NLQ</th>
25 <th>ETX</th>
26 </tr>
27 <% for k, link in ipairs(links) do 
28         if link.Linkcost then
29                 link.LinkQuality, link.NLQ, link.ETX = link.Linkcost:match("(.*)/(.*)\t(.*)")
30         end
31         local color = "#bb3333"
32         
33         link.ETX = tonumber(link.ETX)
34         if link.ETX == 0 then
35                 color = "#bb3333"
36         elseif link.ETX < 4 then
37                 color = "#00cc00"
38         elseif link.ETX < 10 then
39                 color = "#ffcb05"
40         elseif link.ETX < 100 then
41                 color = "#ff6600"
42         end
43 %>
44 <tr>
45 <td><a href="http://<%=link["remote IP"]%>"><%=link["remote IP"]%></a></td>
46 <td><%=link["Local IP"]%></td>
47 <td><%=link.LinkQuality%></td>
48 <td><%=link.NLQ%></td>
49 <td style="background-color:<%=color%>"><%=link.ETX%></td>
50 </tr>
51 <% end %>
52 </table>
53 <br />
54 <h3><%:legend%>:</h3>
55 <ul>
56 <li><strong>LQ: </strong><%:olsrlinks_lq1%></li>
57 <li><strong>NLQ: </strong><%:olsrlinks_nlq1%></li>
58 <li><strong>ETX: </strong><%:olsrlinks_etx1%></li>
59 </ul>
60 <%+footer%>