Commit 55eff45f authored by lemoer's avatar lemoer

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

parent 07ebac6a
......@@ -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)';
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment