mirror of
https://github.com/arnaucube/goBlockchainDataAnalysis.git
synced 2026-02-07 03:36:44 +01:00
added tx page in frontend and backend route. Added address tx chart time analysis
This commit is contained in:
@@ -8,20 +8,29 @@
|
||||
{{address.amount}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<div class="panel-heading c_deepPurpleG300to500">
|
||||
<h3 class="panel-title">Address uses
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<canvas id="line" class="chart chart-line" chart-data="addresstimechart.data" chart-labels="addresstimechart.labels">
|
||||
</canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="panel">
|
||||
<div class="panel-heading c_deepPurpleG300to500">
|
||||
<h3 class="panel-title">Blocks where address appears</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="panel-body" style="max-height: 300px;overflow-y: scroll;">
|
||||
<div class="list-group">
|
||||
<a ng-href="#!/block/{{block.height}}" class="list-group-item-text" ng-repeat="block in address.blocks">
|
||||
Block Height: {{block.height}}
|
||||
<br> Hash: {{block.hash}}
|
||||
<br> {{block.datet}}
|
||||
<br> Size: {{block.size}} bytes
|
||||
<br>
|
||||
<hr>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -39,32 +48,36 @@
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>BlockHeight</th>
|
||||
<th>From</th>
|
||||
<th>To</th>
|
||||
<th>Amount</th>
|
||||
<th></th>
|
||||
<th>Txid</th>
|
||||
<th>Input</th>
|
||||
<th>Output</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="tx in address.txs">
|
||||
<td style="max-width:20px; overflow:hidden;">
|
||||
<a ng-href="#!/block/{{tx.blockheight}}" class="list-group-item-text">
|
||||
{{tx.blockheight}}
|
||||
<a ng-href="#!/tx/{{tx.txid}}" class="list-group-item-text">
|
||||
{{tx.txid}}
|
||||
</a>
|
||||
<br>
|
||||
{{tx.datet}}
|
||||
</td>
|
||||
<td style="max-width:20px; overflow:hidden;">
|
||||
<a ng-href="#!/address/{{tx.from}}" class="list-group-item-text">
|
||||
{{tx.from}}
|
||||
</a>
|
||||
<table><tbody><tr ng-repeat="vin in tx.vin"><td>
|
||||
<a ng-href="#!/address/{{vin.address}}" class="list-group-item-text">
|
||||
{{vin.address}}
|
||||
</a>
|
||||
:{{vin.amount}}
|
||||
</td></tr></tbody></table>
|
||||
</td>
|
||||
<td style="max-width:20px; overflow:hidden;">
|
||||
<a ng-href="#!/address/{{tx.to}}" class="list-group-item-text">
|
||||
{{tx.to}}
|
||||
</a>
|
||||
<table><tbody><tr ng-repeat="vout in tx.vout"><td>
|
||||
<a ng-href="#!/address/{{vout.address}}" class="list-group-item-text">
|
||||
{{vout.address}}
|
||||
</a>
|
||||
:{{vout.value}}
|
||||
</td></tr></tbody></table>
|
||||
</td>
|
||||
<td>{{tx.amount}}</td>
|
||||
<td><a ng-href="#!/tx/{{tx.id}}">View</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -18,4 +18,16 @@ angular.module('app.address', ['ngRoute'])
|
||||
}, function(data, status, headers, config) {
|
||||
console.log('data error');
|
||||
});
|
||||
$scope.addresstimechart= {
|
||||
data:[],
|
||||
labels: []
|
||||
};
|
||||
$http.get(urlapi + 'addresstimechart/' + $routeParams.hash)
|
||||
.then(function(data, status, headers, config) {
|
||||
console.log(data);
|
||||
$scope.addresstimechart.data = data.data.data;
|
||||
$scope.addresstimechart.labels = data.data.labels;
|
||||
}, function(data, status, headers, config) {
|
||||
console.log('data error');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<tbody>
|
||||
<tr ng-repeat="tx in block.txs">
|
||||
<td style="max-width:20px; overflow:hidden;">
|
||||
<a ng-href="#!/address/{{tx.from}}" class="list-group-item-text">
|
||||
<a ng-href="#!/tx/{{tx.txid}}" class="list-group-item-text">
|
||||
{{tx.txid}}
|
||||
</a>
|
||||
</td>
|
||||
|
||||
47
web/views/tx/tx.html
Normal file
47
web/views/tx/tx.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="panel">
|
||||
<div class="panel-heading c_deepPurpleG300to500">
|
||||
<h3 class="panel-title">Tx {{tx.txid}}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="col-sm-12">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Txid</th>
|
||||
<th>Input</th>
|
||||
<th>Output</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="max-width:20px; overflow:hidden;">
|
||||
<a ng-href="#!/tx/{{tx.txid}}" class="list-group-item-text">
|
||||
{{tx.txid}}
|
||||
</a>
|
||||
</td>
|
||||
<td style="max-width:20px; overflow:hidden;">
|
||||
<table><tbody><tr ng-repeat="vin in tx.vin"><td>
|
||||
<a ng-href="#!/address/{{vin.address}}" class="list-group-item-text">
|
||||
{{vin.address}}
|
||||
</a>
|
||||
:{{vin.amount}}
|
||||
</td></tr></tbody></table>
|
||||
</td>
|
||||
<td style="max-width:20px; overflow:hidden;">
|
||||
<table><tbody><tr ng-repeat="vout in tx.vout"><td>
|
||||
<a ng-href="#!/address/{{vout.address}}" class="list-group-item-text">
|
||||
{{vout.address}}
|
||||
</a>
|
||||
:{{vout.value}}
|
||||
</td></tr></tbody></table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
21
web/views/tx/tx.js
Normal file
21
web/views/tx/tx.js
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('app.tx', ['ngRoute'])
|
||||
|
||||
.config(['$routeProvider', function($routeProvider) {
|
||||
$routeProvider.when('/tx/:txid', {
|
||||
templateUrl: 'views/tx/tx.html',
|
||||
controller: 'TxCtrl'
|
||||
});
|
||||
}])
|
||||
|
||||
.controller('TxCtrl', function($scope, $http, $routeParams) {
|
||||
$scope.tx = {};
|
||||
$http.get(urlapi + 'tx/' + $routeParams.txid)
|
||||
.then(function(data, status, headers, config) {
|
||||
console.log(data);
|
||||
$scope.tx = data.data;
|
||||
}, function(data, status, headers, config) {
|
||||
console.log('data error');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user