Merge pull request #14 from cubedro/develop

Refactoring and bug fixes
This commit is contained in:
Marian OANCΞA 2015-02-18 05:16:39 +02:00
commit d621ceed5c
4 changed files with 9 additions and 12 deletions

View File

@ -52,20 +52,14 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
case "init": case "init":
$scope.nodes = data; $scope.nodes = data;
if($scope.nodes.length > 0) if($scope.nodes.length > 0) toastr['success']("Got nodes list", "Got nodes!");
{
toastr['success']("Got nodes list", "Got nodes!");
}
break; break;
case "add": case "add":
if(addNewNode(data)) if(addNewNode(data))
{
toastr['success']("New node connected!", "New node!"); toastr['success']("New node connected!", "New node!");
} else { else
toastr['info']("Node reconnected!", "Node is back!"); toastr['info']("Node reconnected!", "Node is back!");
}
break; break;
case "update": case "update":
@ -128,7 +122,7 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
radius: 3, radius: 3,
latitude: node.geo.ll[0], latitude: node.geo.ll[0],
longitude: node.geo.ll[1], longitude: node.geo.ll[1],
fillKey: $filter('bubbleClass')(node, $scope.bestBlock) fillKey: $filter('bubbleClass')(node.stats, $scope.bestBlock)
}; };
else else
return { return {
@ -137,6 +131,8 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
longitude: 0 longitude: 0
}; };
}); });
console.log($scope.map);
} }
$scope.$apply(); $scope.$apply();

View File

@ -101,7 +101,8 @@ function mainClass(node, bestBlock)
if(node.peers === 0) if(node.peers === 0)
return 'text-danger'; return 'text-danger';
return timeClass(node.block.timestamp); // return timeClass(node.block.timestamp);
return peerClass(node.peers);
} }
function peerClass(peers) function peerClass(peers)

View File

@ -39,7 +39,7 @@
s : 'a few sec', s : 'a few sec',
m : 'a min', m : 'a min',
mm : '%d min', mm : '%d min',
h : 'an h', h : '1 h',
hh : '%d h', hh : '%d h',
d : 'a day', d : 'a day',
dd : '%d days', dd : '%d days',

View File

@ -32,8 +32,8 @@ app.factory('toastr', function ($rootScope) {
toastr.options = { toastr.options = {
"closeButton": false, "closeButton": false,
"debug": false, "debug": false,
"progressBar": true,
"newestOnTop": true, "newestOnTop": true,
"progressBar": false,
"positionClass": "toast-top-right", "positionClass": "toast-top-right",
"preventDuplicates": false, "preventDuplicates": false,
"onclick": null, "onclick": null,