var guiMap = {}; (function(){ var view = guiMap; var container, el; var nodeLayer, clientLayer24, clientLayer5;//, draggingNodeID; function addNode (node){ /* https://github.com/Leaflet/Leaflet/issues/4484 if(node.node_id === draggingNodeID){ return } */ if(node.location === undefined || node.location.latitude === undefined || node.location.longitude === undefined) { return; } var className = 'node'; var startdate = new Date(); startdate.setMinutes(startdate.getMinutes() - 1); if(new Date(node.lastseen) < startdate) { className += ' offline'; } var wifi24='-',wifi5='-',ch24='-',ch5='-',tx24='-',tx5='-'; if(node.statistics && node.statistics.clients){ wifi24 = node.statistics.clients.wifi24; if(wifi24 < config.map.icon.warn.wifi24 && wifi24 > 0){ className += ' client24'; } else if(wifi24 < config.map.icon.crit.wifi24 && wifi24 >= config.map.icon.warn.wifi24){ className += ' client24-warn'; } else if(wifi24 >= config.map.icon.crit.wifi24){ className += ' client24-crit'; } wifi5 = node.statistics.clients.wifi5; if(config.map.icon.warn.wifi5 < 20 && wifi5 > 0){ className += ' client5'; } else if(wifi5 < config.map.icon.crit.wifi5 && wifi5 >= config.map.icon.warn.wifi5){ className += ' client5-warn'; } else if(wifi5 >= config.map.icon.crit.wifi5){ className += ' client5-crit'; } } var nodemarker = L.marker([node.location.latitude, node.location.longitude], { icon: L.divIcon({className: className}), draggable: true }); nodemarker.bindTooltip(node.hostname+'
Cl | Ch | Tx | |
---|---|---|---|
2.4G | '+wifi24+' | '+ch24+' | '+tx24+' |
5G | '+wifi5+' | '+ch5+' | '+tx5+' |