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: 2px solid white;
border-radius: 10px; border-radius: 10px;
} }
.leaflet-container .node.warn {
background-color: rgba(255, 165, 0, 0.7);
}
.leaflet-container .node.offline { .leaflet-container .node.offline {
background-color: rgba(255,0,0,0.5); background-color: rgba(255,0,0,0.7);
} }
.leaflet-container .node.client24 { .leaflet-container .node.client24 {
border-left: 3px solid green; border-left: 3px solid green;

View File

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

View File

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