add more fields to blocksPage; add link to block
This commit is contained in:
parent
b274b363ff
commit
aac27ff520
@ -6,7 +6,7 @@
|
|||||||
-->
|
-->
|
||||||
<ion-header>
|
<ion-header>
|
||||||
|
|
||||||
<ion-navbar>
|
<ion-navbar color="primary">
|
||||||
<ion-title>Block Detail</ion-title>
|
<ion-title>Block Detail</ion-title>
|
||||||
</ion-navbar>
|
</ion-navbar>
|
||||||
|
|
||||||
|
|||||||
@ -10,32 +10,34 @@
|
|||||||
</button>
|
</button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
</ion-navbar>
|
</ion-navbar>
|
||||||
|
<ion-searchbar (ionInput)="search($event)" placeholder="{{ 'Search for block, transaction or address' }}" [(ngModel)]="q" [debounce]="1000"></ion-searchbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<ion-content padding>
|
<ion-content padding>
|
||||||
<ion-list>
|
<ion-grid>
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-searchbar (ionInput)="search($event)" placeholder="{{ 'Search for block, transaction or address' }}" [(ngModel)]="q"></ion-searchbar>
|
<ion-col><b>Height</b></ion-col>
|
||||||
|
<ion-col><b>Timestamp</b></ion-col>
|
||||||
|
<ion-col text-right><b>Transactions</b></ion-col>
|
||||||
|
<ion-col><b>Mined By</b></ion-col>
|
||||||
|
<ion-col text-right><b>Size</b></ion-col>
|
||||||
</ion-row>
|
</ion-row>
|
||||||
<ion-item>
|
<ion-row *ngFor="let block of blocks | async">
|
||||||
<ion-row>
|
<ion-col>
|
||||||
<ion-col>Height</ion-col>
|
<a (click)="goToBlock(block.hash)">{{block.height}}</a>
|
||||||
<ion-col>Transactions</ion-col>
|
</ion-col>
|
||||||
<ion-col>Mined By</ion-col>
|
<ion-col>
|
||||||
</ion-row>
|
{{ block.timestamp * 1000 | date:'medium' }}
|
||||||
</ion-item>
|
</ion-col>
|
||||||
<ion-item *ngFor="let block of blocks | async">
|
<ion-col text-right>
|
||||||
<ion-row>
|
{{block.transactionCount}}
|
||||||
<ion-col>
|
</ion-col>
|
||||||
#{{block.height}}
|
<ion-col>
|
||||||
</ion-col>
|
<a *ngIf="block.poolName" href="{{block.url}}">{{block.poolName}}</a>
|
||||||
<ion-col>
|
</ion-col>
|
||||||
{{block.transactionCount}} transactions
|
<ion-col text-right>
|
||||||
</ion-col>
|
{{ block.size }}
|
||||||
<ion-col>
|
</ion-col>
|
||||||
<a *ngIf="block.poolName" href="{{block.url}}">{{block.poolName}}</a>
|
</ion-row>
|
||||||
</ion-col>
|
</ion-grid>
|
||||||
</ion-row>
|
|
||||||
</ion-item>
|
|
||||||
</ion-list>
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|||||||
@ -21,9 +21,9 @@ export class BlocksPage {
|
|||||||
constructor(private navCtrl: NavController, private http: Http, private blocksService: BlocksService, private api: ApiProvider) {
|
constructor(private navCtrl: NavController, private http: Http, private blocksService: BlocksService, private api: ApiProvider) {
|
||||||
this.title = 'Blocks';
|
this.title = 'Blocks';
|
||||||
this.blocks = blocksService.latestBlocks;
|
this.blocks = blocksService.latestBlocks;
|
||||||
// this.blocks.subscribe((blocks) => {
|
this.blocks.subscribe((blocks) => {
|
||||||
// console.log(blocks);
|
console.log('blocks', blocks);
|
||||||
// });
|
});
|
||||||
blocksService.getLatestBlocks();
|
blocksService.getLatestBlocks();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,4 +101,10 @@ export class BlocksPage {
|
|||||||
};
|
};
|
||||||
/* tslint:enable:no-unused-variable */
|
/* tslint:enable:no-unused-variable */
|
||||||
|
|
||||||
|
public goToBlock(blockHash: string): void {
|
||||||
|
this.navCtrl.push('block-detail', {
|
||||||
|
'blockHash': blockHash
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user