gluon-status-page: prettify nextnode when node is offline
This commit is contained in:
parent
07ebac6a49
commit
55eff45f96
@ -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>
|
||||
|
||||
|
@ -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)';
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user