map: display node as "offline" only if both ping and respondd replies are missing

If node is reachable both by ping and respondd, node is now displayed as up.
If one of ping or respondd is down, node is displayed in "warning" state.
This commit is contained in:
Oliver Gerlich 2019-07-03 12:39:32 +02:00 committed by genofire
parent f3bb60dd38
commit cdd003bd4c
1 changed files with 8 additions and 2 deletions

View File

@ -103,8 +103,14 @@ export class MapView extends View {
tx5 = node.wireless.txpower5 || '-'; tx5 = node.wireless.txpower5 || '-';
startdate.setMinutes(startdate.getMinutes() - config.node.offline); startdate.setMinutes(startdate.getMinutes() - config.node.offline);
if (new Date(node.lastseen) < startdate) { const reachableByRespondd = (new Date(node.lastseen) >= startdate);
if (node.pingstate.some((x)=>x)) { const reachableByPing = (node.pingstate.some((x)=>x));
if (reachableByPing) {
if (!reachableByRespondd) {
className += ' warn';
}
}else{
if (reachableByRespondd) {
className += ' warn'; className += ' warn';
}else{ }else{
className += ' offline'; className += ' offline';