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. 2
      public/js/lib/angular.min.js
  5. 8
      public/js/lib/angular.min.js.map
  6. 26
      public/js/services.js

@ -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();
} }
} });

File diff suppressed because one or more lines are too long

@ -214,4 +214,4 @@ k)l=null;else if(w)for(v=0;v<c.length;v++){if(d[m]=c[v],w(e,d)==k){l=x(e,d);brea
x=t.clone();h=0;for(var B=g.children(),v=B.length;h<v;h++)if(""===B[h].value){w=z=B.eq(h);break}q.init(k,z,x);p&&(k.$isEmpty=function(a){return!a||0===a.length});s?n(e,g,k):p?l(e,g,k):m(e,g,k,q)}}}}],hd=["$interpolate",function(a){var c={addOption:v,removeOption:v};return{restrict:"E",priority:100,compile:function(d,e){if(F(e.value)){var f=a(d.text(),!0);f||e.$set("value",d.text())}return function(a,d,e){var m=d.parent(),l=m.data("$selectController")||m.parent().data("$selectController");l&&l.databound? x=t.clone();h=0;for(var B=g.children(),v=B.length;h<v;h++)if(""===B[h].value){w=z=B.eq(h);break}q.init(k,z,x);p&&(k.$isEmpty=function(a){return!a||0===a.length});s?n(e,g,k):p?l(e,g,k):m(e,g,k,q)}}}}],hd=["$interpolate",function(a){var c={addOption:v,removeOption:v};return{restrict:"E",priority:100,compile:function(d,e){if(F(e.value)){var f=a(d.text(),!0);f||e.$set("value",d.text())}return function(a,d,e){var m=d.parent(),l=m.data("$selectController")||m.parent().data("$selectController");l&&l.databound?
d.prop("selected",!1):l=c;f?a.$watch(f,function(a,c){e.$set("value",a);a!==c&&l.removeOption(c);l.addOption(a)}):l.addOption(e.value);d.on("$destroy",function(){l.removeOption(e.value)})}}}}],gd=aa({restrict:"E",terminal:!0});W.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):((Fa=W.jQuery)&&Fa.fn.on?(A=Fa,E(Fa.fn,{scope:Oa.scope,isolateScope:Oa.isolateScope,controller:Oa.controller,injector:Oa.injector,inheritedData:Oa.inheritedData}),Gb("remove",!0,!0,!1),Gb("empty", d.prop("selected",!1):l=c;f?a.$watch(f,function(a,c){e.$set("value",a);a!==c&&l.removeOption(c);l.addOption(a)}):l.addOption(e.value);d.on("$destroy",function(){l.removeOption(e.value)})}}}}],gd=aa({restrict:"E",terminal:!0});W.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):((Fa=W.jQuery)&&Fa.fn.on?(A=Fa,E(Fa.fn,{scope:Oa.scope,isolateScope:Oa.isolateScope,controller:Oa.controller,injector:Oa.injector,inheritedData:Oa.inheritedData}),Gb("remove",!0,!0,!1),Gb("empty",
!1,!1,!1),Gb("html",!1,!1,!0)):A=S,Xa.element=A,Zc(Xa),A(X).ready(function(){Wc(X,dc)}))})(window,document);!window.angular.$$csp()&&window.angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}.ng-animate-block-transitions{transition:0s all!important;-webkit-transition:0s all!important;}.ng-hide-add-active,.ng-hide-remove{display:block!important;}</style>'); !1,!1,!1),Gb("html",!1,!1,!0)):A=S,Xa.element=A,Zc(Xa),A(X).ready(function(){Wc(X,dc)}))})(window,document);!window.angular.$$csp()&&window.angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}.ng-animate-block-transitions{transition:0s all!important;-webkit-transition:0s all!important;}.ng-hide-add-active,.ng-hide-remove{display:block!important;}</style>');
//# sourceMappingURL=angular.min.js.map //# sourceMappingURL=angular.min.js.map

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…
Cancel
Save