Block page audit fallback
This commit is contained in:
parent
2b411aad0a
commit
75459729ad
@ -17,5 +17,6 @@
|
|||||||
"LIQUID_WEBSITE_URL": "https://liquid.network",
|
"LIQUID_WEBSITE_URL": "https://liquid.network",
|
||||||
"BISQ_WEBSITE_URL": "https://bisq.markets",
|
"BISQ_WEBSITE_URL": "https://bisq.markets",
|
||||||
"MINING_DASHBOARD": true,
|
"MINING_DASHBOARD": true,
|
||||||
|
"BLOCK_AUDIT_START_HEIGHT": 0,
|
||||||
"LIGHTNING": false
|
"LIGHTNING": false
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
<span *ngIf="blockAudit?.matchRate === null" i18n="unknown">Unknown</span>
|
<span *ngIf="blockAudit?.matchRate === null" i18n="unknown">Unknown</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<ng-container *ngIf="!indexingAvailable && webGlEnabled">
|
<ng-container *ngIf="webGlEnabled && (auditDataMissing || !indexingAvailable)">
|
||||||
<tr *ngIf="isMobile && auditEnabled"></tr>
|
<tr *ngIf="isMobile && auditEnabled"></tr>
|
||||||
<tr *ngIf="network !== 'liquid' && network !== 'liquidtestnet'">
|
<tr *ngIf="network !== 'liquid' && network !== 'liquidtestnet'">
|
||||||
<td i18n="mempool-block.fee-span">Fee span</td>
|
<td i18n="mempool-block.fee-span">Fee span</td>
|
||||||
@ -146,7 +146,7 @@
|
|||||||
<tr *ngIf="network !== 'liquid' && network !== 'liquidtestnet'">
|
<tr *ngIf="network !== 'liquid' && network !== 'liquidtestnet'">
|
||||||
<td colspan="2"><span class="skeleton-loader"></span></td>
|
<td colspan="2"><span class="skeleton-loader"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<ng-container *ngIf="!indexingAvailable && webGlEnabled">
|
<ng-container *ngIf="webGlEnabled && (!indexingAvailable || auditDataMissing)">
|
||||||
<tr *ngIf="isMobile && !auditEnabled"></tr>
|
<tr *ngIf="isMobile && !auditEnabled"></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="td-width" colspan="2"><span class="skeleton-loader"></span></td>
|
<td class="td-width" colspan="2"><span class="skeleton-loader"></span></td>
|
||||||
@ -169,7 +169,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<table class="table table-borderless table-striped" *ngIf="!isLoadingBlock && (indexingAvailable || !webGlEnabled)">
|
<table class="table table-borderless table-striped" *ngIf="!isLoadingBlock && (!auditDataMissing || indexingAvailable && !webGlEnabled)">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngIf="isMobile && auditEnabled"></tr>
|
<tr *ngIf="isMobile && auditEnabled"></tr>
|
||||||
<tr *ngIf="network !== 'liquid' && network !== 'liquidtestnet'">
|
<tr *ngIf="network !== 'liquid' && network !== 'liquidtestnet'">
|
||||||
@ -233,7 +233,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table class="table table-borderless table-striped" *ngIf="isLoadingBlock && (indexingAvailable || !webGlEnabled)">
|
<table class="table table-borderless table-striped" *ngIf="isLoadingBlock && !auditDataMissing && (indexingAvailable || !webGlEnabled)">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngIf="isMobile && !auditEnabled"></tr>
|
<tr *ngIf="isMobile && !auditEnabled"></tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -253,7 +253,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="col-sm chart-container" *ngIf="webGlEnabled && !indexingAvailable">
|
<div class="col-sm chart-container" *ngIf="webGlEnabled && (!indexingAvailable || auditDataMissing)">
|
||||||
<app-block-overview-graph
|
<app-block-overview-graph
|
||||||
#blockGraphActual
|
#blockGraphActual
|
||||||
[isLoading]="isLoadingOverview"
|
[isLoading]="isLoadingOverview"
|
||||||
@ -273,7 +273,7 @@
|
|||||||
<br>
|
<br>
|
||||||
|
|
||||||
<!-- VISUALIZATIONS -->
|
<!-- VISUALIZATIONS -->
|
||||||
<div class="box" *ngIf="!error && webGlEnabled && indexingAvailable">
|
<div class="box" *ngIf="!error && webGlEnabled && indexingAvailable && !auditDataMissing">
|
||||||
<div class="nav nav-tabs" *ngIf="isMobile && auditEnabled">
|
<div class="nav nav-tabs" *ngIf="isMobile && auditEnabled">
|
||||||
<a class="nav-link" [class.active]="mode === 'projected'" i18n="block.projected"
|
<a class="nav-link" [class.active]="mode === 'projected'" i18n="block.projected"
|
||||||
fragment="projected" (click)="changeMode('projected')">Projected</a>
|
fragment="projected" (click)="changeMode('projected')">Projected</a>
|
||||||
|
@ -58,6 +58,7 @@ export class BlockComponent implements OnInit, OnDestroy {
|
|||||||
webGlEnabled = true;
|
webGlEnabled = true;
|
||||||
indexingAvailable = false;
|
indexingAvailable = false;
|
||||||
auditEnabled = true;
|
auditEnabled = true;
|
||||||
|
auditDataMissing: boolean;
|
||||||
isMobile = window.innerWidth <= 767.98;
|
isMobile = window.innerWidth <= 767.98;
|
||||||
hoverTx: string;
|
hoverTx: string;
|
||||||
numMissing: number = 0;
|
numMissing: number = 0;
|
||||||
@ -137,6 +138,7 @@ export class BlockComponent implements OnInit, OnDestroy {
|
|||||||
this.error = undefined;
|
this.error = undefined;
|
||||||
this.fees = undefined;
|
this.fees = undefined;
|
||||||
this.stateService.markBlock$.next({});
|
this.stateService.markBlock$.next({});
|
||||||
|
this.auditDataMissing = false;
|
||||||
|
|
||||||
if (history.state.data && history.state.data.blockHeight) {
|
if (history.state.data && history.state.data.blockHeight) {
|
||||||
this.blockHeight = history.state.data.blockHeight;
|
this.blockHeight = history.state.data.blockHeight;
|
||||||
@ -152,6 +154,9 @@ export class BlockComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
if (history.state.data && history.state.data.block) {
|
if (history.state.data && history.state.data.block) {
|
||||||
this.blockHeight = history.state.data.block.height;
|
this.blockHeight = history.state.data.block.height;
|
||||||
|
if (this.blockHeight < this.stateService.env.BLOCK_AUDIT_START_HEIGHT) {
|
||||||
|
this.auditDataMissing = true;
|
||||||
|
}
|
||||||
return of(history.state.data.block);
|
return of(history.state.data.block);
|
||||||
} else {
|
} else {
|
||||||
this.isLoadingBlock = true;
|
this.isLoadingBlock = true;
|
||||||
@ -213,7 +218,9 @@ export class BlockComponent implements OnInit, OnDestroy {
|
|||||||
this.apiService.getBlockAudit$(block.previousblockhash);
|
this.apiService.getBlockAudit$(block.previousblockhash);
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
if (block.height < this.stateService.env.BLOCK_AUDIT_START_HEIGHT) {
|
||||||
|
this.auditDataMissing = true;
|
||||||
|
}
|
||||||
this.block = block;
|
this.block = block;
|
||||||
this.blockHeight = block.height;
|
this.blockHeight = block.height;
|
||||||
this.lastBlockHeight = this.blockHeight;
|
this.lastBlockHeight = this.blockHeight;
|
||||||
@ -363,6 +370,7 @@ export class BlockComponent implements OnInit, OnDestroy {
|
|||||||
this.auditEnabled = true;
|
this.auditEnabled = true;
|
||||||
} else {
|
} else {
|
||||||
this.auditEnabled = false;
|
this.auditEnabled = false;
|
||||||
|
this.auditDataMissing = true;
|
||||||
}
|
}
|
||||||
return blockAudit;
|
return blockAudit;
|
||||||
}),
|
}),
|
||||||
|
@ -39,6 +39,7 @@ export interface Env {
|
|||||||
BISQ_WEBSITE_URL: string;
|
BISQ_WEBSITE_URL: string;
|
||||||
MINING_DASHBOARD: boolean;
|
MINING_DASHBOARD: boolean;
|
||||||
LIGHTNING: boolean;
|
LIGHTNING: boolean;
|
||||||
|
BLOCK_AUDIT_START_HEIGHT: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultEnv: Env = {
|
const defaultEnv: Env = {
|
||||||
@ -64,6 +65,7 @@ const defaultEnv: Env = {
|
|||||||
'BISQ_WEBSITE_URL': 'https://bisq.markets',
|
'BISQ_WEBSITE_URL': 'https://bisq.markets',
|
||||||
'MINING_DASHBOARD': true,
|
'MINING_DASHBOARD': true,
|
||||||
'LIGHTNING': false,
|
'LIGHTNING': false,
|
||||||
|
'BLOCK_AUDIT_START_HEIGHT': 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
|
@ -85,10 +85,10 @@ export const download = (href, name) => {
|
|||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
};
|
};
|
||||||
|
|
||||||
export function detectWebGL() {
|
export function detectWebGL(): boolean {
|
||||||
const canvas = document.createElement('canvas');
|
const canvas = document.createElement('canvas');
|
||||||
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
|
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
|
||||||
return (gl && gl instanceof WebGLRenderingContext);
|
return !!(gl && gl instanceof WebGLRenderingContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user