X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=applications%2Fluci-olsr%2Fluasrc%2Fview%2Fstatus-olsr%2Fhna.htm;h=689bafdfae373576d0d7b87b0caa7d8010f5fd62;hb=9edd0e46c3f880727738ce8ca6ff1c8b85f99ef4;hp=38430fcf86350f4577391446256f091f670c3d45;hpb=211c6394a0d145d3215893b827241723bb358a13;p=oweals%2Fluci.git diff --git a/applications/luci-olsr/luasrc/view/status-olsr/hna.htm b/applications/luci-olsr/luasrc/view/status-olsr/hna.htm index 38430fcf8..689bafdfa 100644 --- a/applications/luci-olsr/luasrc/view/status-olsr/hna.htm +++ b/applications/luci-olsr/luasrc/view/status-olsr/hna.htm @@ -1,17 +1,129 @@ +<%# +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 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%> -

<%:olsrhna%>

-
- - - - - -<% for k, route in ipairs(routes) do %> - - - - -<% end %> -
<%:destination%><%:gateway%>
<%=route.Network%>/<%=route.Netmask%><%=route.Gateway%>
-
-<%+footer%> \ No newline at end of file + + + + +

<%:Active host net announcements%>

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