[ADDED] Admin Wallet Info, last N transactions

This commit is contained in:
Sebastian Grewe 2015-04-16 10:21:31 +02:00
parent f428ca1d2e
commit 5b8e7a4dc2
5 changed files with 49 additions and 2 deletions

View File

@ -5,6 +5,8 @@
* Added block count to Wallet Status * Added block count to Wallet Status
* Added number of accounts to Wallet Status * Added number of accounts to Wallet Status
* Added Peer information * Added Peer information
* Added last 25 transactions
* Can be changed via Admin System Settings -> Wallet
* Always show all accounts * Always show all accounts
* Updated Bootstrap to 3.3.4 * Updated Bootstrap to 3.3.4
* Updated MorrisJS to 0.5.1 * Updated MorrisJS to 0.5.1

View File

@ -146,6 +146,13 @@ $aSettings['wallet'][] = array(
'name' => 'wallet_cold_coins', 'value' => $setting->getValue('wallet_cold_coins'), 'name' => 'wallet_cold_coins', 'value' => $setting->getValue('wallet_cold_coins'),
'tooltip' => 'Amount of coins held in a pools cold wallet.' 'tooltip' => 'Amount of coins held in a pools cold wallet.'
); );
$aSettings['wallet'][] = array(
'display' => 'Transaction Limit', 'type' => 'text',
'size' => 6,
'default' => 25,
'name' => 'wallet_transaction_limit', 'value' => $setting->getValue('wallet_transaction_limit'),
'tooltip' => 'Maximum amount of transactions to list in Admin Wallet Info.'
);
$aSettings['statistics'][] = array( $aSettings['statistics'][] = array(
'display' => 'Ajax Refresh Interval', 'type' => 'select', 'display' => 'Ajax Refresh Interval', 'type' => 'select',
'options' => array('5' => '5', '10' => '10', '15' => '15', '30' => '30', '60' => '60' ), 'options' => array('5' => '5', '10' => '10', '15' => '15', '30' => '30', '60' => '60' ),

View File

@ -23,6 +23,7 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$aGetInfo = $bitcoin->getinfo(); $aGetInfo = $bitcoin->getinfo();
$aGetPeerInfo = $bitcoin->getpeerinfo(); $aGetPeerInfo = $bitcoin->getpeerinfo();
$aGetTransactions = $bitcoin->listtransactions('', (int)$setting->getValue('wallet_transaction_limit', 25));
if (is_array($aGetInfo) && array_key_exists('newmint', $aGetInfo)) { if (is_array($aGetInfo) && array_key_exists('newmint', $aGetInfo)) {
$dNewmint = $aGetInfo['newmint']; $dNewmint = $aGetInfo['newmint'];
} else { } else {
@ -34,6 +35,7 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$dAccountAddresses = array(); $dAccountAddresses = array();
$aGetInfo = array('errors' => 'Unable to connect'); $aGetInfo = array('errors' => 'Unable to connect');
$aGetPeerInfo = array(); $aGetPeerInfo = array();
$aGetTransactions = array();
$dBalance = 0; $dBalance = 0;
$dNewmint = -1; $dNewmint = -1;
$_SESSION['POPUP'][] = array('CONTENT' => 'Unable to connect to wallet RPC service: ' . $bitcoin->can_connect(), 'TYPE' => 'alert alert-danger'); $_SESSION['POPUP'][] = array('CONTENT' => 'Unable to connect to wallet RPC service: ' . $bitcoin->can_connect(), 'TYPE' => 'alert alert-danger');
@ -50,6 +52,8 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
// Cold wallet balance // Cold wallet balance
if (! $dColdCoins = $setting->getValue('wallet_cold_coins')) $dColdCoins = 0; if (! $dColdCoins = $setting->getValue('wallet_cold_coins')) $dColdCoins = 0;
// Tempalte specifics
$smarty->assign("UNCONFIRMED", $dBlocksUnconfirmedBalance); $smarty->assign("UNCONFIRMED", $dBlocksUnconfirmedBalance);
$smarty->assign("BALANCE", $dBalance); $smarty->assign("BALANCE", $dBalance);
$smarty->assign("ADDRESSCOUNT", $dAddressCount); $smarty->assign("ADDRESSCOUNT", $dAddressCount);
@ -60,8 +64,8 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$smarty->assign("NEWMINT", $dNewmint); $smarty->assign("NEWMINT", $dNewmint);
$smarty->assign("COININFO", $aGetInfo); $smarty->assign("COININFO", $aGetInfo);
$smarty->assign("PEERINFO", $aGetPeerInfo); $smarty->assign("PEERINFO", $aGetPeerInfo);
$smarty->assign('PRECISION', $coin->getCoinValuePrevision());
// Tempalte specifics $smarty->assign("TRANSACTIONS", $aGetTransactions);
} else { } else {
$debug->append('Using cached page', 3); $debug->append('Using cached page', 3);
} }

View File

@ -2,5 +2,6 @@
{include file="admin/wallet/balance.tpl"} {include file="admin/wallet/balance.tpl"}
{include file="admin/wallet/status.tpl"} {include file="admin/wallet/status.tpl"}
{include file="admin/wallet/peers.tpl"} {include file="admin/wallet/peers.tpl"}
{include file="admin/wallet/transactions.tpl"}
{include file="admin/wallet/accounts.tpl"} {include file="admin/wallet/accounts.tpl"}
</div> </div>

View File

@ -0,0 +1,33 @@
<div class="row">
<div class="col-lg-12">
<div class="panel panel-info">
<div class="panel-heading">
<i class="fa fa-connectdevelop fa-fw"></i> Last {$TRANSACTIONS|count} transactions
</div>
<div class="panel-body no-padding">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>Account</th>
<th class="text-center">Address</th>
<th class="text-center">Category</th>
<th class="text-right">Amount</th>
<th class="text-right">Confirmations</th>
<th class="text-right">Time</th>
</tr>
</thead>
<tbody>
{foreach key=KEY item=ARRAY from=$TRANSACTIONS}
<tr>
<td>{$ARRAY['account']|default:"Default"}</td>
<td class="text-center">{$ARRAY['address']}</td>
<td class="text-center">{$ARRAY['category']|capitalize}</td>
<td class="text-right">{$ARRAY['amount']|number_format:"$PRECISION"}</td>
<td class="text-right">{$ARRAY['confirmations']}</td>
<td class="text-right">{$ARRAY['time']|date_format:$GLOBAL.config.date}
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>