+ show transactions direction
This commit is contained in:
@@ -22,3 +22,15 @@
|
||||
.sendWrapper input {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
#tableTransactionsForAll .fa-arrow-right {
|
||||
color: #8B0000;
|
||||
}
|
||||
|
||||
#tableTransactionsForAll .fa-arrow-left {
|
||||
color: #228B22;
|
||||
}
|
||||
|
||||
#tableTransactionsForAll .fa-arrows-alt-h {
|
||||
color: #DCDCDC;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
<table id="tableTransactionsForAll" class="display tableTransactions" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Block</th>
|
||||
<th>Timestamp</th>
|
||||
<th>From</th>
|
||||
@@ -11,6 +12,7 @@
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Block</th>
|
||||
<th>Timestamp</th>
|
||||
<th>From</th>
|
||||
|
||||
@@ -77,27 +77,55 @@ class Transactions {
|
||||
$("#loadingTransactionsOverlay").css("display", "block");
|
||||
|
||||
setTimeout(() => {
|
||||
var dataTransactions = ipcRenderer.sendSync('getTransactions');
|
||||
var addressList = EthoWallets.getAddressList();
|
||||
|
||||
dataTransactions.forEach(function(element) {
|
||||
var isFromValid = (addressList.indexOf(element[2].toLowerCase()) > -1);
|
||||
var isToValid = (addressList.indexOf(element[3].toLowerCase()) > -1);
|
||||
|
||||
if ((isToValid) && (!isFromValid)) {
|
||||
element.unshift(0);
|
||||
} else if ((!isToValid) && (isFromValid)) {
|
||||
element.unshift(1);
|
||||
} else {
|
||||
element.unshift(2);
|
||||
}
|
||||
});
|
||||
|
||||
// render the transactions
|
||||
$('#tableTransactionsForAll').DataTable({
|
||||
"paging": false,
|
||||
"scrollY": "calc(100vh - 115px)",
|
||||
"responsive": true,
|
||||
"processing": true,
|
||||
"order": [[ 0, "desc" ]],
|
||||
"data": ipcRenderer.sendSync('getTransactions'),
|
||||
"order": [[ 1, "desc" ]],
|
||||
"data": dataTransactions,
|
||||
"columnDefs": [
|
||||
{
|
||||
"className": "transactionsBlockNum",
|
||||
"targets": 0
|
||||
"targets": 0,
|
||||
"render": function ( data, type, row ) {
|
||||
if (data == 0) {
|
||||
return '<i class="fas fa-arrow-left"></i>';
|
||||
} else if (data == 1) {
|
||||
return '<i class="fas fa-arrow-right"></i>';
|
||||
} else {
|
||||
return '<i class="fas fa-arrows-alt-h"></i>';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"targets": 1,
|
||||
"className": "transactionsBlockNum",
|
||||
"targets": 1
|
||||
},
|
||||
{
|
||||
"targets": 2,
|
||||
"render": function ( data, type, row ) {
|
||||
return moment(data).format("MMM Do YYYY");
|
||||
}
|
||||
},
|
||||
{
|
||||
"targets": 4,
|
||||
"targets": 5,
|
||||
"render": function ( data, type, row ) {
|
||||
return parseFloat(web3Local.utils.fromWei(EthoUtils.toFixed(parseFloat(data)).toString(), 'ether')).toFixed(2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user