diff options
-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> |