From bbf096c79eca2e8407d15fe2acfde70c8d08e9c4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 19 Jun 2018 17:17:04 +0200 Subject: luci-mod-admin-full: cleanup markup Globally cleanup template markup to support responsive design changes in OpenWrt theme. Rework handling of dynamic status tables, consolidate hand-written markup, fix small render bugs in various places and annotate tables where needed. Signed-off-by: Jo-Philipp Wich --- .../luasrc/view/admin_status/routes.htm | 113 ++++++++++----------- 1 file changed, 54 insertions(+), 59 deletions(-) (limited to 'modules/luci-mod-admin-full/luasrc/view/admin_status/routes.htm') diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/routes.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/routes.htm index af80371353..9ed37939fe 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_status/routes.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/routes.htm @@ -32,28 +32,30 @@ <%+header%> + +

<%:Routes%>

<%:The following rules are currently active on this system.%>
-
+
ARP
-
-
-
<%_IPv4-Address%>
-
<%_MAC-Address%>
-
<%:Interface%>
+
+
+
<%_IPv4-Address%>
+
<%_MAC-Address%>
+
<%:Interface%>
<% for _, v in ipairs(ip.neighbors({ family = 4 })) do if v.mac then %> -
-
<%=v.dest%>
-
<%=v.mac%>
-
<%=luci.tools.webadmin.iface_get_network(v.dev) or '(' .. v.dev .. ')'%>
+
+
<%=v.dest%>
+
<%=v.mac%>
+
<%=luci.tools.webadmin.iface_get_network(v.dev) or '(' .. v.dev .. ')'%>
<% style = not style @@ -62,61 +64,57 @@ %>
-
-
+
-
+
<%_Active IPv4-Routes%> -
-
-
-
<%:Network%>
-
<%:Target%>
-
<%_IPv4-Gateway%>
-
<%:Metric%>
-
<%:Table%>
+
+
+
<%:Network%>
+
<%:Target%>
+
<%_IPv4-Gateway%>
+
<%:Metric%>
+
<%:Table%>
<% for _, v in ipairs(ip.routes({ family = 4, type = 1 })) do %> -
-
<%=luci.tools.webadmin.iface_get_network(v.dev) or v.dev%>
-
<%=v.dest%>
-
<%=v.gw%>
-
<%=v.metric or 0%>
-
<%=rtn[v.table] or v.table%>
+
+
<%=luci.tools.webadmin.iface_get_network(v.dev) or v.dev%>
+
<%=v.dest%>
+
<%=v.gw or "-"%>
+
<%=v.metric or 0%>
+
<%=rtn[v.table] or v.table%>
<% style = not style end %>
-
-
+ <% if nixio.fs.access("/proc/net/ipv6_route") then style = true %> -
+
<%_Active IPv6-Routes%> -
-
-
-
<%:Network%>
-
<%:Target%>
-
<%:Source%>
-
<%:Metric%>
-
<%:Table%>
+
+
+
<%:Network%>
+
<%:Target%>
+
<%:Source%>
+
<%:Metric%>
+
<%:Table%>
<% for _, v in ipairs(ip.routes({ family = 6, type = 1 })) do if v.dest and not v.dest:is6linklocal() then %> -
-
<%=luci.tools.webadmin.iface_get_network(v.dev) or '(' .. v.dev .. ')'%>
-
<%=v.dest%>
-
<%=v.from%>
-
<%=v.metric or 0%>
-
<%=rtn[v.table] or v.table%>
+
+
<%=luci.tools.webadmin.iface_get_network(v.dev) or '(' .. v.dev .. ')'%>
+
<%=v.dest%>
+
<%=v.from%>
+
<%=v.metric or 0%>
+
<%=rtn[v.table] or v.table%>
<% style = not style @@ -125,27 +123,25 @@ %>
-
-
+ -
+
<%:IPv6 Neighbours%> -
-
-
-
<%:IPv6-Address%>
-
<%:MAC-Address%>
-
<%:Interface%>
+
+
+
<%:IPv6-Address%>
+
<%:MAC-Address%>
+
<%:Interface%>
<% for _, v in ipairs(ip.neighbors({ family = 6 })) do if v.dest and not v.dest:is6linklocal() and v.mac then %> -
-
<%=v.dest%>
-
<%=v.mac%>
-
<%=luci.tools.webadmin.iface_get_network(v.dev) or '(' .. v.dev .. ')'%>
+
+
<%=v.dest%>
+
<%=v.mac%>
+
<%=luci.tools.webadmin.iface_get_network(v.dev) or '(' .. v.dev .. ')'%>
<% style = not style @@ -154,8 +150,7 @@ %>
-
-
+ <% end %> -- cgit v1.2.3