From f5005434c60f5e85746f35a6079add0e2277d13d Mon Sep 17 00:00:00 2001 From: cubedro Date: Tue, 17 Feb 2015 22:45:30 +0200 Subject: [PATCH 1/5] refactoring --- public/js/controllers.js | 10 ++-------- public/js/services.js | 1 + 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/public/js/controllers.js b/public/js/controllers.js index b74d506..c920924 100644 --- a/public/js/controllers.js +++ b/public/js/controllers.js @@ -52,20 +52,14 @@ function StatsCtrl($scope, $filter, socket, _, toastr) { case "init": $scope.nodes = data; - if($scope.nodes.length > 0) - { - toastr['success']("Got nodes list", "Got nodes!"); - } + if($scope.nodes.length > 0) toastr['success']("Got nodes list", "Got nodes!"); break; case "add": if(addNewNode(data)) - { toastr['success']("New node connected!", "New node!"); - } else { + else toastr['info']("Node reconnected!", "Node is back!"); - } - break; case "update": diff --git a/public/js/services.js b/public/js/services.js index dbde145..9c8ba25 100644 --- a/public/js/services.js +++ b/public/js/services.js @@ -32,6 +32,7 @@ app.factory('toastr', function ($rootScope) { toastr.options = { "closeButton": false, "debug": false, + "progressBar": true, "newestOnTop": true, "progressBar": false, "positionClass": "toast-top-right", From e655ca7d6d0fd192c7262c1e43b56cab80f4d6ea Mon Sep 17 00:00:00 2001 From: cubedro Date: Tue, 17 Feb 2015 22:49:10 +0200 Subject: [PATCH 2/5] fixed service error --- public/js/services.js | 1 - 1 file changed, 1 deletion(-) diff --git a/public/js/services.js b/public/js/services.js index 9c8ba25..5d0d272 100644 --- a/public/js/services.js +++ b/public/js/services.js @@ -34,7 +34,6 @@ app.factory('toastr', function ($rootScope) { "debug": false, "progressBar": true, "newestOnTop": true, - "progressBar": false, "positionClass": "toast-top-right", "preventDuplicates": false, "onclick": null, From f6668866dbbeb2e48213ee09a4168234b92275f7 Mon Sep 17 00:00:00 2001 From: cubedro Date: Wed, 18 Feb 2015 01:28:47 +0200 Subject: [PATCH 3/5] updated mainClassFilter --- public/js/filters.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/js/filters.js b/public/js/filters.js index 3a52971..725de41 100644 --- a/public/js/filters.js +++ b/public/js/filters.js @@ -101,7 +101,8 @@ function mainClass(node, bestBlock) if(node.peers === 0) return 'text-danger'; - return timeClass(node.block.timestamp); + // return timeClass(node.block.timestamp); + return peerClass(node.peers); } function peerClass(peers) From 8954adf07585401eb2eca74a5e4c061dd6cbb7b5 Mon Sep 17 00:00:00 2001 From: cubedro Date: Wed, 18 Feb 2015 04:26:30 +0200 Subject: [PATCH 4/5] fixed map marker color --- public/js/controllers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/js/controllers.js b/public/js/controllers.js index c920924..cd4a32b 100644 --- a/public/js/controllers.js +++ b/public/js/controllers.js @@ -122,7 +122,7 @@ function StatsCtrl($scope, $filter, socket, _, toastr) { radius: 3, latitude: node.geo.ll[0], longitude: node.geo.ll[1], - fillKey: $filter('bubbleClass')(node, $scope.bestBlock) + fillKey: $filter('bubbleClass')(node.stats, $scope.bestBlock) }; else return { @@ -131,6 +131,8 @@ function StatsCtrl($scope, $filter, socket, _, toastr) { longitude: 0 }; }); + + console.log($scope.map); } $scope.$apply(); From 71b1f7503a41f461f3775f9e228579c2ae29fa12 Mon Sep 17 00:00:00 2001 From: cubedro Date: Wed, 18 Feb 2015 05:08:17 +0200 Subject: [PATCH 5/5] fixed last block locale bug --- public/js/lib/locale/en-gb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/lib/locale/en-gb.js b/public/js/lib/locale/en-gb.js index 62d3640..fee3f0d 100644 --- a/public/js/lib/locale/en-gb.js +++ b/public/js/lib/locale/en-gb.js @@ -39,7 +39,7 @@ s : 'a few sec', m : 'a min', mm : '%d min', - h : 'an h', + h : '1 h', hh : '%d h', d : 'a day', dd : '%d days',