From 6940edbdce86a6fec722b93875bf46d14b00c475 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 10 Jul 2009 19:11:37 +0000 Subject: modules/admin-full: speedup route status page by reimplementing it as template --- .../admin-full/luasrc/view/admin_status/routes.htm | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 modules/admin-full/luasrc/view/admin_status/routes.htm (limited to 'modules/admin-full/luasrc/view') diff --git a/modules/admin-full/luasrc/view/admin_status/routes.htm b/modules/admin-full/luasrc/view/admin_status/routes.htm new file mode 100644 index 000000000..7bde82b17 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_status/routes.htm @@ -0,0 +1,89 @@ +<%# +LuCI - Lua Configuration Interface +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. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +-%> + +<%- + require "bit" + require "luci.fs" + require "luci.sys" + require "luci.tools.webadmin" + + local style = true +-%> + +<%+header%> + +
+

<%:a_n_routes%>

+
<%:a_n_routes1%>
+ +
+ <%:a_n_routes_kernel4%> + +
+ + + + + + + + + <% luci.sys.net.routes(function(rt) %> + + + + + + + + <% style = not style; end) %> +
<%:network%><%:target%><%:netmask%><%: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 luci.fs.access("/proc/net/ipv6_route") then style = true %> +
+ <%:a_n_routes_kernel6%> + +
+ + + + + + + + <% luci.sys.net.routes6(function(rt) %> + + + + + + + <% style = not style; end) %> +
<%:network%><%:target%><%:gateway6%><%: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%> -- cgit v1.2.3