2 Copyright 2008 Steven Barth <steven@midlink.org>
3 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
4 Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
5 Licensed to the public under the Apache License 2.0.
10 local olsrtools = require "luci.tools.olsr"
14 <h2><a id="content" name="content"><%:Active OLSR nodes%></a></h2>
16 <div id="togglebuttons"></div>
18 <fieldset class="cbi-section">
19 <legend><%:Overview of currently known OLSR nodes%></legend>
20 <table class="cbi-section-table">
21 <tr class="cbi-section-table-titles">
22 <th class="cbi-section-table-cell"><%:OLSR node%></th>
23 <th class="cbi-section-table-cell"><%:Last hop%></th>
24 <th class="cbi-section-table-cell"><%:LQ%></th>
25 <th class="cbi-section-table-cell"><%:NLQ%></th>
26 <th class="cbi-section-table-cell"><%:ETX%></th>
29 <% for k, route in ipairs(routes) do
30 local cost = string.format("%.3f", tonumber(route.tcEdgeCost/1024) or 0)
31 local color = olsrtools.etx_color(tonumber(cost))
32 local lq = string.format("%.3f", tonumber(route.linkQuality) or 0)
33 local nlq = string.format("%.3f", tonumber(route.neighborLinkQuality) or 0)
36 <tr class="cbi-section-table-row cbi-rowstyle-<%=i%> proto-<%=route.proto%>">
38 <% if route.proto == "6" then %>
40 <td class="cbi-section-table-cell"><a href="http://[<%=route.destinationIP%>]/cgi-bin-status.html"><%=route.destinationIP%></a></td>
41 <td class="cbi-section-table-cell"><a href="http://[<%=route.lastHopIP%>]/cgi-bin-status.html"><%=route.lastHopIP%></a></td>
45 <td class="cbi-section-table-cell"><a href="http://<%=route.destinationIP%>/cgi-bin-status.html"><%=route.destinationIP%></a></td>
46 <td class="cbi-section-table-cell"><a href="http://<%=route.lastHopIP%>/cgi-bin-status.html"><%=route.lastHopIP%></a></td>
50 <td class="cbi-section-table-cell"><%=lq%></td>
51 <td class="cbi-section-table-cell"><%=nlq%></td>
52 <td class="cbi-section-table-cell" style="background-color:<%=color%>"><%=cost%></td>
58 <%+status-olsr/legend%>
61 <%+status-olsr/common_js%>