From 5963eb5a80f66a0323d7311e70bb834efd0645cd Mon Sep 17 00:00:00 2001 From: cubedro Date: Tue, 28 Apr 2015 12:54:32 +0300 Subject: [PATCH] added hashrate --- public/js/controllers.js | 2 ++ views/index.jade | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/public/js/controllers.js b/public/js/controllers.js index 93da4fa..eb259fe 100644 --- a/public/js/controllers.js +++ b/public/js/controllers.js @@ -14,6 +14,7 @@ function StatsCtrl($scope, $filter, socket, _, toastr) { $scope.lastDifficulty = 0; $scope.upTimeTotal = 0; $scope.avgBlockTime = 0; + $scope.avgHashrate = 0; $scope.uncleCount = 0; $scope.bestStats = {}; @@ -154,6 +155,7 @@ function StatsCtrl($scope, $filter, socket, _, toastr) { case "charts": $scope.lastBlocksTime = data.blocktime; $scope.avgBlockTime = data.avgBlocktime; + $scope.avgHashrate = $scope.lastDifficulty / 1000000 * data.avgBlocktime; $scope.difficultyChart = data.difficulty; $scope.transactionDensity = data.transactions; $scope.gasSpending = data.gasSpending; diff --git a/views/index.jade b/views/index.jade index 4b91260..ec56180 100644 --- a/views/index.jade +++ b/views/index.jade @@ -28,12 +28,12 @@ block content span.big-details {{'#'}}{{ bestBlock | number}} div.clearfix div.col-xs-2.stat-holder - div.big-info.difficulty.text-info + div.big-info.difficulty.text-orange div.pull-left.icon-full-width - i.icon-difficulty + i.icon-hashrate div.pull-left - span.small-title difficulty - span.big-details {{ lastDifficulty | number }} + span.small-title avg hashrate + span.big-details {{ avgHashrate | number : 1 }} MH/s div.clearfix div.col-xs-2.stat-holder div.big-info.uncleCount.text-info