From 0f6aec31fd839394d3d9bcc92b75ef7f765ba69b Mon Sep 17 00:00:00 2001 From: nymkappa Date: Mon, 22 Aug 2022 16:55:54 +0200 Subject: [PATCH] Update node ranking naming convention Matches ln dashboard layout with mining dashboard --- backend/src/api/explorer/nodes.routes.ts | 4 ++-- .../src/app/lightning/lightning-api.service.ts | 4 ++-- .../lightning-dashboard.component.html | 16 ++++++++-------- .../app/lightning/lightning.routing.module.ts | 4 ++-- .../top-nodes-per-capacity.component.html | 4 ++-- .../top-nodes-per-capacity.component.ts | 5 +++-- .../top-nodes-per-channels.component.html | 4 ++-- .../top-nodes-per-channels.component.ts | 5 +++-- .../nodes-rankings-dashboard.component.html | 8 ++++---- 9 files changed, 28 insertions(+), 26 deletions(-) diff --git a/backend/src/api/explorer/nodes.routes.ts b/backend/src/api/explorer/nodes.routes.ts index c5b442723..7a5ff880a 100644 --- a/backend/src/api/explorer/nodes.routes.ts +++ b/backend/src/api/explorer/nodes.routes.ts @@ -15,8 +15,8 @@ class NodesRoutes { .get(config.MEMPOOL.API_URL_PREFIX + 'lightning/nodes/isp/:isp', this.$getNodesPerISP) .get(config.MEMPOOL.API_URL_PREFIX + 'lightning/nodes/countries', this.$getNodesCountries) .get(config.MEMPOOL.API_URL_PREFIX + 'lightning/nodes/rankings', this.$getNodesRanking) - .get(config.MEMPOOL.API_URL_PREFIX + 'lightning/nodes/rankings/capacity', this.$getTopNodesByCapacity) - .get(config.MEMPOOL.API_URL_PREFIX + 'lightning/nodes/rankings/channels', this.$getTopNodesByChannels) + .get(config.MEMPOOL.API_URL_PREFIX + 'lightning/nodes/rankings/liquidity', this.$getTopNodesByCapacity) + .get(config.MEMPOOL.API_URL_PREFIX + 'lightning/nodes/rankings/connectivity', this.$getTopNodesByChannels) .get(config.MEMPOOL.API_URL_PREFIX + 'lightning/nodes/rankings/age', this.$getOldestNodes) .get(config.MEMPOOL.API_URL_PREFIX + 'lightning/nodes/:public_key/statistics', this.$getHistoricalNodeStats) .get(config.MEMPOOL.API_URL_PREFIX + 'lightning/nodes/:public_key', this.$getNode) diff --git a/frontend/src/app/lightning/lightning-api.service.ts b/frontend/src/app/lightning/lightning-api.service.ts index f14b0b382..1963235ef 100644 --- a/frontend/src/app/lightning/lightning-api.service.ts +++ b/frontend/src/app/lightning/lightning-api.service.ts @@ -66,13 +66,13 @@ export class LightningApiService { getTopNodesByCapacity$(): Observable { return this.httpClient.get( - this.apiBasePath + '/api/v1/lightning/nodes/rankings/capacity' + this.apiBasePath + '/api/v1/lightning/nodes/rankings/liquidity' ); } getTopNodesByChannels$(): Observable { return this.httpClient.get( - this.apiBasePath + '/api/v1/lightning/nodes/rankings/channels' + this.apiBasePath + '/api/v1/lightning/nodes/rankings/connectivity' ); } diff --git a/frontend/src/app/lightning/lightning-dashboard/lightning-dashboard.component.html b/frontend/src/app/lightning/lightning-dashboard/lightning-dashboard.component.html index fe678a2fc..f6f083f41 100644 --- a/frontend/src/app/lightning/lightning-dashboard/lightning-dashboard.component.html +++ b/frontend/src/app/lightning/lightning-dashboard/lightning-dashboard.component.html @@ -37,7 +37,7 @@ @@ -49,17 +49,17 @@
Lightning network history
- +
-
+
- -
Top capacity nodes
+
+
Liquidity ranking
 
@@ -70,10 +70,10 @@
-
+
- -
Most connected nodes
+
+
Connectivity ranking
 
diff --git a/frontend/src/app/lightning/lightning.routing.module.ts b/frontend/src/app/lightning/lightning.routing.module.ts index 13fd20b6a..173bae237 100644 --- a/frontend/src/app/lightning/lightning.routing.module.ts +++ b/frontend/src/app/lightning/lightning.routing.module.ts @@ -39,14 +39,14 @@ const routes: Routes = [ component: NodesRankingsDashboard, }, { - path: 'nodes/top-capacity', + path: 'nodes/rankings/liquidity', component: NodesRanking, data: { type: 'capacity' }, }, { - path: 'nodes/top-channels', + path: 'nodes/rankings/connectivity', component: NodesRanking, data: { type: 'channels' diff --git a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.html b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.html index a9043f9d1..107609251 100644 --- a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.html +++ b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.html @@ -1,6 +1,6 @@
-

- Top 100 nodes by capacity +

+ Top 100 nodes liquidity ranking

diff --git a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.ts b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.ts index 2d90817f9..c79c396ee 100644 --- a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.ts +++ b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.ts @@ -1,6 +1,7 @@ import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; import { map, Observable } from 'rxjs'; import { INodesRanking, ITopNodesPerCapacity } from 'src/app/interfaces/node-api.interface'; +import { isMobile } from 'src/app/shared/common.utils'; import { LightningApiService } from '../../lightning-api.service'; @Component({ @@ -19,7 +20,7 @@ export class TopNodesPerCapacity implements OnInit { constructor(private apiService: LightningApiService) {} ngOnInit(): void { - for (let i = 1; i <= (this.widget ? 10 : 100); ++i) { + for (let i = 1; i <= (this.widget ? (isMobile() ? 8 : 7) : 100); ++i) { this.skeletonRows.push(i); } @@ -28,7 +29,7 @@ export class TopNodesPerCapacity implements OnInit { } else { this.topNodesPerCapacity$ = this.nodes$.pipe( map((ranking) => { - return ranking.topByCapacity.slice(0, 10); + return ranking.topByCapacity.slice(0, isMobile() ? 8 : 7); }) ); } diff --git a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.html b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.html index 72c2aa5b1..dd05e7a6a 100644 --- a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.html +++ b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.html @@ -1,6 +1,6 @@
-

- Top 100 nodes by channel count +

+ Top 100 nodes connectivity ranking

diff --git a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.ts b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.ts index c2821c596..44e7aa518 100644 --- a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.ts +++ b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.ts @@ -1,6 +1,7 @@ import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; import { map, Observable } from 'rxjs'; import { INodesRanking, ITopNodesPerChannels } from 'src/app/interfaces/node-api.interface'; +import { isMobile } from 'src/app/shared/common.utils'; import { LightningApiService } from '../../lightning-api.service'; @Component({ @@ -19,7 +20,7 @@ export class TopNodesPerChannels implements OnInit { constructor(private apiService: LightningApiService) {} ngOnInit(): void { - for (let i = 1; i <= (this.widget ? 10 : 100); ++i) { + for (let i = 1; i <= (this.widget ? (isMobile() ? 8 : 7) : 100); ++i) { this.skeletonRows.push(i); } @@ -28,7 +29,7 @@ export class TopNodesPerChannels implements OnInit { } else { this.topNodesPerChannels$ = this.nodes$.pipe( map((ranking) => { - return ranking.topByChannels.slice(0, 10); + return ranking.topByChannels.slice(0, isMobile() ? 8 : 7); }) ); } diff --git a/frontend/src/app/lightning/nodes-rankings-dashboard/nodes-rankings-dashboard.component.html b/frontend/src/app/lightning/nodes-rankings-dashboard/nodes-rankings-dashboard.component.html index 93f7d1fc3..97802a1d9 100644 --- a/frontend/src/app/lightning/nodes-rankings-dashboard/nodes-rankings-dashboard.component.html +++ b/frontend/src/app/lightning/nodes-rankings-dashboard/nodes-rankings-dashboard.component.html @@ -4,8 +4,8 @@