<%# Copyright 2008 Steven Barth Copyright 2008 Jo-Philipp Wich Copyright 2011 Manuel Munz Licensed to the public under the Apache License 2.0. -%> <% local i = 1 if luci.http.formvalue("status") == "1" then local rv = {} for k, hna in ipairs(hna) do rv[#rv+1] = { proto = hna["proto"], destination = hna["destination"], genmask = hna["genmask"], gateway = hna["gateway"], hostname = hna["hostname"], validityTime = hna["validityTime"] } end luci.http.prepare_content("application/json") luci.http.write_json(rv) return end %> <%+header%>

<%:Active host net announcements%>

<%:Overview of currently active OLSR host net announcements%>
<%:Announced network%>
<%:OLSR gateway%>
<%:Validity Time%>
<% for k, route in ipairs(hna) do %>
<%=hna[k].destination%>/<%=hna[k].genmask%>
<% if hna[k].proto == '6' then %> <%=hna[k].gateway%> <% else %> <%=hna[k].gateway%> <% end %> <% if hna[k].hostname then %> / <%=hna[k].hostname%> <% end %>
<% if hna[k].validityTime then validity = hna[k].validityTime .. 's' else validity = '-' end %>
<%=validity%>
<% i = ((i % 2) + 1) end %>
<%+status-olsr/common_js%> <%+footer%>