mirror of
https://github.com/arnaucube/goBlockchainDataAnalysis.git
synced 2026-02-07 11:46:38 +01:00
added pagination on Blocks, Txs, Addresses
This commit is contained in:
@@ -2,7 +2,10 @@
|
||||
<div class="col-md-12">
|
||||
<div class="panel">
|
||||
<div class="panel-heading c_deepPurpleG300to500">
|
||||
<h3 class="panel-title">Last Tx with amount</h3>
|
||||
<h3 class="panel-title">
|
||||
Last Blocks with amount
|
||||
<div ng-click="getBlocks()" class="btn btn-default pull-right">Previous</div>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-hover">
|
||||
@@ -45,6 +48,11 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<ul class="pager">
|
||||
<li><a class="withripple" ng-click="getPrev()">Previous</a></li>
|
||||
Current page: {{page}}
|
||||
<li><a class="withripple" ng-click="getNext()">Next</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,12 +13,26 @@ angular.module('app.blocks', ['ngRoute'])
|
||||
|
||||
//last tx
|
||||
$scope.txs = [];
|
||||
$http.get(urlapi + 'lasttx')
|
||||
.then(function(data, status, headers, config) {
|
||||
console.log(data);
|
||||
$scope.txs = data.data;
|
||||
}, function(data, status, headers, config) {
|
||||
console.log('data error');
|
||||
});
|
||||
$scope.page = 1;
|
||||
$scope.count = 10;
|
||||
$scope.getBlocks = function() {;
|
||||
$http.get(urlapi + 'blocks/' + $scope.page + '/' + $scope.count)
|
||||
.then(function(data, status, headers, config) {
|
||||
console.log(data);
|
||||
$scope.txs = data.data;
|
||||
}, function(data, status, headers, config) {
|
||||
console.log('data error');
|
||||
});
|
||||
};
|
||||
$scope.getBlocks();
|
||||
|
||||
$scope.getPrev = function(){
|
||||
$scope.page++;
|
||||
$scope.getBlocks();
|
||||
};
|
||||
$scope.getNext = function(){
|
||||
$scope.page--;
|
||||
$scope.getBlocks();
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user