From 16a1ca641a812a48a40174bead44aad22cfa0b1a Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Wed, 16 Apr 2014 22:15:34 +0200 Subject: [PATCH] [ADDED] Worker totals on Dashboard * Added worker hashrate sum * Added refresh interval information to dashboard footer * Added number formatting to hashrate --- public/templates/bootstrap/dashboard/default.tpl | 2 +- public/templates/bootstrap/dashboard/js/api.tpl | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/public/templates/bootstrap/dashboard/default.tpl b/public/templates/bootstrap/dashboard/default.tpl index 88aa24c9..16bd9cd6 100644 --- a/public/templates/bootstrap/dashboard/default.tpl +++ b/public/templates/bootstrap/dashboard/default.tpl @@ -18,7 +18,7 @@ diff --git a/public/templates/bootstrap/dashboard/js/api.tpl b/public/templates/bootstrap/dashboard/js/api.tpl index 980d3d21..fa8d7253 100644 --- a/public/templates/bootstrap/dashboard/js/api.tpl +++ b/public/templates/bootstrap/dashboard/js/api.tpl @@ -139,14 +139,17 @@ $(document).ready(function(){ function refreshWorkerData(data) { workers = data.getuserworkers.data; length = workers.length; + totalHashrate = 0; $('#b-workers').html(''); for (var i = j = 0; i < length; i++) { if (workers[i].hashrate > 0) { + totalHashrate += workers[i].hashrate; j++; - $('#b-workers').append('' + workers[i].username + '' + workers[i].hashrate + '' + workers[i].difficulty + ''); + $('#b-workers').append('' + workers[i].username + '' + number_format(workers[i].hashrate, 2) + '' + workers[i].difficulty + ''); } } if (j == 0) { $('#b-workers').html('No active workers'); } + if (totalHashrate > 0) { $('#b-workers').append('Total' + number_format(totalHashrate, 2) + ''); } } // Refresh balance information