From 16d049f7cd76f0e309814a2b09cde32ff680d962 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 29 Dec 2019 23:03:58 +0100 Subject: luci-mod-status: reimplement route status page as client side view Signed-off-by: Jo-Philipp Wich --- .../luasrc/view/admin_status/routes.htm | 156 --------------------- 1 file changed, 156 deletions(-) delete mode 100644 modules/luci-mod-status/luasrc/view/admin_status/routes.htm (limited to 'modules/luci-mod-status/luasrc/view') diff --git a/modules/luci-mod-status/luasrc/view/admin_status/routes.htm b/modules/luci-mod-status/luasrc/view/admin_status/routes.htm deleted file mode 100644 index 74779f6ad8..0000000000 --- a/modules/luci-mod-status/luasrc/view/admin_status/routes.htm +++ /dev/null @@ -1,156 +0,0 @@ -<%# - Copyright 2008-2009 Steven Barth - Copyright 2008-2015 Jo-Philipp Wich - Licensed to the public under the Apache License 2.0. --%> - -<%- - require "luci.tools.webadmin" - require "nixio.fs" - - local ip = require "luci.ip" - local style = true - local _, v - - local rtn = { - [255] = "local", - [254] = "main", - [253] = "default", - [0] = "unspec" - } - - if nixio.fs.access("/etc/iproute2/rt_tables") then - local ln - for ln in io.lines("/etc/iproute2/rt_tables") do - local i, n = ln:match("^(%d+)%s+(%S+)") - if i and n then - rtn[tonumber(i)] = n - end - end - end --%> - -<%+header%> - - -
-

<%:Routes%>

-
<%:The following rules are currently active on this system.%>
- -
- ARP -
-
-
-
<%_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 .. ')'%>
-
- <% - style = not style - end - end - %> -
-
-
- -
- <%_Active IPv4-Routes%> -
-
-
-
<%: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 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%>
-
- <% - 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%>
-
- <% - style = not style - end - end - %> -
-
-
- -
- <%:IPv6 Neighbours%> -
-
-
-
<%: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 .. ')'%>
-
- <% - style = not style - end - end - %> -
-
-
- <% end %> -
- -<%+footer%> -- cgit v1.2.3