From cdd003bd4c4cf3052e9e4ca85ea3dc40284b8dd7 Mon Sep 17 00:00:00 2001 From: Oliver Gerlich Date: Wed, 3 Jul 2019 12:39:32 +0200 Subject: [PATCH] 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. --- webroot/js/view/map.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/webroot/js/view/map.js b/webroot/js/view/map.js index 8af6ad5..c3eb0db 100644 --- a/webroot/js/view/map.js +++ b/webroot/js/view/map.js @@ -103,8 +103,14 @@ export class MapView extends View { tx5 = node.wireless.txpower5 || '-'; startdate.setMinutes(startdate.getMinutes() - config.node.offline); - if (new Date(node.lastseen) < startdate) { - if (node.pingstate.some((x)=>x)) { + const reachableByRespondd = (new Date(node.lastseen) >= startdate); + const reachableByPing = (node.pingstate.some((x)=>x)); + if (reachableByPing) { + if (!reachableByRespondd) { + className += ' warn'; + } + }else{ + if (reachableByRespondd) { className += ' warn'; }else{ className += ' offline';