Skip to content
Snippets Groups Projects
Commit caf2dd03 authored by lemoer's avatar lemoer
Browse files

gluon-status-page: add gateway_nexthop to status page statistics

parent b4101e54
No related branches found
Tags v2023.2.1
No related merge requests found
...@@ -136,6 +136,7 @@ ...@@ -136,6 +136,7 @@
<tr><th><%:RAM%></th><td><%= statistics('memory', 'memory') %></td></tr> <tr><th><%:RAM%></th><td><%= statistics('memory', 'memory') %></td></tr>
<tr><th><%:Filesystem%></th><td><%= statistics('rootfs_usage', 'percent') %></td></tr> <tr><th><%:Filesystem%></th><td><%= statistics('rootfs_usage', 'percent') %></td></tr>
<tr><th><%:Gateway%></th><td><%= statistics('gateway') %></td></tr> <tr><th><%:Gateway%></th><td><%= statistics('gateway') %></td></tr>
<tr><th><%:Gateway Nexthop%></th><td><%= statistics('gateway_nexthop', 'neighbour') %></td></tr>
<tr><th><%:Clients%></th><td><%= statistics('clients/total') %></td></tr> <tr><th><%:Clients%></th><td><%= statistics('clients/total') %></td></tr>
</table> </table>
......
...@@ -55,6 +55,9 @@ msgstr "Weitergeleitet" ...@@ -55,6 +55,9 @@ msgstr "Weitergeleitet"
msgid "Gateway" msgid "Gateway"
msgstr "Gateway" msgstr "Gateway"
msgid "Gateway Nexthop"
msgstr "Gateway Nexthop"
msgid "IP address" msgid "IP address"
msgstr "IP-Adresse" msgstr "IP-Adresse"
......
...@@ -46,6 +46,9 @@ msgstr "" ...@@ -46,6 +46,9 @@ msgstr ""
msgid "Gateway" msgid "Gateway"
msgstr "" msgstr ""
msgid "Gateway Nexthop"
msgstr ""
msgid "IP address" msgid "IP address"
msgstr "" msgstr ""
......
...@@ -112,6 +112,17 @@ ...@@ -112,6 +112,17 @@
'bytes': function(bytes) { 'bytes': function(bytes) {
return prettyBytes(bytes); return prettyBytes(bytes);
}, },
'neighbour': function(addr) {
for (var i in interfaces) {
var iface = interfaces[i];
var neigh = iface.get_neigh(addr);
if (!neigh)
continue;
return neigh.get_hostname() + ' (' + i + ')';
}
return addr + ' (unknown iface)';
}
} }
...@@ -582,6 +593,9 @@ ...@@ -582,6 +593,9 @@
} }
return { return {
'get_hostname': function() {
return hostname.textContent;
},
'update_nodeinfo': function(nodeinfo) { 'update_nodeinfo': function(nodeinfo) {
var addr = choose_address(nodeinfo.network.addresses); var addr = choose_address(nodeinfo.network.addresses);
if (addr) { if (addr) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment