|
|
|
@ -27,12 +27,12 @@ angular.module('netStatsApp.filters', []) |
|
|
|
|
if(node.peers === 0) |
|
|
|
|
return 'text-danger'; |
|
|
|
|
|
|
|
|
|
return (node.peers <= 1 ? 'text-danger' : (node.peers > 1 && node.peers < 4 ? 'text-warning' : 'text-success')); |
|
|
|
|
return timeClass(node.block.timestamp); |
|
|
|
|
}; |
|
|
|
|
}) |
|
|
|
|
.filter('peerClass', function() { |
|
|
|
|
return function(peers) { |
|
|
|
|
return (peers <= 1 ? 'text-danger' : (peers > 1 && peers < 4 ? 'text-warning' : 'text-success')); |
|
|
|
|
return peerClass(peers); |
|
|
|
|
}; |
|
|
|
|
}) |
|
|
|
|
.filter('miningClass', function() { |
|
|
|
@ -52,6 +52,17 @@ angular.module('netStatsApp.filters', []) |
|
|
|
|
}) |
|
|
|
|
.filter('timeClass', function() { |
|
|
|
|
return function(timestamp) { |
|
|
|
|
return timeClass(timestamp); |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
function peerClass(peers) |
|
|
|
|
{ |
|
|
|
|
return (peers <= 1 ? 'text-danger' : (peers > 1 && peers < 4 ? 'text-warning' : 'text-success')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function timeClass(timestamp) |
|
|
|
|
{ |
|
|
|
|
var time = Math.floor((new Date()).getTime() / 1000); |
|
|
|
|
var diff = time - timestamp; |
|
|
|
|
|
|
|
|
@ -65,5 +76,4 @@ angular.module('netStatsApp.filters', []) |
|
|
|
|
return 'text-warning'; |
|
|
|
|
|
|
|
|
|
return 'text-danger'; |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
} |