commit
f5c930adef
File diff suppressed because one or more lines are too long
|
@ -23,7 +23,7 @@ angular.module('insight').config(function($routeProvider) {
|
|||
templateUrl: '/views/block_list.html',
|
||||
title: 'Bitcoin Blocks solved Today'
|
||||
}).
|
||||
when('/blocks-date/:blockDate', {
|
||||
when('/blocks-date/:blockDate/:startTimestamp?', {
|
||||
templateUrl: '/views/block_list.html',
|
||||
title: 'Bitcoin Blocks solved '
|
||||
}).
|
||||
|
|
|
@ -49,11 +49,21 @@ angular.module('insight.blocks').controller('BlocksController',
|
|||
$scope.loading = true;
|
||||
|
||||
if ($routeParams.blockDate) {
|
||||
$rootScope.titleDetail = 'on ' + $routeParams.blockDate;
|
||||
$scope.detail = 'On ' + $routeParams.blockDate;
|
||||
}
|
||||
|
||||
if ($routeParams.startTimestamp) {
|
||||
var d=new Date($routeParams.startTimestamp*1000);
|
||||
var m=d.getMinutes();
|
||||
if (m<10) m = '0' + m;
|
||||
$scope.before = ' before ' + d.getHours() + ':' + m;
|
||||
}
|
||||
|
||||
$rootScope.titleDetail = $scope.detail;
|
||||
|
||||
Blocks.get({
|
||||
blockDate: $routeParams.blockDate
|
||||
blockDate: $routeParams.blockDate,
|
||||
startTimestamp: $routeParams.startTimestamp
|
||||
}, function(res) {
|
||||
$scope.loading = false;
|
||||
$scope.blocks = res.blocks;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<div class="page-header">
|
||||
<h1>
|
||||
Blocks
|
||||
<small>by date</small>
|
||||
<small>by date. {{detail}} {{before}}</small>
|
||||
</h1>
|
||||
</div>
|
||||
<table class="table table-hover table-striped">
|
||||
|
@ -56,6 +56,10 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div data-ng-if="pagination.more">
|
||||
<a class="btn btn-primary" href="/blocks-date/{{pagination.current}}" data-ng-show="{{before}}">Lastest block from date</a>
|
||||
<a class="btn btn-primary" href="/blocks-date/{{pagination.current}}/{{pagination.moreTs}}">Older blocks from this date</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="text-center text-muted" data-ng-show="!blocks.length && !loading">No blocks yet.</h2>
|
||||
|
|
Loading…
Reference in New Issue