updated angular
This commit is contained in:
parent
ab72cab4fe
commit
86564fb26b
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var app = angular.module('netStatsApp', ['lodash', 'angularMoment', 'netStatsApp.filters', 'netStatsApp.directives']);
|
var netStatsApp = angular.module('netStatsApp', ['lodash', 'angularMoment', 'netStatsApp.filters', 'netStatsApp.directives']);
|
||||||
|
|
||||||
app.run(function(amMoment) {
|
netStatsApp.run(function(amMoment) {
|
||||||
amMoment.changeLocale('en-gb');
|
amMoment.changeLocale('en-gb');
|
||||||
});
|
});
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/* Controllers */
|
/* Controllers */
|
||||||
|
|
||||||
function StatsCtrl($scope, $filter, socket, _, toastr) {
|
netStatsApp.controller('StatsCtrl', function($scope, $filter, socket, _, toastr) {
|
||||||
|
|
||||||
// Main Stats init
|
// Main Stats init
|
||||||
// ---------------
|
// ---------------
|
||||||
@ -34,7 +34,7 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
|||||||
|
|
||||||
$scope.latency = 0;
|
$scope.latency = 0;
|
||||||
|
|
||||||
$scope.currentApiVersion = "0.0.6";
|
$scope.currentApiVersion = "0.0.7";
|
||||||
|
|
||||||
$scope.predicate = ['-stats.active', '-stats.block.number', 'stats.block.propagation'];
|
$scope.predicate = ['-stats.active', '-stats.block.number', 'stats.block.propagation'];
|
||||||
$scope.reverse = false;
|
$scope.reverse = false;
|
||||||
@ -52,9 +52,10 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.timeout = setInterval(function(){
|
$scope.timeout = setInterval(function ()
|
||||||
|
{
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}, 1000);
|
}, 200);
|
||||||
|
|
||||||
$scope.getNumber = function(num) {
|
$scope.getNumber = function(num) {
|
||||||
return new Array(num);
|
return new Array(num);
|
||||||
@ -63,8 +64,6 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
|||||||
// Socket listeners
|
// Socket listeners
|
||||||
// ----------------
|
// ----------------
|
||||||
|
|
||||||
socket = new Primus();
|
|
||||||
|
|
||||||
socket.on('open', function open() {
|
socket.on('open', function open() {
|
||||||
socket.emit('ready');
|
socket.emit('ready');
|
||||||
console.log('The connection has been opened.');
|
console.log('The connection has been opened.');
|
||||||
@ -317,4 +316,4 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
|||||||
|
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
}
|
}
|
||||||
}
|
});
|
1
public/js/lib/angular-moment.min.js.map
Normal file
1
public/js/lib/angular-moment.min.js.map
Normal file
File diff suppressed because one or more lines are too long
8
public/js/lib/angular.min.js.map
Normal file
8
public/js/lib/angular.min.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -2,32 +2,12 @@
|
|||||||
|
|
||||||
/* Services */
|
/* Services */
|
||||||
|
|
||||||
app.factory('socket', function ($rootScope) {
|
netStatsApp.factory('socket', function ($rootScope) {
|
||||||
var socket;// = new Primus();
|
var socket = new Primus();
|
||||||
return socket;
|
return socket;
|
||||||
// return {
|
|
||||||
// on: function (eventName, callback) {
|
|
||||||
// socket.on(eventName, function () {
|
|
||||||
// var args = arguments;
|
|
||||||
// $rootScope.$apply(function () {
|
|
||||||
// callback.apply(socket, args);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// emit: function (eventName, data, callback) {
|
|
||||||
// socket.emit(eventName, data, function () {
|
|
||||||
// var args = arguments;
|
|
||||||
// $rootScope.$apply(function () {
|
|
||||||
// if (callback) {
|
|
||||||
// callback.apply(socket, args);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.factory('toastr', function ($rootScope) {
|
netStatsApp.factory('toastr', function ($rootScope) {
|
||||||
toastr = window.toastr;
|
toastr = window.toastr;
|
||||||
toastr.options = {
|
toastr.options = {
|
||||||
"closeButton": false,
|
"closeButton": false,
|
||||||
|
Loading…
Reference in New Issue
Block a user