Bisq explorer is now a separate module.
This commit is contained in:
28
frontend/src/app/bisq/bisq-block/bisq-block.component.html
Normal file
28
frontend/src/app/bisq/bisq-block/bisq-block.component.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<div class="container-xl">
|
||||
|
||||
<div class="title-block">
|
||||
<h1>Block <ng-template [ngIf]="blockHeight"><a [routerLink]="['/block/' | relativeUrl, blockHash]">{{ blockHeight }}</a></ng-template></h1>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<ng-template ngFor let-tx [ngForOf]="bisqTransactions">
|
||||
|
||||
<div class="header-bg box" style="padding: 10px; margin-bottom: 10px;">
|
||||
<a [routerLink]="['/tx/' | relativeUrl, tx.id]" [state]="{ data: tx }">
|
||||
<span style="float: left;" class="d-block d-md-none">{{ tx.id | shortenString : 16 }}</span>
|
||||
<span style="float: left;" class="d-none d-md-block">{{ tx.id }}</span>
|
||||
</a>
|
||||
<div class="float-right">
|
||||
{{ tx.time | date:'yyyy-MM-dd HH:mm' }}
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
||||
<app-bisq-transfers [tx]="tx"></app-bisq-transfers>
|
||||
|
||||
<br>
|
||||
|
||||
</ng-template>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { BisqBlockComponent } from './bisq-block.component';
|
||||
|
||||
describe('BisqBlockComponent', () => {
|
||||
let component: BisqBlockComponent;
|
||||
let fixture: ComponentFixture<BisqBlockComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ BisqBlockComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(BisqBlockComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
32
frontend/src/app/bisq/bisq-block/bisq-block.component.ts
Normal file
32
frontend/src/app/bisq/bisq-block/bisq-block.component.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { BisqTransaction } from 'src/app/interfaces/bisq.interfaces';
|
||||
import { ApiService } from 'src/app/services/api.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-bisq-block',
|
||||
templateUrl: './bisq-block.component.html',
|
||||
styleUrls: ['./bisq-block.component.scss']
|
||||
})
|
||||
export class BisqBlockComponent implements OnInit {
|
||||
bisqTransactions: BisqTransaction[];
|
||||
bisqTransactionsCount: number;
|
||||
|
||||
blockHash = '';
|
||||
blockHeight = 0;
|
||||
|
||||
constructor(
|
||||
private apiService: ApiService,
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.apiService.listBisqBlockTransactions$(this.blockHash, 0, 10)
|
||||
.subscribe((response) => {
|
||||
this.bisqTransactionsCount = parseInt(response.headers.get('x-total-count'), 10);
|
||||
this.bisqTransactions = response.body;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user