<%# LuCI - Lua Configuration Interface Copyright 2008 Steven Barth Copyright 2008 Jo-Philipp Wich Copyright 2011 Manuel Munz Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -%> <% local olsrtools = require "luci.tools.olsr" local i = 1 if luci.http.formvalue("status") == "1" then local rv = {} for k, link in ipairs(links) do link.Cost = tonumber(link.Cost) or 0 local color = olsrtools.etx_color(link.Cost) defaultgw_color = "" if link.defaultgw == 1 then defaultgw_color = "#ffff99" end rv[#rv+1] = { rip = link["Remote IP"], hn = link["Hostname"], lip = link["Local IP"], dev = link["Local Device"], lq = link.LQ, nlq = link.NLQ, cost = string.format("%.3f", link.Cost), color = color, dfgcolor = defaultgw_color } end luci.http.prepare_content("application/json") luci.http.write_json(rv) return end %> <%+header%>

<%:OLSR connections%>

<%:Overview of currently established OLSR connections%> <% local i = 1 for k, link in ipairs(links) do link.Cost = tonumber(link.Cost) or 0 color = olsrtools.etx_color(link.Cost) defaultgw_color = "" if link.defaultgw == 1 then defaultgw_color = "#ffff99" end %> <% i = ((i % 2) + 1) end %>
<%:Neighbour IP%> <%:Hostname%> <%:Local interface IP%> <%:Device%> LQ NLQ ETX
/cgi-bin-status.html"><%=link["Remote IP"]%> /cgi-bin-status.html"><%=link["Hostname"]%> <%=link["Local IP"]%> <%=link["Local Device"]%> <%=link.LQ%> <%=link.NLQ%> <%=string.format("%.3f", link.Cost)%>

<%:Legend%>:

  • LQ: <%:Success rate of packages received from the neighbour%>
  • NLQ: <%:Success rate of packages sent to the neighbour%>
  • ETX: <%:Expected retransmission count%>
<%+footer%>