From 14ad0c8ecb7d20a329c8f50b1a88f56ee8fc0a85 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Fri, 21 Jul 2023 14:13:36 +0900 Subject: [PATCH] Add more acceleration stats --- .../acceleration-stats.component.html | 6 +++--- .../acceleration-stats.component.ts | 5 +++-- .../accelerator-dashboard.component.html | 18 ++++++++++++++---- .../block-fee-rates-graph.component.ts | 2 +- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/components/acceleration-stats/acceleration-stats.component.html b/frontend/src/app/components/acceleration-stats/acceleration-stats.component.html index e8ded44fc..a2f201eb4 100644 --- a/frontend/src/app/components/acceleration-stats/acceleration-stats.component.html +++ b/frontend/src/app/components/acceleration-stats/acceleration-stats.component.html @@ -27,21 +27,21 @@
-
Miners Reward
+
Transactions
-
Avg Block Fees
+
Fee delta
-
Avg Tx Fee
+
Success rate
diff --git a/frontend/src/app/components/acceleration-stats/acceleration-stats.component.ts b/frontend/src/app/components/acceleration-stats/acceleration-stats.component.ts index fa69b1a9d..2d6355940 100644 --- a/frontend/src/app/components/acceleration-stats/acceleration-stats.component.ts +++ b/frontend/src/app/components/acceleration-stats/acceleration-stats.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; import { Observable, of } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { ApiService } from '../../services/api.service'; @@ -11,13 +11,14 @@ import { StateService } from '../../services/state.service'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class AccelerationStatsComponent implements OnInit { + @Input() timespan: '24h' | '1w' = '24h'; public accelerationStats$: Observable; private lastBlockHeight: number; constructor(private apiService: ApiService, private stateService: StateService) { } ngOnInit(): void { - this.accelerationStats$ = this.apiService.getAccelerations$().pipe( + this.accelerationStats$ = this.apiService.getAccelerations$(this.timespan).pipe( switchMap(accelerations => { let totalFeeDelta = 0; let totalMined = 0; diff --git a/frontend/src/app/components/accelerator-dashboard/accelerator-dashboard.component.html b/frontend/src/app/components/accelerator-dashboard/accelerator-dashboard.component.html index 71baeceb9..530cbbb10 100644 --- a/frontend/src/app/components/accelerator-dashboard/accelerator-dashboard.component.html +++ b/frontend/src/app/components/accelerator-dashboard/accelerator-dashboard.component.html @@ -4,6 +4,7 @@
+
Acceleration stats  @@ -12,16 +13,25 @@
- +
- +
-
Difficulty Adjustment
- +
+ Acceleration stats  + (1008 blocks) +
+
+
+
+ +
+
+
diff --git a/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts b/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts index 19c51527f..0de1e8474 100644 --- a/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts +++ b/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts @@ -210,7 +210,7 @@ export class BlockFeeRatesGraphComponent implements OnInit { top: this.widget ? 20 : (this.isMobile() ? 10 : 50), }, tooltip: { - show: !this.isMobile() && !this.widget, + show: !this.isMobile(), trigger: 'axis', axisPointer: { type: 'line'