updated angular

pull/5/head
cubedro 10 years ago
parent ab72cab4fe
commit 86564fb26b
  1. 4
      public/js/app.js
  2. 13
      public/js/controllers.js
  3. 1
      public/js/lib/angular-moment.min.js.map
  4. 8
      public/js/lib/angular.min.js.map
  5. 26
      public/js/services.js

@ -1,7 +1,7 @@
'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');
});

@ -2,7 +2,7 @@
/* Controllers */
function StatsCtrl($scope, $filter, socket, _, toastr) {
netStatsApp.controller('StatsCtrl', function($scope, $filter, socket, _, toastr) {
// Main Stats init
// ---------------
@ -34,7 +34,7 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
$scope.latency = 0;
$scope.currentApiVersion = "0.0.6";
$scope.currentApiVersion = "0.0.7";
$scope.predicate = ['-stats.active', '-stats.block.number', 'stats.block.propagation'];
$scope.reverse = false;
@ -52,9 +52,10 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
}
}
$scope.timeout = setInterval(function(){
$scope.timeout = setInterval(function ()
{
$scope.$apply();
}, 1000);
}, 200);
$scope.getNumber = function(num) {
return new Array(num);
@ -63,8 +64,6 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
// Socket listeners
// ----------------
socket = new Primus();
socket.on('open', function open() {
socket.emit('ready');
console.log('The connection has been opened.');
@ -317,4 +316,4 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
$scope.$apply();
}
}
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -2,32 +2,12 @@
/* Services */
app.factory('socket', function ($rootScope) {
var socket;// = new Primus();
netStatsApp.factory('socket', function ($rootScope) {
var socket = new Primus();
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.options = {
"closeButton": false,

Loading…
Cancel
Save