From b512123f59dab836283e1f6b7b1015d2c54dc0a4 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Thu, 23 Feb 2023 18:36:13 +0900 Subject: [PATCH] Fix design for node channels ranking --- .../lightning-dashboard.component.html | 2 +- .../top-nodes-per-capacity.component.scss | 22 ----- .../top-nodes-per-capacity.component.ts | 10 +- .../top-nodes-per-channels.component.html | 89 +++++++---------- .../top-nodes-per-channels.component.scss | 99 ++++++------------- .../top-nodes-per-channels.component.ts | 5 + 6 files changed, 74 insertions(+), 153 deletions(-) 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 c00a4be58..b73d21bcd 100644 --- a/frontend/src/app/lightning/lightning-dashboard/lightning-dashboard.component.html +++ b/frontend/src/app/lightning/lightning-dashboard/lightning-dashboard.component.html @@ -69,7 +69,7 @@ -
+
diff --git a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.scss b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.scss index d177a8b01..b7ed8cf04 100644 --- a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.scss +++ b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-capacity/top-nodes-per-capacity.component.scss @@ -1,9 +1,3 @@ -.spinner-border { - height: 25px; - width: 25px; - margin-top: 13px; -} - .container-xl { max-width: 1400px; } @@ -12,13 +6,6 @@ padding-left: 0px; padding-bottom: 0px; } -.container-xl.legacy { - max-width: 1140px; -} - -.container { - max-width: 100%; -} tr, td, th { border: 0px; @@ -30,15 +17,6 @@ tr, td, th { color: white; } -.disabled { - pointer-events: none; - opacity: 0.5; -} - -.progress { - background-color: #2d3348; -} - .pool { width: 15%; @media (max-width: 576px) { 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 489ba9b21..4925256c0 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,9 +1,8 @@ -import { ChangeDetectionStrategy, Component, Input, OnDestroy, OnInit } from '@angular/core'; -import { map, Observable, Subscription } from 'rxjs'; +import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; +import { map, Observable } from 'rxjs'; import { StateService } from 'src/app/services/state.service'; import { INodesRanking, ITopNodesPerCapacity } from '../../../interfaces/node-api.interface'; import { SeoService } from '../../../services/seo.service'; -import { isMobile } from '../../../shared/common.utils'; import { GeolocationData } from '../../../shared/components/geolocation/geolocation.component'; import { LightningApiService } from '../../lightning-api.service'; @@ -13,7 +12,7 @@ import { LightningApiService } from '../../lightning-api.service'; styleUrls: ['./top-nodes-per-capacity.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class TopNodesPerCapacity implements OnInit, OnDestroy { +export class TopNodesPerCapacity implements OnInit { @Input() nodes$: Observable; @Input() widget: boolean = false; @@ -27,9 +26,6 @@ export class TopNodesPerCapacity implements OnInit, OnDestroy { private stateService: StateService, ) {} - ngOnDestroy(): void { - } - ngOnInit(): void { this.currency$ = this.stateService.fiatCurrency$; 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 7d02e510f..ccb6a48fe 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,71 +1,56 @@ -
-

- Top 100 nodes connectivity ranking -

-
+ +
+

Liquidity Ranking

+ +
+ +
- - - - - - + + + + + + - - - + + - - - - + - - - + - - - - - - - - - - - - -
AliasChannelsLiquidityFirst seenLast updateLocationChannelsCapacity{{ currency$ | async }}First seenLast updateLocation
- {{ i + 1 }} +
+ - {{ node.alias }} - + {{ node.channels | number }} + + + + + +
- - - - - - - - - - - - - -
+ + +
+
+
-
\ No newline at end of file + +
diff --git a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.scss b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.scss index 59151f6b2..b7ed8cf04 100644 --- a/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.scss +++ b/frontend/src/app/lightning/nodes-ranking/top-nodes-per-channels/top-nodes-per-channels.component.scss @@ -1,91 +1,48 @@ .container-xl { max-width: 1400px; - padding-bottom: 100px; - @media (min-width: 960px) { - padding-left: 50px; - padding-right: 50px; - } +} +.container-xl.widget { + padding-right: 0px; + padding-left: 0px; + padding-bottom: 0px; } -.table td, .table th { - padding: 0.5rem; +tr, td, th { + border: 0px; + padding-top: 0.65rem !important; + padding-bottom: 0.7rem !important; } -.full .rank { - width: 5%; -} -.widget .rank { - @media (min-width: 960px) { - width: 13%; - } - @media (max-width: 960px) { - padding-left: 0px; - padding-right: 0px; - } +.clear-link { + color: white; } -.full .alias { - width: 20%; +.pool { + width: 15%; + @media (max-width: 576px) { + width: 75%; + } overflow: hidden; text-overflow: ellipsis; - max-width: 350px; - @media (max-width: 960px) { - width: 40%; - max-width: 500px; - } + white-space: nowrap; + max-width: 160px; } -.widget .alias { - width: 60%; - overflow: hidden; +.pool-name { + display: inline-block; + vertical-align: text-top; text-overflow: ellipsis; - max-width: 350px; - @media (max-width: 960px) { - max-width: 175px; - } + overflow: hidden; } -.full .capacity { +.liquidity { width: 10%; - @media (max-width: 960px) { - width: 30%; - } -} -.widget .capacity { - width: 32%; - @media (max-width: 960px) { - padding-left: 0px; - padding-right: 0px; + @media (max-width: 576px) { + width: 25%; } } -.full .channels { +.fiat { width: 15%; - padding-right: 50px; - @media (max-width: 960px) { - display: none; - } + font-family: monospace; + font-size: 14px; } - -.full .timestamp-first { - width: 10%; - @media (max-width: 960px) { - display: none; - } -} - -.full .timestamp-update { - width: 10%; - @media (max-width: 960px) { - display: none; - } -} - -.full .location { - width: 15%; - @media (max-width: 960px) { - width: 30%; - } - @media (max-width: 600px) { - display: none; - } -} \ No newline at end of file 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 ac67787e6..f1740e5bc 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,5 +1,6 @@ import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; import { map, Observable } from 'rxjs'; +import { StateService } from 'src/app/services/state.service'; import { INodesRanking, ITopNodesPerChannels } from '../../../interfaces/node-api.interface'; import { isMobile } from '../../../shared/common.utils'; import { GeolocationData } from '../../../shared/components/geolocation/geolocation.component'; @@ -17,12 +18,16 @@ export class TopNodesPerChannels implements OnInit { topNodesPerChannels$: Observable; skeletonRows: number[] = []; + currency$: Observable; constructor( private apiService: LightningApiService, + private stateService: StateService, ) {} ngOnInit(): void { + this.currency$ = this.stateService.fiatCurrency$; + for (let i = 1; i <= (this.widget ? (isMobile() ? 8 : 6) : 100); ++i) { this.skeletonRows.push(i); }