2
0

topology.htm 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <%#
  2. Copyright 2008 Steven Barth <steven@midlink.org>
  3. Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
  4. Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
  5. Licensed to the public under the Apache License 2.0.
  6. -%>
  7. <%
  8. local i = 1
  9. local olsrtools = require "luci.tools.olsr"
  10. %>
  11. <%+header%>
  12. <h2 name="content"><%:Active OLSR nodes%></h2>
  13. <div id="togglebuttons"></div>
  14. <fieldset class="cbi-section">
  15. <legend><%:Overview of currently known OLSR nodes%></legend>
  16. <div class="table cbi-section-table">
  17. <div class="tr cbi-section-table-titles">
  18. <div class="th cbi-section-table-cell"><%:OLSR node%></div>
  19. <div class="th cbi-section-table-cell"><%:Last hop%></div>
  20. <div class="th cbi-section-table-cell"><%:LQ%></div>
  21. <div class="th cbi-section-table-cell"><%:NLQ%></div>
  22. <div class="th cbi-section-table-cell"><%:ETX%></div>
  23. </div>
  24. <% for k, route in ipairs(routes) do
  25. local cost = string.format("%.3f", tonumber(route.tcEdgeCost) or 0)
  26. local color = olsrtools.etx_color(tonumber(cost))
  27. local lq = string.format("%.3f", tonumber(route.linkQuality) or 0)
  28. local nlq = string.format("%.3f", tonumber(route.neighborLinkQuality) or 0)
  29. %>
  30. <div class="tr cbi-section-table-row cbi-rowstyle-<%=i%> proto-<%=route.proto%>">
  31. <% if route.proto == "6" then %>
  32. <div class="td cbi-section-table-cell left"><a href="http://[<%=route.destinationIP%>]/cgi-bin-status.html"><%=route.destinationIP%></a></div>
  33. <div class="td cbi-section-table-cell left"><a href="http://[<%=route.lastHopIP%>]/cgi-bin-status.html"><%=route.lastHopIP%></a></div>
  34. <% else %>
  35. <div class="td cbi-section-table-cell left"><a href="http://<%=route.destinationIP%>/cgi-bin-status.html"><%=route.destinationIP%></a></div>
  36. <div class="td cbi-section-table-cell left"><a href="http://<%=route.lastHopIP%>/cgi-bin-status.html"><%=route.lastHopIP%></a></div>
  37. <%end%>
  38. <div class="td cbi-section-table-cell left"><%=lq%></div>
  39. <div class="td cbi-section-table-cell left"><%=nlq%></div>
  40. <div class="td cbi-section-table-cell left" style="background-color:<%=color%>"><%=cost%></div>
  41. </div>
  42. <% i = ((i % 2) + 1)
  43. end %>
  44. </div>
  45. <%+status-olsr/legend%>
  46. </fieldset>
  47. <%+status-olsr/common_js%>
  48. <%+footer%>