From 7632de1f4049eaeabb22474b93ad9b0416072da0 Mon Sep 17 00:00:00 2001 From: Marian Oancea Date: Mon, 9 Feb 2015 17:44:44 +0200 Subject: [PATCH] added gas --- public/js/filters.js | 5 +++++ views/index.jade | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/public/js/filters.js b/public/js/filters.js index 3e0881e..cc23bea 100644 --- a/public/js/filters.js +++ b/public/js/filters.js @@ -44,6 +44,11 @@ angular.module('netStatsApp.filters', []) return (best - current <= 1 ? 'text-success' : (best - current > 1 && best - current < 4 ? 'text-warning' : 'text-danger')); }; }) +.filter('gasFilter', function() { + return function(gas) { + return (typeof gas !== 'undefined' ? parseInt(gas) : '?'); + } +}) .filter('timeClass', function() { return function(timestamp) { return timeClass(timestamp); diff --git a/views/index.jade b/views/index.jade index 744cc1c..c4280d5 100644 --- a/views/index.jade +++ b/views/index.jade @@ -85,6 +85,6 @@ block content td(class="{{ node.stats.block.number | blockClass : bestBlock }}") {{'#' + node.stats.block.number}} td(class="{{ node.stats.block.number | blockClass : bestBlock }}").hidden-sm.hidden-xs span.small {{node.stats.block.hash}} - div.small Difficulty: {{node.stats.block.difficulty}} + 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(am-time-ago="node.stats.block.timestamp", am-preprocess="unix", class="{{ node.stats.block.timestamp | timeClass }}") ∞ td(class="{{ node.stats.uptime.total | upTimeClass }}") {{ node.stats.uptime.total | upTimeFilter }}