From 6e2f17b3d23a02768886af12de3a361d977273cf Mon Sep 17 00:00:00 2001 From: Mononaut Date: Wed, 20 Mar 2024 09:57:05 +0000 Subject: [PATCH] SSR: Fix more merge/version conflicts --- .../acceleration-fees-graph.component.html | 4 ++-- .../acceleration-fees-graph.component.ts | 8 +++++--- .../accelerator-dashboard.component.html | 12 +----------- .../accelerator-dashboard.component.ts | 8 ++++++-- .../address-graph/address-graph.component.html | 2 +- .../block-fee-rates-graph.component.html | 2 +- .../block-fee-rates-graph.component.ts | 6 +++--- .../block-overview-graph.component.ts | 2 +- frontend/src/app/components/block/block.component.ts | 3 +-- .../eight-blocks/eight-blocks.component.ts | 2 +- .../lbtc-pegs-graph/lbtc-pegs-graph.component.ts | 2 +- .../reserves-ratio/reserves-ratio.component.html | 2 +- .../mempool-block/mempool-block.component.ts | 3 +-- .../mining-dashboard/mining-dashboard.component.html | 2 +- frontend/src/app/dashboard/dashboard.component.html | 4 ++-- frontend/src/app/dashboard/dashboard.component.ts | 11 ++++++++--- .../nodes-channels-map.component.html | 8 +++++--- 17 files changed, 41 insertions(+), 40 deletions(-) diff --git a/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.html b/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.html index 0a567bd0a..cbebb0f86 100644 --- a/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.html +++ b/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.html @@ -45,10 +45,10 @@ -
-
+
diff --git a/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.ts b/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.ts index 43ad4b69e..edc206407 100644 --- a/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.ts +++ b/frontend/src/app/components/acceleration/acceleration-fees-graph/acceleration-fees-graph.component.ts @@ -1,5 +1,5 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, Input, LOCALE_ID, OnDestroy, OnInit } from '@angular/core'; -import { EChartsOption } from 'echarts'; +import { EChartsOption } from '../../../graphs/echarts'; import { Observable, Subscription, combineLatest, fromEvent, share } from 'rxjs'; import { startWith, switchMap, tap } from 'rxjs/operators'; import { SeoService } from '../../../services/seo.service'; @@ -11,6 +11,7 @@ import { MiningService } from '../../../services/mining.service'; import { ActivatedRoute } from '@angular/router'; import { Acceleration } from '../../../interfaces/node-api.interface'; import { ServicesApiServices } from '../../../services/services-api.service'; +import { StateService } from '../../../services/state.service'; @Component({ selector: 'app-acceleration-fees-graph', @@ -59,6 +60,7 @@ export class AccelerationFeesGraphComponent implements OnInit, OnDestroy { private storageService: StorageService, private miningService: MiningService, private route: ActivatedRoute, + public stateService: StateService, private cd: ChangeDetectorRef, ) { this.radioGroupForm = this.formBuilder.group({ dateSpan: '1y' }); @@ -176,10 +178,10 @@ export class AccelerationFeesGraphComponent implements OnInit, OnDestroy { padding: [10, 0, 0, 0], }, type: 'time', - boundaryGap: false, + boundaryGap: [0, 0], axisLine: { onZero: true }, axisLabel: { - formatter: val => formatterXAxisTimeCategory(this.locale, this.timespan, parseInt(val, 10)), + formatter: (val): string => formatterXAxisTimeCategory(this.locale, this.timespan, val), align: 'center', fontSize: 11, lineHeight: 12, diff --git a/frontend/src/app/components/acceleration/accelerator-dashboard/accelerator-dashboard.component.html b/frontend/src/app/components/acceleration/accelerator-dashboard/accelerator-dashboard.component.html index 5e049198a..147e07e69 100644 --- a/frontend/src/app/components/acceleration/accelerator-dashboard/accelerator-dashboard.component.html +++ b/frontend/src/app/components/acceleration/accelerator-dashboard/accelerator-dashboard.component.html @@ -42,7 +42,7 @@   -
+
@@ -66,16 +66,6 @@ - - -
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 4874067ec..d4df57020 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 @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, HostListener, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, HostListener, Inject, OnInit, PLATFORM_ID } from '@angular/core'; import { SeoService } from '../../../services/seo.service'; import { OpenGraphService } from '../../../services/opengraph.service'; import { WebsocketService } from '../../../services/websocket.service'; @@ -10,6 +10,7 @@ import { hexToColor } from '../../block-overview-graph/utils'; import TxView from '../../block-overview-graph/tx-view'; import { feeLevels, mempoolFeeColors } 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')); @@ -30,6 +31,7 @@ export class AcceleratorDashboardComponent implements OnInit { pendingAccelerations$: Observable; minedAccelerations$: Observable; loadingBlocks: boolean = true; + webGlEnabled = true; graphHeight: number = 300; @@ -39,7 +41,9 @@ export class AcceleratorDashboardComponent implements OnInit { private websocketService: WebsocketService, private serviceApiServices: ServicesApiServices, private stateService: StateService, + @Inject(PLATFORM_ID) private platformId: Object, ) { + this.webGlEnabled = this.stateService.isBrowser && detectWebGL(); this.seoService.setTitle($localize`:@@a681a4e2011bb28157689dbaa387de0dd0aa0c11:Accelerator Dashboard`); this.ogService.setManualOgImage('accelerator.jpg'); } @@ -48,7 +52,7 @@ export class AcceleratorDashboardComponent implements OnInit { this.onResize(); this.websocketService.want(['blocks', 'mempool-blocks', 'stats']); - this.pendingAccelerations$ = interval(30000).pipe( + this.pendingAccelerations$ = (this.stateService.isBrowser ? interval(30000) : of(null)).pipe( startWith(true), switchMap(() => { return this.serviceApiServices.getAccelerations$().pipe( diff --git a/frontend/src/app/components/address-graph/address-graph.component.html b/frontend/src/app/components/address-graph/address-graph.component.html index fa7b29a99..35808cb14 100644 --- a/frontend/src/app/components/address-graph/address-graph.component.html +++ b/frontend/src/app/components/address-graph/address-graph.component.html @@ -8,7 +8,7 @@
-
diff --git a/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.html b/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.html index 0e01d7b2d..9c27ecb83 100644 --- a/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.html +++ b/frontend/src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.html @@ -62,7 +62,7 @@
-
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 6c2a1fbaf..0abc55aa7 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 @@ -1,5 +1,5 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, Input, LOCALE_ID, NgZone, OnInit } from '@angular/core'; -import { EChartsOption, graphic } from 'echarts'; +import { echarts, EChartsOption } from '../../graphs/echarts'; import { Observable, combineLatest, of } from 'rxjs'; import { map, share, startWith, switchMap, tap } from 'rxjs/operators'; import { ApiService } from '../../services/api.service'; @@ -209,7 +209,7 @@ export class BlockFeeRatesGraphComponent implements OnInit { prepareChartOptions(data, weightMode) { this.chartOptions = { - color: this.widget ? ['#6b6b6b', new graphic.LinearGradient(0, 0, 0, 0.65, [ + color: this.widget ? ['#6b6b6b', new echarts.graphic.LinearGradient(0, 0, 0, 0.65, [ { offset: 0, color: '#F4511E' }, { offset: 0.25, color: '#FB8C00' }, { offset: 0.5, color: '#FFB300' }, @@ -282,7 +282,7 @@ export class BlockFeeRatesGraphComponent implements OnInit { legend: (this.widget || data.series.length === 0) ? undefined : { padding: [10, 75], data: data.legends, - selected: JSON.parse(this.storageService.getValue('fee_rates_legend')) ?? { + selected: JSON.parse(this.storageService.getValue('fee_rates_legend') || 'null') ?? { 'Min': true, '10th': true, '25th': true, diff --git a/frontend/src/app/components/block-overview-graph/block-overview-graph.component.ts b/frontend/src/app/components/block-overview-graph/block-overview-graph.component.ts index 522e819c5..ab6985a25 100644 --- a/frontend/src/app/components/block-overview-graph/block-overview-graph.component.ts +++ b/frontend/src/app/components/block-overview-graph/block-overview-graph.component.ts @@ -85,7 +85,7 @@ export class BlockOverviewGraphComponent implements AfterViewInit, OnDestroy, On readonly elRef: ElementRef, public stateService: StateService, ) { - this.webGlEnabled = detectWebGL(); + this.webGlEnabled = this.stateService.isBrowser && detectWebGL(); this.vertexArray = new FastVertexArray(512, TxSprite.dataSize); this.searchSubscription = this.stateService.searchText$.subscribe((text) => { this.searchText = text; diff --git a/frontend/src/app/components/block/block.component.ts b/frontend/src/app/components/block/block.component.ts index 5348f4296..2602c5ecd 100644 --- a/frontend/src/app/components/block/block.component.ts +++ b/frontend/src/app/components/block/block.component.ts @@ -17,7 +17,6 @@ import { seoDescriptionNetwork } from '../../shared/common.utils'; import { PriceService, Price } from '../../services/price.service'; import { CacheService } from '../../services/cache.service'; import { ServicesApiServices } from '../../services/services-api.service'; -import { isPlatformServer } from '@angular/common'; @Component({ selector: 'app-block', @@ -112,7 +111,7 @@ export class BlockComponent implements OnInit, OnDestroy { private cd: ChangeDetectorRef, @Inject(PLATFORM_ID) private platformId: Object, ) { - this.webGlEnabled = isPlatformServer(this.platformId) || detectWebGL(); + this.webGlEnabled = this.stateService.isBrowser && detectWebGL(); } ngOnInit() { diff --git a/frontend/src/app/components/eight-blocks/eight-blocks.component.ts b/frontend/src/app/components/eight-blocks/eight-blocks.component.ts index 96ab4dee9..81dcc4c5b 100644 --- a/frontend/src/app/components/eight-blocks/eight-blocks.component.ts +++ b/frontend/src/app/components/eight-blocks/eight-blocks.component.ts @@ -95,7 +95,7 @@ export class EightBlocksComponent implements OnInit, OnDestroy { private apiService: ApiService, private bytesPipe: BytesPipe, ) { - this.webGlEnabled = detectWebGL(); + this.webGlEnabled = this.stateService.isBrowser && detectWebGL(); } ngOnInit(): void { diff --git a/frontend/src/app/components/lbtc-pegs-graph/lbtc-pegs-graph.component.ts b/frontend/src/app/components/lbtc-pegs-graph/lbtc-pegs-graph.component.ts index bc3be513c..4359d8fa3 100644 --- a/frontend/src/app/components/lbtc-pegs-graph/lbtc-pegs-graph.component.ts +++ b/frontend/src/app/components/lbtc-pegs-graph/lbtc-pegs-graph.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, LOCALE_ID, ChangeDetectionStrategy, Input, OnChanges, OnInit } from '@angular/core'; import { formatDate, formatNumber } from '@angular/common'; -import { EChartsOption } from 'echarts'; +import { EChartsOption } from '../../graphs/echarts'; import { StateService } from '../../services/state.service'; @Component({ diff --git a/frontend/src/app/components/liquid-reserves-audit/reserves-ratio/reserves-ratio.component.html b/frontend/src/app/components/liquid-reserves-audit/reserves-ratio/reserves-ratio.component.html index 64e68624b..a453d854b 100644 --- a/frontend/src/app/components/liquid-reserves-audit/reserves-ratio/reserves-ratio.component.html +++ b/frontend/src/app/components/liquid-reserves-audit/reserves-ratio/reserves-ratio.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/frontend/src/app/components/mempool-block/mempool-block.component.ts b/frontend/src/app/components/mempool-block/mempool-block.component.ts index e972083a7..7f41faffb 100644 --- a/frontend/src/app/components/mempool-block/mempool-block.component.ts +++ b/frontend/src/app/components/mempool-block/mempool-block.component.ts @@ -8,7 +8,6 @@ import { Observable, BehaviorSubject } from 'rxjs'; import { SeoService } from '../../services/seo.service'; import { seoDescriptionNetwork } from '../../shared/common.utils'; import { WebsocketService } from '../../services/websocket.service'; -import { isPlatformServer } from '@angular/common'; @Component({ selector: 'app-mempool-block', @@ -33,7 +32,7 @@ export class MempoolBlockComponent implements OnInit, OnDestroy { private cd: ChangeDetectorRef, @Inject(PLATFORM_ID) private platformId: Object, ) { - this.webGlEnabled = isPlatformServer(this.platformId) || detectWebGL(); + this.webGlEnabled = this.stateService.isBrowser && detectWebGL(); } ngOnInit(): void { diff --git a/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html b/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html index 6cadddd6b..c4fca72eb 100644 --- a/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html +++ b/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html @@ -38,7 +38,7 @@
-
+
diff --git a/frontend/src/app/dashboard/dashboard.component.html b/frontend/src/app/dashboard/dashboard.component.html index 5fe1f6f2d..813589313 100644 --- a/frontend/src/app/dashboard/dashboard.component.html +++ b/frontend/src/app/dashboard/dashboard.component.html @@ -1,7 +1,7 @@
- +
Transaction Fees
@@ -29,7 +29,7 @@
-
+
(Tor nodes excluded)
-
-
+ +
+
+