show ping status in map by node color

This commit is contained in:
Martin/Geno 2019-06-05 16:23:53 +02:00 committed by genofire
parent 0db00ad76e
commit 83319163d7
3 changed files with 10 additions and 3 deletions

View File

@ -5,8 +5,11 @@
border: 2px solid white;
border-radius: 10px;
}
.leaflet-container .node.warn {
background-color: rgba(255, 165, 0, 0.7);
}
.leaflet-container .node.offline {
background-color: rgba(255,0,0,0.5);
background-color: rgba(255,0,0,0.7);
}
.leaflet-container .node.client24 {
border-left: 3px solid green;

View File

@ -1,7 +1,7 @@
import config from './config';
const list = {},
storeMaxPing = 5,
storeMaxPing = 5;
// Returns the node with specified id (or null if node doesn't exist).
export function getNode (nodeid) {

View File

@ -104,7 +104,11 @@ export class MapView extends View {
startdate.setMinutes(startdate.getMinutes() - config.node.offline);
if (new Date(node.lastseen) < startdate) {
className += ' offline';
if (node.pingstate.some((x)=>x)) {
className += ' warn';
}else{
className += ' offline';
}
}