gluon-status-page: prettify nextnode when node is offline

This commit is contained in:
lemoer 2019-11-24 02:38:55 +01:00
parent 07ebac6a49
commit 55eff45f96
2 changed files with 6 additions and 3 deletions

View File

@ -135,7 +135,7 @@
<tr><th><%:Load average%></th><td><%= statistics('loadavg', 'decimal') %></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><%:Gateway%></th><td><%= statistics('gateway') %><br />via <%= statistics('gateway_nexthop', 'neighbour') %></td></tr>
<tr><th><%:Gateway%></th><td><%= statistics('gateway') %><br /><%= statistics('gateway_nexthop', 'neighbour') %></td></tr>
<tr><th><%:Clients%></th><td><%= statistics('clients/total') %></td></tr>
</table>

View File

@ -113,15 +113,18 @@
return prettyBytes(bytes);
},
'neighbour': function(addr) {
if (!addr)
return '';
for (var i in interfaces) {
var iface = interfaces[i];
var neigh = iface.get_neigh(addr);
if (!neigh)
continue;
return neigh.get_hostname() + ' (' + i + ')';
return 'via ' + neigh.get_hostname() + ' (' + i + ')';
}
return addr + ' (unknown iface)';
return 'via ' + addr + ' (unknown iface)';
}
}