From 2b9aa3adeff05b417398d315db65e0f3478775d8 Mon Sep 17 00:00:00 2001 From: cubedro Date: Thu, 26 Mar 2015 16:57:04 +0200 Subject: [PATCH] fixed arrival time --- public/js/controllers.js | 1 + public/js/filters.js | 2 +- views/index.jade | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/js/controllers.js b/public/js/controllers.js index 2c048e8..ff10b3a 100644 --- a/public/js/controllers.js +++ b/public/js/controllers.js @@ -69,6 +69,7 @@ function StatsCtrl($scope, $filter, socket, _, toastr) { break; case "update": + data.stats.block.when = (new Date()).getTime() - data.stats.block.arrival; $scope.nodes[findIndex({id: data.id})].stats = data.stats; break; diff --git a/public/js/filters.js b/public/js/filters.js index 46d8683..517444b 100644 --- a/public/js/filters.js +++ b/public/js/filters.js @@ -116,7 +116,7 @@ angular.module('netStatsApp.filters', []) }) .filter('blockPropagationFilter', function() { return function(ms) { - ms = (new Date()).getTime() - ms; + // ms = (new Date()).getTime() - ms; var result = 0; if(ms < 1000) { diff --git a/views/index.jade b/views/index.jade index a28b033..5504a30 100644 --- a/views/index.jade +++ b/views/index.jade @@ -128,5 +128,5 @@ block content //- div.small Difficulty: {{node.stats.block.difficulty | gasFilter}} | Gas used: {{node.stats.block.gasUsed | gasFilter}} | Min gas price: {{node.stats.block.minGasPrice | gasFilter}} | Gas limit: {{node.stats.block.gasLimit | gasFilter}} td(style="padding-left: 18px;") {{node.stats.block.txCount}} td(class="{{ node.stats.block.timestamp | timeClass }}") {{node.stats.block.timestamp | blockTimeFilter }} - td(class="{{ node.stats.block.propagation | propagationTimeClass }}") {{node.stats.block.arrival | blockPropagationFilter}} + td(class="{{ node.stats.block.propagation | propagationTimeClass }}") {{node.stats.block.when | blockPropagationFilter}} td(class="{{ node.stats.uptime | upTimeClass }}") {{ node.stats.uptime | upTimeFilter }}