more tx details added

pull/39/head
moneroexamples 7 years ago
parent 367bb72ec0
commit ce3bc9d29a

@ -25,15 +25,33 @@ thinwalletCtrls.controller('TransactionDetailsCtrl', function ($scope,
return;
}
$scope.tx_hash = tx_hash;
// check the tx_hash if it has expected format
if (tx_hash.length !== 64 || !(/^[0-9a-fA-F]{64}$/.test(tx_hash)))
{
$scope.error = "Tx hash has incorrect format";
return;
}
// tx_hash seems ok, so ask the backed for its details.
ApiCalls.get_tx(tx_hash)
.then(function(response) {
var data = response.data;
console.log(data);
$scope.ring_size = data.mixin_no;
$scope.fee = data.fee;
if (data.error) {
$scope.error = data.status;
return;
}
// set data to be shown in the modal window
$scope.ring_size = data.mixin_no;
$scope.fee = data.fee;
$scope.tx_size = Math.round(data.size*1e3) / 1e3;
$scope.no_confirmations = no_confirmations;
$scope.tx_height = tx_height;
$scope.tx_pub_key = pub_key;
}, function(data) {
$scope.error = 'Failed to get tx detailed from the backend';

@ -8,18 +8,22 @@
<div class="subhead-text modal review" style="margin-bottom: 10px">{{ tx_hash }}</div>
<div class="w-form form-wrapper">
<div class="w-row">
<div class="w-col w-col-4 responsive-column">
<div class="w-col w-col-3 responsive-column">
<label class="field-label review" for="Amount">Amount</label>
<div class="review-text">{{transferConfirmDialog.amount | money}} (+{{transferConfirmDialog.fee | money}} fee)</div>
</div>
<div class="w-col w-col-4 responsive-column">
<div class="w-col w-col-3 responsive-column">
<label class="field-label review">Ring Size</label>
<div class="review-text">{{ ring_size }}</div>
</div>
<div class="w-col w-col-4 responsive-column">
<div class="w-col w-col-3 responsive-column">
<label class="field-label review">Fee</label>
<div class="review-text">{{ fee | money }}</div>
</div>
<div class="w-col w-col-3 responsive-column">
<label class="field-label review">Size [kB]</label>
<div class="review-text">{{ tx_size }}</div>
</div>
</div>
<div class="w-row">
<div class="w-col w-col-4 responsive-column">

Loading…
Cancel
Save