From 73db2cf7c50127ccdd69447abdd2baadcc9ca876 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Tue, 4 Mar 2014 17:59:46 +0100 Subject: [PATCH] [ADDED] Worker information --- .../bootstrap/dashboard/account_data.tpl | 6 ++-- .../templates/bootstrap/dashboard/js_api.tpl | 31 +++++++++++++++++++ .../bootstrap/dashboard/overview.tpl | 2 +- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/public/templates/bootstrap/dashboard/account_data.tpl b/public/templates/bootstrap/dashboard/account_data.tpl index fa29fd18..c9d01c25 100644 --- a/public/templates/bootstrap/dashboard/account_data.tpl +++ b/public/templates/bootstrap/dashboard/account_data.tpl @@ -36,16 +36,16 @@ {if !$DISABLED_DASHBOARD and !$DISABLED_DASHBOARD_API} - +
- + - +
Worker HashrateDifficultyDifficulty
No worker information availableNo worker information available
diff --git a/public/templates/bootstrap/dashboard/js_api.tpl b/public/templates/bootstrap/dashboard/js_api.tpl index c74df43f..53d22b90 100644 --- a/public/templates/bootstrap/dashboard/js_api.tpl +++ b/public/templates/bootstrap/dashboard/js_api.tpl @@ -65,6 +65,7 @@ $(document).ready(function(){ $('#b-poolworkers').html(data.getdashboarddata.data.pool.workers); $('#b-hashrate').html((parseFloat(data.getdashboarddata.data.personal.hashrate).toFixed(2))); $('#b-poolhashrate').html((parseFloat(data.getdashboarddata.data.pool.hashrate).toFixed(2))); + $('#b-nethashrate').html((parseFloat(data.getdashboarddata.data.network.hashrate).toFixed(2))); $('#b-sharerate').html((parseFloat(data.getdashboarddata.data.personal.sharerate).toFixed(2))); $('#b-yvalid').html(number_format(data.getdashboarddata.data.personal.shares.valid)); $('#b-yivalid').html(number_format(data.getdashboarddata.data.personal.shares.invalid)); @@ -98,6 +99,20 @@ $(document).ready(function(){ {/literal}{/if}{literal} } + // Refresh worker information + function refreshWorkerData(data) { + workers = data.getuserworkers.data; + length = workers.length; + $('#b-workers').html(''); + for (var i = j = 0; i < length; i++) { + if (workers[i].hashrate > 0) { + j++; + $('#b-workers').append('' + workers[i].username + '' + workers[i].hashrate + '' + workers[i].difficulty + ''); + } + } + if (j == 0) { $('#b-workers').html('No active workers'); } + } + // Our worker process to keep gauges and graph updated (function worker1() { $.ajax({ @@ -115,6 +130,22 @@ $(document).ready(function(){ } }); })(); + + (function worker2() { + $.ajax({ + url: url_worker, + dataType: 'json', + cache : false, + contentType : 'application/json; charset=utf-8', + type : 'GET', + success: function(data) { + refreshWorkerData(data); + }, + complete: function() { + setTimeout(worker2, {/literal}{($GLOBAL.config.statistics_ajax_long_refresh_interval * 1000)|default:"10000"}{literal}) + } + }); + })(); }); {/literal} diff --git a/public/templates/bootstrap/dashboard/overview.tpl b/public/templates/bootstrap/dashboard/overview.tpl index e11a24be..de095407 100644 --- a/public/templates/bootstrap/dashboard/overview.tpl +++ b/public/templates/bootstrap/dashboard/overview.tpl @@ -29,7 +29,7 @@
  • Pool Workers -

    {$GLOBAL.workers}

    +

    {$GLOBAL.workers}