File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,7 @@ public static void fillPoints(JSONArray points){
3737 obj .put ("lat" ,node .getLatitude ());
3838 obj .put ("lng" ,node .getLongitude ());
3939 obj .put ("type" ,service .getType ());
40- long ttl = (300_000 -(System .currentTimeMillis ()-service .getLastSeen ()));
41- if (ttl <0 ){
42- ttl = 0 ;
43- }
44- obj .put ("ttl" ,ttl /1000 );
40+ obj .put ("notSeenTime" ,System .currentTimeMillis () - service .getLastSeen ());
4541 points .put (obj );
4642 }
4743 }
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ const POINT_COLOR = {
4242 hub : '#FF0000' ,
4343} ;
4444
45+ const POINT_TTL = {
46+ blockchain : 60 ,
47+ } ;
48+
4549const POINT_RADIUS = {
4650 blockchain : 0.125 ,
4751 dht : 0.1 ,
@@ -51,8 +55,9 @@ const POINT_RADIUS = {
5155globe . pointAltitude ( point => POINT_ALTITUDE [ point . type ] ) ;
5256globe . pointColor ( function ( point ) {
5357 var color = POINT_COLOR [ point . type ] ;
54- if ( point . ttl !== undefined ) {
55- color += Math . round ( point . ttl / 300 * 256 ) . toString ( 16 ) . padStart ( 2 , '0' ) ;
58+ var ttl = POINT_TTL [ point . type ] ;
59+ if ( point . notSeenTime !== undefined && ttl !== undefined ) {
60+ color += ( point . notSeenTime / ttl * 255 ) . toString ( 16 ) . padStart ( 2 , '0' ) ;
5661 }
5762 return color ;
5863} ) ;
You can’t perform that action at this time.
0 commit comments