From c827953ca5695764d30fc49e14fee124e7194045 Mon Sep 17 00:00:00 2001 From: natsoni Date: Thu, 4 Apr 2024 16:33:50 +0900 Subject: [PATCH] Fix remaining bugs from rebase --- .../accelerator-dashboard.component.ts | 6 +-- .../components/block-overview-graph/utils.ts | 12 +++--- .../difficulty/difficulty.component.html | 41 ------------------- frontend/src/theme-contrast.scss | 2 +- 4 files changed, 10 insertions(+), 51 deletions(-) diff --git a/frontend/src/app/components/acceleration/accelerator-dashboard/accelerator-dashboard.component.ts b/frontend/src/app/components/acceleration/accelerator-dashboard/accelerator-dashboard.component.ts index 1d3603739..dda2b036b 100644 --- a/frontend/src/app/components/acceleration/accelerator-dashboard/accelerator-dashboard.component.ts +++ b/frontend/src/app/components/acceleration/accelerator-dashboard/accelerator-dashboard.component.ts @@ -8,12 +8,12 @@ import { Observable, catchError, combineLatest, distinctUntilChanged, interval, import { Color } from '../../block-overview-graph/sprite-types'; import { hexToColor } from '../../block-overview-graph/utils'; import TxView from '../../block-overview-graph/tx-view'; -import { feeLevels, mempoolFeeColors } from '../../../app.constants'; +import { feeLevels, defaultMempoolFeeColors } from '../../../app.constants'; import { ServicesApiServices } from '../../../services/services-api.service'; import { detectWebGL } from '../../../shared/graphs.utils'; const acceleratedColor: Color = hexToColor('8F5FF6'); -const normalColors = mempoolFeeColors.map(hex => hexToColor(hex + '5F')); +const normalColors = defaultMempoolFeeColors.map(hex => hexToColor(hex + '5F')); interface AccelerationBlock extends BlockExtended { accelerationCount: number, @@ -128,7 +128,7 @@ export class AcceleratorDashboardComponent implements OnInit { } else { const rate = tx.fee / tx.vsize; // color by simple single-tx fee rate const feeLevelIndex = feeLevels.findIndex((feeLvl) => Math.max(1, rate) < feeLvl) - 1; - return normalColors[feeLevelIndex] || normalColors[mempoolFeeColors.length - 1]; + return normalColors[feeLevelIndex] || normalColors[defaultMempoolFeeColors.length - 1]; } } diff --git a/frontend/src/app/components/block-overview-graph/utils.ts b/frontend/src/app/components/block-overview-graph/utils.ts index b6c8ccf5e..2f23d4cb9 100644 --- a/frontend/src/app/components/block-overview-graph/utils.ts +++ b/frontend/src/app/components/block-overview-graph/utils.ts @@ -1,4 +1,4 @@ -import { feeLevels, mempoolFeeColors } from '../../app.constants'; +import { feeLevels, defaultMempoolFeeColors } from '../../app.constants'; import { Color } from './sprite-types'; import TxView from './tx-view'; @@ -38,7 +38,7 @@ export function setOpacity(color: Color, opacity: number): Color { } // precomputed colors -export const defaultFeeColors = mempoolFeeColors.map(hexToColor); +export const defaultFeeColors = defaultMempoolFeeColors.map(hexToColor); export const defaultAuditFeeColors = defaultFeeColors.map((color) => darken(desaturate(color, 0.3), 0.9)); export const defaultMarginalFeeColors = defaultFeeColors.map((color) => darken(desaturate(color, 0.8), 1.1)); export const defaultAuditColors = { @@ -58,7 +58,7 @@ export function defaultColorFunction( ): Color { const rate = tx.fee / tx.vsize; // color by simple single-tx fee rate const feeLevelIndex = feeLevels.findIndex((feeLvl) => Math.max(1, rate) < feeLvl) - 1; - const feeLevelColor = feeColors[feeLevelIndex] || feeColors[mempoolFeeColors.length - 1]; + const feeLevelColor = feeColors[feeLevelIndex] || feeColors[defaultMempoolFeeColors.length - 1]; // Normal mode if (!tx.scene?.highlightingEnabled) { if (tx.acc) { @@ -75,7 +75,7 @@ export function defaultColorFunction( case 'missing': case 'sigop': case 'rbf': - return marginalFeeColors[feeLevelIndex] || marginalFeeColors[mempoolFeeColors.length - 1]; + return marginalFeeColors[feeLevelIndex] || marginalFeeColors[defaultMempoolFeeColors.length - 1]; case 'fresh': case 'freshcpfp': return auditColors.missing; @@ -84,12 +84,12 @@ export function defaultColorFunction( case 'prioritized': return auditColors.prioritized; case 'selected': - return marginalFeeColors[feeLevelIndex] || marginalFeeColors[mempoolFeeColors.length - 1]; + return marginalFeeColors[feeLevelIndex] || marginalFeeColors[defaultMempoolFeeColors.length - 1]; case 'accelerated': return auditColors.accelerated; case 'found': if (tx.context === 'projected') { - return auditFeeColors[feeLevelIndex] || auditFeeColors[mempoolFeeColors.length - 1]; + return auditFeeColors[feeLevelIndex] || auditFeeColors[defaultMempoolFeeColors.length - 1]; } else { return feeLevelColor; } diff --git a/frontend/src/app/components/difficulty/difficulty.component.html b/frontend/src/app/components/difficulty/difficulty.component.html index c4983b8dd..ff31d4f57 100644 --- a/frontend/src/app/components/difficulty/difficulty.component.html +++ b/frontend/src/app/components/difficulty/difficulty.component.html @@ -101,47 +101,6 @@
New subsidy -
-
Remaining
-
- - {{ i }} blocks - {{ i }} block -
-
-
-
-
Estimate
-
- - - - - - - {{ epochData.change | absolute | number: '1.2-2' }} - % -
- -
-
-
- Previous: - - - - - - - - {{ epochData.previousRetarget | absolute | number: '1.2-2' }} % -
-
-
-
Current Period
-
{{ epochData.progress | number: '1.2-2' }} %
-
-
 
diff --git a/frontend/src/theme-contrast.scss b/frontend/src/theme-contrast.scss index a3d0bb9ca..57c8d2988 100644 --- a/frontend/src/theme-contrast.scss +++ b/frontend/src/theme-contrast.scss @@ -57,7 +57,7 @@ $dropdown-link-hover-bg: $active-bg; $dropdown-link-active-color: $fg; $dropdown-link-active-bg: $active-bg; -@import "~bootstrap/scss/bootstrap"; +@import "bootstrap/scss/bootstrap"; :root { --bg: #{$bg};