mirror of
https://github.com/arnaucube/goBlockchainDataAnalysis.git
synced 2026-02-06 19:26:41 +01:00
added pagination on Blocks, Txs, Addresses
This commit is contained in:
@@ -10,6 +10,12 @@
|
||||
<a ng-href="#!/address/{{address.hash}}" class="list-group-item-text">{{address.hash}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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,25 @@ angular.module('app.addresses', ['ngRoute'])
|
||||
|
||||
//last addr
|
||||
$scope.addresses = [];
|
||||
$http.get(urlapi + 'lastaddr')
|
||||
.then(function(data, status, headers, config) {
|
||||
console.log(data);
|
||||
$scope.addresses = data.data;
|
||||
}, function(data, status, headers, config) {
|
||||
console.log('data error');
|
||||
});
|
||||
$scope.page = 1;
|
||||
$scope.count = 10;
|
||||
$scope.getAddresses = function() {
|
||||
$http.get(urlapi + 'addresses/' + $scope.page + '/' + $scope.count)
|
||||
.then(function(data, status, headers, config) {
|
||||
console.log(data);
|
||||
$scope.addresses = data.data;
|
||||
}, function(data, status, headers, config) {
|
||||
console.log('data error');
|
||||
});
|
||||
};
|
||||
$scope.getAddresses();
|
||||
|
||||
$scope.getPrev = function(){
|
||||
$scope.page++;
|
||||
$scope.getAddresses();
|
||||
};
|
||||
$scope.getNext = function(){
|
||||
$scope.page--;
|
||||
$scope.getAddresses();
|
||||
};
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
@@ -32,7 +32,7 @@ angular.module('app.main', ['ngRoute'])
|
||||
|
||||
//last addr
|
||||
$scope.addresses = [];
|
||||
$http.get(urlapi + 'lastaddr')
|
||||
$http.get(urlapi + 'addresses/1/10')
|
||||
.then(function(data, status, headers, config) {
|
||||
console.log(data);
|
||||
$scope.addresses = data.data;
|
||||
@@ -42,7 +42,7 @@ angular.module('app.main', ['ngRoute'])
|
||||
|
||||
//last tx
|
||||
$scope.txs = [];
|
||||
$http.get(urlapi + 'lasttx')
|
||||
$http.get(urlapi + 'txs/1/10')
|
||||
.then(function(data, status, headers, config) {
|
||||
console.log(data);
|
||||
$scope.txs = data.data;
|
||||
|
||||
@@ -45,6 +45,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,25 @@ angular.module('app.txs', ['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.getTxs = function() {
|
||||
$http.get(urlapi + 'txs/' + $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.getTxs();
|
||||
|
||||
$scope.getPrev = function(){
|
||||
$scope.page++;
|
||||
$scope.getTxs();
|
||||
};
|
||||
$scope.getNext = function(){
|
||||
$scope.page--;
|
||||
$scope.getTxs();
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user