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=e0ec8846a12a358d0b75987e5c7e70a02b5c2ace;hpb=86e1aebb593eb712e45536b730302495948ebdad;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 e0ec8846a..689bafdfa 100644 --- a/applications/luci-olsr/luasrc/view/status-olsr/hna.htm +++ b/applications/luci-olsr/luasrc/view/status-olsr/hna.htm @@ -2,6 +2,7 @@ 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. @@ -9,24 +10,120 @@ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -$Id$ - -%> + +<% +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%> -

<%:olsrd_hna2%>

-

<%:olsrd_hna_desc%>

-
- - - - - -<% for k, route in ipairs(routes) do %> - - - - -<% end %> -
<%:olsrd_network%><%:olsrd_gateway%>
<%=route.Destination%><%=route.Gateway%>
-
+ + + + +

<%: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%>