From a7900f6466ee5477f22c232676310d3c37363e1c Mon Sep 17 00:00:00 2001 From: nymkappa Date: Thu, 17 Mar 2022 18:17:22 +0100 Subject: [PATCH] If mining dashboard is enabled, shows pools instead of timestamp --- .../blocks-list/blocks-list.component.html | 2 +- frontend/src/app/dashboard/dashboard.component.html | 12 ++++++++++-- frontend/src/app/dashboard/dashboard.component.scss | 10 ++++++++++ frontend/src/app/dashboard/dashboard.component.ts | 9 +++++++++ 4 files changed, 30 insertions(+), 3 deletions(-) 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 e71ad7817..d0eaa25ea 100644 --- a/frontend/src/app/components/blocks-list/blocks-list.component.html +++ b/frontend/src/app/components/blocks-list/blocks-list.component.html @@ -7,7 +7,7 @@ - diff --git a/frontend/src/app/dashboard/dashboard.component.html b/frontend/src/app/dashboard/dashboard.component.html index 3e0dcf938..3a028adc8 100644 --- a/frontend/src/app/dashboard/dashboard.component.html +++ b/frontend/src/app/dashboard/dashboard.component.html @@ -110,14 +110,22 @@
Height + Pool Timestamp Mined
- + + - + +
HeightMinedMinedPool TXs Size
{{ block.height }} + + + {{ block.extras.pool.name }} + + {{ block.tx_count | number }}
diff --git a/frontend/src/app/dashboard/dashboard.component.scss b/frontend/src/app/dashboard/dashboard.component.scss index 6fb2ee125..65d68f122 100644 --- a/frontend/src/app/dashboard/dashboard.component.scss +++ b/frontend/src/app/dashboard/dashboard.component.scss @@ -305,3 +305,13 @@ width: 100%; vertical-align: middle; } + +.clear-link { + color: white; +} + +.pool-name { + display: inline-block; + vertical-align: text-top; + padding-left: 10px; +} diff --git a/frontend/src/app/dashboard/dashboard.component.ts b/frontend/src/app/dashboard/dashboard.component.ts index 610f45765..910d6a81a 100644 --- a/frontend/src/app/dashboard/dashboard.component.ts +++ b/frontend/src/app/dashboard/dashboard.component.ts @@ -149,6 +149,15 @@ export class DashboardComponent implements OnInit { } acc.unshift(block); acc = acc.slice(0, 6); + + if (this.stateService.env.MINING_DASHBOARD === true) { + for (const block of acc) { + // @ts-ignore: Need to add an extra field for the template + block.extras.pool.logo = `./resources/mining-pools/` + + block.extras.pool.name.toLowerCase().replace(' ', '').replace('.', '') + '.svg'; + } + } + return acc; }, []), );