Bisq explorer is now a separate module.

This commit is contained in:
softsimon
2020-07-11 00:17:13 +07:00
parent 58509aa612
commit 2ac2d9ecce
34 changed files with 347 additions and 106 deletions

View 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>

View File

@@ -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();
});
});

View 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;
});
}
}