mirror of
https://github.com/mempool/mempool.git
synced 2025-01-19 05:34:03 +01:00
Display network logo in the top bar.
Allow search for block height. Hide empty bisq blocks.
This commit is contained in:
parent
432fb9cd66
commit
87abfc38cb
@ -107,7 +107,7 @@ class Bisq {
|
|||||||
console.log('Loading Bisq data from dump...');
|
console.log('Loading Bisq data from dump...');
|
||||||
const data: BisqBlocks = JSON.parse(cacheData);
|
const data: BisqBlocks = JSON.parse(cacheData);
|
||||||
if (data.blocks && data.blocks.length !== this.blocks.length) {
|
if (data.blocks && data.blocks.length !== this.blocks.length) {
|
||||||
this.blocks = data.blocks;
|
this.blocks = data.blocks.filter((block) => block.txs.length > 0);
|
||||||
this.blocks.reverse();
|
this.blocks.reverse();
|
||||||
const time = new Date().getTime() - start;
|
const time = new Date().getTime() - start;
|
||||||
console.log('Bisq dump loaded in ' + time + ' ms');
|
console.log('Bisq dump loaded in ' + time + ' ms');
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div class="container-xl">
|
<div class="container-xl">
|
||||||
<h1 style="float: left;">Bisq Address</h1>
|
<h1 style="float: left;">Address</h1>
|
||||||
<a [routerLink]="['/address/' | relativeUrl, addressString]" style="line-height: 56px; margin-left: 10px;">
|
<a [routerLink]="['/address/' | relativeUrl, addressString]" style="line-height: 56px; margin-left: 10px;">
|
||||||
<span class="d-inline d-lg-none">{{ addressString | shortenString : 24 }}</span>
|
<span class="d-inline d-lg-none">{{ addressString | shortenString : 24 }}</span>
|
||||||
<span class="d-none d-lg-inline">{{ addressString }}</span>
|
<span class="d-none d-lg-inline">{{ addressString }}</span>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<div class="container-xl">
|
<div class="container-xl">
|
||||||
|
|
||||||
<div class="title-block">
|
<div class="title-block">
|
||||||
<h1>Bisq Block <ng-template [ngIf]="blockHeight"><a [routerLink]="['/block/' | relativeUrl, blockHash]">{{ blockHeight }}</a></ng-template></h1>
|
<h1>Block <ng-template [ngIf]="blockHeight"><a [routerLink]="['/block/' | relativeUrl, blockHash]">{{ blockHeight }}</a></ng-template></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import { Component, OnInit, OnDestroy } from '@angular/core';
|
import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||||
import { BisqTransaction, BisqBlock } from 'src/app/bisq/bisq.interfaces';
|
import { BisqBlock } from 'src/app/bisq/bisq.interfaces';
|
||||||
|
import { Location } from '@angular/common';
|
||||||
import { BisqApiService } from '../bisq-api.service';
|
import { BisqApiService } from '../bisq-api.service';
|
||||||
import { ActivatedRoute, ParamMap } from '@angular/router';
|
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
|
||||||
import { Subscribable, Subscription, of } from 'rxjs';
|
import { Subscription, of } from 'rxjs';
|
||||||
import { switchMap } from 'rxjs/operators';
|
import { switchMap } from 'rxjs/operators';
|
||||||
import { SeoService } from 'src/app/services/seo.service';
|
import { SeoService } from 'src/app/services/seo.service';
|
||||||
|
import { ElectrsApiService } from 'src/app/services/electrs-api.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-bisq-block',
|
selector: 'app-bisq-block',
|
||||||
@ -23,13 +25,16 @@ export class BisqBlockComponent implements OnInit, OnDestroy {
|
|||||||
private bisqApiService: BisqApiService,
|
private bisqApiService: BisqApiService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private seoService: SeoService,
|
private seoService: SeoService,
|
||||||
|
private electrsApiService: ElectrsApiService,
|
||||||
|
private router: Router,
|
||||||
|
private location: Location,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.subscription = this.route.paramMap
|
this.subscription = this.route.paramMap
|
||||||
.pipe(
|
.pipe(
|
||||||
switchMap((params: ParamMap) => {
|
switchMap((params: ParamMap) => {
|
||||||
this.blockHash = params.get('id') || '';
|
const blockHash = params.get('id') || '';
|
||||||
document.body.scrollTo(0, 0);
|
document.body.scrollTo(0, 0);
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
if (history.state.data && history.state.data.blockHeight) {
|
if (history.state.data && history.state.data.blockHeight) {
|
||||||
@ -39,6 +44,27 @@ export class BisqBlockComponent implements OnInit, OnDestroy {
|
|||||||
this.blockHeight = history.state.data.block.height;
|
this.blockHeight = history.state.data.block.height;
|
||||||
return of(history.state.data.block);
|
return of(history.state.data.block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let isBlockHeight = false;
|
||||||
|
if (/^[0-9]+$/.test(blockHash)) {
|
||||||
|
isBlockHeight = true;
|
||||||
|
} else {
|
||||||
|
this.blockHash = blockHash;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isBlockHeight) {
|
||||||
|
return this.electrsApiService.getBlockHashFromHeight$(parseInt(blockHash, 10))
|
||||||
|
.pipe(
|
||||||
|
switchMap((hash) => {
|
||||||
|
this.blockHash = hash;
|
||||||
|
this.location.replaceState(
|
||||||
|
this.router.createUrlTree(['/bisq/block/', hash]).toString()
|
||||||
|
);
|
||||||
|
return this.bisqApiService.getBlock$(this.blockHash);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return this.bisqApiService.getBlock$(this.blockHash);
|
return this.bisqApiService.getBlock$(this.blockHash);
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div class="container-xl">
|
<div class="container-xl">
|
||||||
<h2 style="float: left;">Bisq Blocks</h2>
|
<h1 style="float: left;">Blocks</h1>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div class="container-xl">
|
<div class="container-xl">
|
||||||
|
|
||||||
<h1 class="float-left mr-3 mb-md-3">Bisq Transaction</h1>
|
<h1 class="float-left mr-3 mb-md-3">Transaction</h1>
|
||||||
|
|
||||||
<ng-template [ngIf]="!isLoading" [ngIfElse]="isLoadingTmpl">
|
<ng-template [ngIf]="!isLoading" [ngIfElse]="isLoadingTmpl">
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div class="container-xl">
|
<div class="container-xl">
|
||||||
<h2 style="float: left;">Bisq Transactions</h2>
|
<h1 style="float: left;">Transactions</h1>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
<div class="badge badge-warning connection-badge" style="left: 30px;" *ngIf="connectionState === 1">Reconnecting...</div>
|
<div class="badge badge-warning connection-badge" style="left: 30px;" *ngIf="connectionState === 1">Reconnecting...</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
<img *ngIf="network !== ''" src="./resources/{{ network }}-logo.png" style="width: 35.5px;" class="mr-3">
|
||||||
|
|
||||||
<div class="btn-group" style="margin-right: 16px;" *ngIf="env.TESTNET_ENABLED || env.LIQUID_ENABLED || env.BISQ_ENABLED">
|
<div class="btn-group" style="margin-right: 16px;" *ngIf="env.TESTNET_ENABLED || env.LIQUID_ENABLED || env.BISQ_ENABLED">
|
||||||
<button type="button" (click)="networkDropdownHidden = !networkDropdownHidden" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<button type="button" (click)="networkDropdownHidden = !networkDropdownHidden" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
<span class="sr-only">Toggle Dropdown</span>
|
<span class="sr-only">Toggle Dropdown</span>
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 62 KiB |
Loading…
Reference in New Issue
Block a user