From 5626c2b5bd9193e5d8ca63125c577a6d6ef14ad4 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Tue, 4 Mar 2014 18:11:58 +0100 Subject: [PATCH] [ADDED] Accont balance updates --- .../bootstrap/dashboard/account_data.tpl | 94 ++++++++++--------- .../templates/bootstrap/dashboard/js_api.tpl | 25 ++++- 2 files changed, 72 insertions(+), 47 deletions(-) diff --git a/public/templates/bootstrap/dashboard/account_data.tpl b/public/templates/bootstrap/dashboard/account_data.tpl index c9d01c25..ce32871a 100644 --- a/public/templates/bootstrap/dashboard/account_data.tpl +++ b/public/templates/bootstrap/dashboard/account_data.tpl @@ -4,52 +4,54 @@

Account Information

- - - - -
- {if $GLOBAL.userdata.no_fees} - You are mining without any pool fees applied and - {else if $GLOBAL.fees > 0} - You are mining at {if $GLOBAL.fees < 0.0001}{$GLOBAL.fees|escape|number_format:"8"}{else}{$GLOBAL.fees|escape}{/if}% pool fee and - {else} - This pool does not apply fees and - {/if} - {if $GLOBAL.userdata.donate_percent > 0} - you donate {$GLOBAL.userdata.donate_percent|escape}%. - {else} - you are not donating. - {/if} -
- - - - - - - - - - - - -
{$GLOBAL.config.currency} Account Balance
Confirmed{$GLOBAL.userdata.balance.confirmed|number_format:"6"}
Unconfirmed{$GLOBAL.userdata.balance.unconfirmed|number_format:"6"}
- {if !$DISABLED_DASHBOARD and !$DISABLED_DASHBOARD_API} - - - - - - - - - - - - -
WorkerHashrateDifficulty
No worker information available
- {/if} + + + + +
+ {if $GLOBAL.userdata.no_fees} + You are mining without any pool fees applied and + {else if $GLOBAL.fees > 0} + You are mining at {if $GLOBAL.fees < 0.0001}{$GLOBAL.fees|escape|number_format:"8"}{else}{$GLOBAL.fees|escape}{/if}% pool fee and + {else} + This pool does not apply fees and + {/if} + {if $GLOBAL.userdata.donate_percent > 0} + you donate {$GLOBAL.userdata.donate_percent|escape}%. + {else} + you are not donating. + {/if} +
+ + + + + + + + + + + + +
{$GLOBAL.config.currency} Account Balance
Confirmed{$GLOBAL.userdata.balance.confirmed|number_format:"6"} +
Unconfirmed{$GLOBAL.userdata.balance.unconfirmed|number_format:"6"} +
+ {if !$DISABLED_DASHBOARD and !$DISABLED_DASHBOARD_API} + + + + + + + + + + + + +
WorkerHashrateDifficulty
No worker information available
+ {/if}
diff --git a/public/templates/bootstrap/dashboard/js_api.tpl b/public/templates/bootstrap/dashboard/js_api.tpl index 53d22b90..de6eb036 100644 --- a/public/templates/bootstrap/dashboard/js_api.tpl +++ b/public/templates/bootstrap/dashboard/js_api.tpl @@ -113,7 +113,14 @@ $(document).ready(function(){ if (j == 0) { $('#b-workers').html('No active workers'); } } - // Our worker process to keep gauges and graph updated + // Refresh balance information + function refreshBalanceData(data) { + balance = data.getuserbalance.data + $('#b-confirmed').html(number_format(balance.confirmed, 6)); + $('#b-unconfirmed').html(number_format(balance.unconfirmed, 6)); + } + + // Worker progess for overview graphs (function worker1() { $.ajax({ url: url_dashboard, @@ -131,6 +138,7 @@ $(document).ready(function(){ }); })(); + // Worker process to update active workers in the account details table (function worker2() { $.ajax({ url: url_worker, @@ -146,6 +154,21 @@ $(document).ready(function(){ } }); })(); + + // Worker process to update user account balances + // Our worker process to keep worker information updated + (function worker3() { + $.ajax({ + url: url_balance, + dataType: 'json', + success: function(data) { + refreshBalanceData(data); + }, + complete: function() { + setTimeout(worker3, {/literal}{($GLOBAL.config.statistics_ajax_long_refresh_interval * 1000)|default:"10000"}{literal}) + } + }); + })(); }); {/literal}