diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2018-03-06 13:28:02 +0100 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2018-03-06 13:28:02 +0100 |
commit | b11317b551f08ba520e6a2c292b08a8d7dbe67f4 (patch) | |
tree | 87a92448ac2438f3c37aee38f4737da22ecff3e4 | |
parent | 3d46f2593a821960f896e109e1d6f89c481d6004 (diff) |
luci-mod-admin-full: add protocol column to active routes tablesroutes-proto-old
-rw-r--r-- | modules/luci-mod-admin-full/luasrc/view/admin_status/routes.htm | 20 |
1 files changed, 17 insertions, 3 deletions
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 5f2c07493..12e580656 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 @@ -18,16 +18,26 @@ [253] = "default", [0] = "unspec" } + local rpn = { + [0] = "unspec", + } + - if nixio.fs.access("/etc/iproute2/rt_tables") then + local function read_rt_info(file, tbl) local ln - for ln in io.lines("/etc/iproute2/rt_tables") do + if not nixio.fs.access(file) then + return + end + for ln in io.lines(file) do local i, n = ln:match("^(%d+)%s+(%S+)") if i and n then - rtn[tonumber(i)] = n + tbl[tonumber(i)] = n end end end + + read_rt_info("/etc/iproute2/rt_tables", rtn) + read_rt_info("/etc/iproute2/rt_protos", rpn) -%> <%+header%> @@ -74,6 +84,7 @@ <th class="cbi-section-table-cell"><%:Network%></th> <th class="cbi-section-table-cell"><%:Target%></th> <th class="cbi-section-table-cell"><%_<abbr title="Internet Protocol Version 4">IPv4</abbr>-Gateway%></th> + <th class="cbi-section-table-cell"><%:Proto%></th> <th class="cbi-section-table-cell"><%:Metric%></th> <th class="cbi-section-table-cell"><%:Table%></th> </tr> @@ -82,6 +93,7 @@ <td class="cbi-value-field"><%=luci.tools.webadmin.iface_get_network(v.dev) or v.dev%></td> <td class="cbi-value-field"><%=v.dest%></td> <td class="cbi-value-field"><%=v.gw%></td> + <td class="cbi-value-field"><%=rpn[v.proto] or v.proto%></td> <td class="cbi-value-field"><%=v.metric or 0%></td> <td class="cbi-value-field"><%=rtn[v.table] or v.table%></td> </tr> @@ -104,6 +116,7 @@ <th class="cbi-section-table-cell"><%:Network%></th> <th class="cbi-section-table-cell"><%:Target%></th> <th class="cbi-section-table-cell"><%:Source%></th> + <th class="cbi-section-table-cell"><%:Proto%></th> <th class="cbi-section-table-cell"><%:Metric%></th> <th class="cbi-section-table-cell"><%:Table%></th> </tr> @@ -115,6 +128,7 @@ <td class="cbi-value-field"><%=luci.tools.webadmin.iface_get_network(v.dev) or '(' .. v.dev .. ')'%></td> <td class="cbi-value-field"><%=v.dest%></td> <td class="cbi-value-field"><%=v.from%></td> + <td class="cbi-value-field"><%=rpn[v.proto] or v.proto%></td> <td class="cbi-value-field"><%=v.metric or 0%></td> <td class="cbi-value-field"><%=rtn[v.table] or v.table%></td> </tr> |