From 058d15e67f85c3bae30e43ea3184d36871159daa Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Fri, 15 Jul 2022 14:25:36 +0000 Subject: [PATCH 1/5] Translate /frontend/src/locale/messages.xlf in pl review completed for the source file '/frontend/src/locale/messages.xlf' on the 'pl' language. --- frontend/src/locale/messages.pl.xlf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/src/locale/messages.pl.xlf b/frontend/src/locale/messages.pl.xlf index 67e48fcf7..a2be50b95 100644 --- a/frontend/src/locale/messages.pl.xlf +++ b/frontend/src/locale/messages.pl.xlf @@ -1997,6 +1997,7 @@ At block: + W bloku: src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts 188 @@ -2020,6 +2021,7 @@ Around block: + W okolicu bloku: src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts 190 @@ -2234,6 +2236,7 @@ Block Prediction Accuracy + Dokładność prognoz bloków src/app/components/block-prediction-graph/block-prediction-graph.component.html 5,7 @@ -2250,6 +2253,7 @@ Match rate + Częstość trafień src/app/components/block-prediction-graph/block-prediction-graph.component.ts 176,174 @@ -2867,6 +2871,7 @@ Usually places your transaction in between the second and third mempool blocks + Zazwyczaj umieszcza Twoją transakcje między drugim a trzecim blokiem w mempool src/app/components/fees-box/fees-box.component.html 8,9 @@ -2888,6 +2893,7 @@ Usually places your transaction in between the first and second mempool blocks + Zazwyczaj umieszcza Twoją transakcje między pierwszym a drugim blokiem w mempool src/app/components/fees-box/fees-box.component.html 9,10 @@ -3072,6 +3078,7 @@ Hashrate (MA) + Prędkość haszowania (MA) src/app/components/hashrate-chart/hashrate-chart.component.ts 288,287 @@ -3244,6 +3251,7 @@ Pools luck (1 week) + Szczęście kolektywu (1 tydzień) src/app/components/pool-ranking/pool-ranking.component.html 9 @@ -3252,6 +3260,7 @@ Pools luck + Szczęście kolektywu src/app/components/pool-ranking/pool-ranking.component.html 9,11 @@ -3260,6 +3269,7 @@ The overall luck of all mining pools over the past week. A luck bigger than 100% means the average block time for the current epoch is less than 10 minutes. + Ogólne szczęście wszystkich kolektywów wydobywczych w ciągu ostatniego tygodnia. Szczęście większe niż 100% oznacza, że średni czas bloku dla danej epoki jest mniejszy niż 10 minut. src/app/components/pool-ranking/pool-ranking.component.html 11,15 @@ -3268,6 +3278,7 @@ Pools count (1w) + Liczba kolektywów (1t) src/app/components/pool-ranking/pool-ranking.component.html 17 @@ -3276,6 +3287,7 @@ Pools count + Liczba kolektywów src/app/components/pool-ranking/pool-ranking.component.html 17,19 @@ -3284,6 +3296,7 @@ How many unique pools found at least one block over the past week. + Ile unikatowych kolektywów znalazło conajmniej jeden blok w ciągu ostatniego tygodnia. src/app/components/pool-ranking/pool-ranking.component.html 19,23 @@ -3309,6 +3322,7 @@ The number of blocks found over the past week. + Liczba bloków znalezionych w ciągu ostatniego tygodnia. src/app/components/pool-ranking/pool-ranking.component.html 27,31 @@ -4465,6 +4479,7 @@ REST API service + Usługa REST API src/app/docs/api-docs/api-docs.component.html 34,35 From 479f63575475c64da75ae2251de056a68a5bcccd Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sun, 24 Jul 2022 11:51:05 +0200 Subject: [PATCH 2/5] [Node page] Update channels count when switching between open/closed --- backend/src/api/explorer/nodes.api.ts | 7 +++++-- .../lightning/channels-list/channels-list.component.ts | 9 +++++++-- frontend/src/app/lightning/node/node.component.html | 7 ++++--- frontend/src/app/lightning/node/node.component.ts | 5 +++++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/backend/src/api/explorer/nodes.api.ts b/backend/src/api/explorer/nodes.api.ts index 3791b4c9d..ec8ee35fb 100644 --- a/backend/src/api/explorer/nodes.api.ts +++ b/backend/src/api/explorer/nodes.api.ts @@ -9,7 +9,10 @@ class NodesApi { geo_names_country.names as country, geo_names_subdivision.names as subdivision, (SELECT Count(*) FROM channels - WHERE channels.status < 2 AND ( channels.node1_public_key = ? OR channels.node2_public_key = ? )) AS channel_count, + WHERE channels.status = 2 AND ( channels.node1_public_key = ? OR channels.node2_public_key = ? )) AS channel_closed_count, + (SELECT Count(*) + FROM channels + WHERE channels.status < 2 AND ( channels.node1_public_key = ? OR channels.node2_public_key = ? )) AS channel_active_count, (SELECT Sum(capacity) FROM channels WHERE channels.status < 2 AND ( channels.node1_public_key = ? OR channels.node2_public_key = ? )) AS capacity, @@ -23,7 +26,7 @@ class NodesApi { LEFT JOIN geo_names geo_names_country on geo_names_country.id = country_id WHERE public_key = ? `; - const [rows]: any = await DB.query(query, [public_key, public_key, public_key, public_key, public_key, public_key, public_key]); + const [rows]: any = await DB.query(query, [public_key, public_key, public_key, public_key, public_key, public_key, public_key, public_key, public_key]); if (rows.length > 0) { rows[0].as_organization = JSON.parse(rows[0].as_organization); rows[0].subdivision = JSON.parse(rows[0].subdivision); diff --git a/frontend/src/app/lightning/channels-list/channels-list.component.ts b/frontend/src/app/lightning/channels-list/channels-list.component.ts index 0ac7da578..4060d36da 100644 --- a/frontend/src/app/lightning/channels-list/channels-list.component.ts +++ b/frontend/src/app/lightning/channels-list/channels-list.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, Input, OnChanges, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'; import { FormBuilder, FormGroup } from '@angular/forms'; import { BehaviorSubject, combineLatest, merge, Observable, of } from 'rxjs'; import { map, startWith, switchMap } from 'rxjs/operators'; @@ -12,6 +12,7 @@ import { LightningApiService } from '../lightning-api.service'; }) export class ChannelsListComponent implements OnInit, OnChanges { @Input() publicKey: string; + @Output() channelsStatusChangedEvent = new EventEmitter(); channels$: Observable; // @ts-ignore @@ -41,13 +42,17 @@ export class ChannelsListComponent implements OnInit, OnChanges { ngOnChanges(): void { this.channelStatusForm.get('status').setValue(this.defaultStatus, { emitEvent: false }) + this.channelsStatusChangedEvent.emit(this.defaultStatus); this.channels$ = combineLatest([ this.channelsPage$, this.channelStatusForm.get('status').valueChanges.pipe(startWith(this.defaultStatus)) ]) .pipe( - switchMap(([page, status]) =>this.lightningApiService.getChannelsByNodeId$(this.publicKey, (page -1) * this.itemsPerPage, status)), + switchMap(([page, status]) => { + this.channelsStatusChangedEvent.emit(status); + return this.lightningApiService.getChannelsByNodeId$(this.publicKey, (page -1) * this.itemsPerPage, status); + }), map((response) => { return { channels: response.body, diff --git a/frontend/src/app/lightning/node/node.component.html b/frontend/src/app/lightning/node/node.component.html index 68f5b31e0..d25ca569c 100644 --- a/frontend/src/app/lightning/node/node.component.html +++ b/frontend/src/app/lightning/node/node.component.html @@ -24,7 +24,7 @@ Total channels - {{ node.channel_count }} + {{ node.channel_active_count }} @@ -108,7 +108,7 @@
-

Channels ({{ node.channel_count }})

+

Channels ({{ channelsListStatus === 'open' ? node.channel_active_count : node.channel_closed_count }})

List 
- +
diff --git a/frontend/src/app/lightning/node/node.component.ts b/frontend/src/app/lightning/node/node.component.ts index a286aa987..f75ab6c95 100644 --- a/frontend/src/app/lightning/node/node.component.ts +++ b/frontend/src/app/lightning/node/node.component.ts @@ -18,6 +18,7 @@ export class NodeComponent implements OnInit { selectedSocketIndex = 0; qrCodeVisible = false; channelsListMode = 'list'; + channelsListStatus: string; constructor( private lightningApiService: LightningApiService, @@ -69,4 +70,8 @@ export class NodeComponent implements OnInit { this.channelsListMode = 'list'; } } + + onChannelsListStatusChanged(e) { + this.channelsListStatus = e; + } } From 886e7e663878722806dc0e91dfa36a53cc4dac6c Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sun, 24 Jul 2022 12:05:09 +0200 Subject: [PATCH 3/5] [Node page] Show message if there is no channels in the list to display --- .../lightning/channels-list/channels-list.component.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/lightning/channels-list/channels-list.component.html b/frontend/src/app/lightning/channels-list/channels-list.component.html index ff67788e1..82283f689 100644 --- a/frontend/src/app/lightning/channels-list/channels-list.component.html +++ b/frontend/src/app/lightning/channels-list/channels-list.component.html @@ -10,7 +10,7 @@ - +
@@ -19,7 +19,11 @@
- + + + +
No channels to display
+
From d9e85fdcb6af8ee90ea24ecb62f3f24dcf9c06e2 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sun, 24 Jul 2022 12:34:50 +0200 Subject: [PATCH 4/5] Show error message when the node public key does not exist --- .../app/lightning/node/node.component.html | 232 ++++++++++-------- .../src/app/lightning/node/node.component.ts | 12 +- 2 files changed, 136 insertions(+), 108 deletions(-) diff --git a/frontend/src/app/lightning/node/node.component.html b/frontend/src/app/lightning/node/node.component.html index d25ca569c..e2132bca5 100644 --- a/frontend/src/app/lightning/node/node.component.html +++ b/frontend/src/app/lightning/node/node.component.html @@ -1,128 +1,146 @@
-
+
-
+
+ No node found for public key "{{ node.public_key | shortenString : 12}}" + Back to the lightning dashboard +
-
-
- - - - - - - - - - - - - - - - - - - - - - - -
Total capacity - -
Total channels - {{ node.channel_active_count }} -
Average channel size - -
Location{{ node.city.en }}, {{ node.subdivision.en }}
{{ node.country.en }}
Location{{ node.country.en }}
-
-
-
- - - - - - - - - - - - - - - - - - - -
First seen - -
Last update - -
Color
{{ node.color }}
ISP - {{ node.as_organization }} [ASN {{node.as_number}}] -
-
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Total capacity + + +
Total channels + {{ node.channel_active_count }} +
Average channel size + + +
Location{{ node.city.en }}, {{ node.subdivision.en }}
{{ node.country.en }}
Location{{ node.country.en }}
+
+
+
+ + + + + + + + + + + + + + + + + + + +
First seen + +
Last update + +
Color +
{{ node.color }}
+
ISP + {{ node.as_organization }} [ASN {{node.as_number}}] +
-
-
+
-
-
- -
- -
+
+ +
+
+ +
+
- - {{ node.socketsObject[selectedSocketIndex].label }} - - - -
+ + {{ node.socketsObject[selectedSocketIndex].label }} + + + + +
-
+
- + + +
+ +
+

Channels ({{ channelsListStatus === 'open' ? node.channel_active_count : node.channel_closed_count }})

+
+ List  + +  Map +
+
+ + + + -
- -
-

Channels ({{ channelsListStatus === 'open' ? node.channel_active_count : node.channel_closed_count }})

-
- List  - -  Map -
-
- - - -
-
+
\ No newline at end of file diff --git a/frontend/src/app/lightning/node/node.component.ts b/frontend/src/app/lightning/node/node.component.ts index f75ab6c95..c70983b54 100644 --- a/frontend/src/app/lightning/node/node.component.ts +++ b/frontend/src/app/lightning/node/node.component.ts @@ -1,7 +1,7 @@ import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; import { ActivatedRoute, ParamMap } from '@angular/router'; import { Observable } from 'rxjs'; -import { map, switchMap } from 'rxjs/operators'; +import { catchError, map, switchMap } from 'rxjs/operators'; import { SeoService } from 'src/app/services/seo.service'; import { LightningApiService } from '../lightning-api.service'; @@ -19,6 +19,8 @@ export class NodeComponent implements OnInit { qrCodeVisible = false; channelsListMode = 'list'; channelsListStatus: string; + error: Error; + publicKey: string; constructor( private lightningApiService: LightningApiService, @@ -30,6 +32,7 @@ export class NodeComponent implements OnInit { this.node$ = this.activatedRoute.paramMap .pipe( switchMap((params: ParamMap) => { + this.publicKey = params.get('public_key'); return this.lightningApiService.getNode$(params.get('public_key')); }), map((node) => { @@ -56,6 +59,13 @@ export class NodeComponent implements OnInit { node.socketsObject = socketsObject; return node; }), + catchError(err => { + this.error = err; + return [{ + alias: this.publicKey, + public_key: this.publicKey, + }]; + }) ); } From 44725d9b298a154776bf42ffa7ff8ed1c7183853 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sun, 24 Jul 2022 15:08:48 +0200 Subject: [PATCH 5/5] Remove duplicated nodes from the world map --- .../nodes-channels-map.component.ts | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.ts b/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.ts index fd9956d38..7963cf544 100644 --- a/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.ts +++ b/frontend/src/app/lightning/nodes-channels-map/nodes-channels-map.component.ts @@ -57,20 +57,26 @@ export class NodesChannelsMap implements OnInit, OnDestroy { const channelsLoc = []; const nodes = []; + const nodesPubkeys = {}; for (const channel of data[1]) { channelsLoc.push([[channel[2], channel[3]], [channel[6], channel[7]]]); - nodes.push({ - publicKey: channel[0], - name: channel[1], - value: [channel[2], channel[3]], - }); - nodes.push({ - publicKey: channel[4], - name: channel[5], - value: [channel[6], channel[7]], - }); + if (!nodesPubkeys[channel[0]]) { + nodes.push({ + publicKey: channel[0], + name: channel[1], + value: [channel[2], channel[3]], + }); + nodesPubkeys[channel[0]] = true; + } + if (!nodesPubkeys[channel[4]]) { + nodes.push({ + publicKey: channel[4], + name: channel[5], + value: [channel[6], channel[7]], + }); + nodesPubkeys[channel[4]] = true; + } } - this.prepareChartOptions(nodes, channelsLoc); })); }) @@ -100,7 +106,7 @@ export class NodesChannelsMap implements OnInit, OnDestroy { postEffect: { enable: true, bloom: { - intensity: this.style === 'nodepage' ? 0.1 : 0.01, + intensity: 0.1, } }, viewControl: { @@ -113,10 +119,10 @@ export class NodesChannelsMap implements OnInit, OnDestroy { zoomSensivity: 0.5, }, itemStyle: { - color: '#FFFFFF', + color: 'white', opacity: 0.02, borderWidth: 1, - borderColor: '#00000050', + borderColor: 'black', }, regionHeight: 0.01, },