X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fadmin-full%2Fluasrc%2Fview%2Fadmin_status%2Froutes.htm;h=dcfb4ec62a628aa52862a8fac9b269c64d6c15fc;hp=bfee6227e8daeba9eeeafd4259a4d7701bb07830;hb=b0b28b970fe5efede10dff0f1e379fbab5b333ca;hpb=e080fcebd2396c138d8c916d1cf385a88e0db246 diff --git a/modules/admin-full/luasrc/view/admin_status/routes.htm b/modules/admin-full/luasrc/view/admin_status/routes.htm index bfee6227e..dcfb4ec62 100644 --- a/modules/admin-full/luasrc/view/admin_status/routes.htm +++ b/modules/admin-full/luasrc/view/admin_status/routes.htm @@ -1,7 +1,7 @@ <%# LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich +Copyright 2008-2009 Steven Barth +Copyright 2008-2009 Jo-Philipp Wich Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,31 +12,78 @@ You may obtain a copy of the License at $Id$ -%> + +<%- + require "bit" + require "luci.sys" + require "luci.tools.webadmin" + require "nixio.fs" + + local style = true +-%> + <%+header%> -

<%:routes%>

- -
- - - - - - - - -<% -local routes = luci.sys.net.routes() - -for i, r in pairs(routes) do -%> - - - - - - - -<% end %> -
<%:target%><%:routes_netmask%><%:routes_gateway%><%:routes_metric%><%:interface%>
<%=luci.ip.Hex(r.Destination, 32):string()%><%=luci.ip.Hex(r.Mask, 32):string()%><%=luci.ip.Hex(r.Gateway, 32):string()%><%=r.Metric%><%=r.Iface%>
-
-<%+footer%> \ No newline at end of file + +
+

<%:Routes%>

+
<%:a_n_routes1%>
+ +
+ <%_Active IPv4-Routes%> + +
+ + + + + + + + + <% luci.sys.net.routes(function(rt) %> + + + + + + + + <% style = not style; end) %> +
<%:Network%><%:Target%><%_IPv4-Netmask%><%_IPv4-Gateway%><%:Metric%>
<%=luci.tools.webadmin.iface_get_network(rt.device) or rt.device%><%=rt.dest:network():string()%><%=rt.dest:mask():string()%><%=rt.gateway:string()%><%=rt.metric%>
+
+
+
+ + <% if nixio.fs.access("/proc/net/ipv6_route") then style = true %> +
+ <%_Active IPv6-Routes%> + +
+ + + + + + + + <% luci.sys.net.routes6(function(rt) %> + + + + + + + <% style = not style; end) %> +
<%:Network%><%:Target%><%_IPv6-Gateway%><%:Metric%>
<%=luci.tools.webadmin.iface_get_network(rt.device) or rt.device%><%=rt.dest:string()%><%=rt.source:string()%><%- + local metr = rt.metric + local lower = bit.band(metr, 0xffff) + local higher = bit.rshift(bit.band(metr, 0xffff0000), 16) + write(string.format("%04X%04X", higher, lower)) + -%>
+
+
+
+ <% end %> +
+ +<%+footer%>