diff --git a/frontend/src/app/components/block/block.component.html b/frontend/src/app/components/block/block.component.html
index 2c240c250..e598e9412 100644
--- a/frontend/src/app/components/block/block.component.html
+++ b/frontend/src/app/components/block/block.component.html
@@ -57,8 +57,21 @@
Block health |
- {{ blockAudit.matchRate }}%
- Unknown
+ = 99"
+ [class.badge-warning]="blockAudit?.matchRate >= 75 && blockAudit?.matchRate < 99"
+ [class.badge-danger]="blockAudit?.matchRate < 75"
+ *ngIf="blockAudit?.matchRate != null; else nullHealth"
+ >{{ blockAudit?.matchRate }}%
+
+
+ Unknown
+
+
+
+
+
|
diff --git a/frontend/src/app/components/block/block.component.ts b/frontend/src/app/components/block/block.component.ts
index e4806f8c6..e92e44937 100644
--- a/frontend/src/app/components/block/block.component.ts
+++ b/frontend/src/app/components/block/block.component.ts
@@ -43,6 +43,7 @@ export class BlockComponent implements OnInit, OnDestroy {
strippedTransactions: TransactionStripped[];
overviewTransitionDirection: string;
isLoadingOverview = true;
+ isLoadingAudit = true;
error: any;
blockSubsidy: number;
fees: number;
@@ -297,13 +298,18 @@ export class BlockComponent implements OnInit, OnDestroy {
this.auditSubscription = block$.pipe(
startWith(null),
pairwise(),
- switchMap(([prevBlock, block]) => this.apiService.getBlockAudit$(block.id)
- .pipe(
- catchError((err) => {
- this.overviewError = err;
- return of([]);
- })
- )
+ switchMap(([prevBlock, block]) => {
+ this.isLoadingAudit = true;
+ this.blockAudit = null;
+ return this.apiService.getBlockAudit$(block.id)
+ .pipe(
+ catchError((err) => {
+ this.overviewError = err;
+ this.isLoadingAudit = false;
+ return of([]);
+ })
+ );
+ }
),
filter((response) => response != null),
map((response) => {
@@ -375,12 +381,14 @@ export class BlockComponent implements OnInit, OnDestroy {
console.log(err);
this.error = err;
this.isLoadingOverview = false;
+ this.isLoadingAudit = false;
return of(null);
}),
).subscribe((blockAudit) => {
this.blockAudit = blockAudit;
this.setupBlockGraphs();
this.isLoadingOverview = false;
+ this.isLoadingAudit = false;
});
}
diff --git a/frontend/src/app/components/blocks-list/blocks-list.component.html b/frontend/src/app/components/blocks-list/blocks-list.component.html
index 628efb51b..e310d4dc7 100644
--- a/frontend/src/app/components/blocks-list/blocks-list.component.html
+++ b/frontend/src/app/components/blocks-list/blocks-list.component.html
@@ -46,16 +46,22 @@
-
-
-
-
- {{ auditScores[block.id] }}%
- ~
-
-
-
+ = 99"
+ [class.badge-warning]="auditScores[block.id] >= 75 && auditScores[block.id] < 99"
+ [class.badge-danger]="auditScores[block.id] < 75"
+ [routerLink]="auditScores[block.id] != null ? ['/block/' | relativeUrl, block.id] : null"
+ *ngIf="auditScores[block.id] != null; else nullHealth"
+ >{{ auditScores[block.id] }}%
+
+
+ Unknown
+
+
+
+
+
|
diff --git a/frontend/src/app/components/blocks-list/blocks-list.component.ts b/frontend/src/app/components/blocks-list/blocks-list.component.ts
index 700032225..93f7814cf 100644
--- a/frontend/src/app/components/blocks-list/blocks-list.component.ts
+++ b/frontend/src/app/components/blocks-list/blocks-list.component.ts
@@ -23,6 +23,7 @@ export class BlocksList implements OnInit, OnDestroy {
indexingAvailable = false;
isLoading = true;
+ loadingScores = true;
fromBlockHeight = undefined;
paginationMaxSize: number;
page = 1;
@@ -113,6 +114,7 @@ export class BlocksList implements OnInit, OnDestroy {
if (this.indexingAvailable) {
this.auditScoreSubscription = this.fromHeightSubject.pipe(
switchMap((fromBlockHeight) => {
+ this.loadingScores = true;
return this.apiService.getBlockAuditScores$(this.page === 1 ? undefined : fromBlockHeight)
.pipe(
catchError(() => {
@@ -124,6 +126,7 @@ export class BlocksList implements OnInit, OnDestroy {
Object.values(scores).forEach(score => {
this.auditScores[score.hash] = score?.matchRate != null ? score.matchRate : null;
});
+ this.loadingScores = false;
});
this.latestScoreSubscription = this.stateService.blocks$.pipe(
|