Merge branch 'master' into mononaut/lightning-justice

This commit is contained in:
wiz
2023-07-18 16:49:49 +09:00
committed by GitHub
181 changed files with 18583 additions and 9153 deletions

View File

@@ -15,7 +15,7 @@
</div>
</div>
<div class="row">
<div class="col-md">
<div class="col-md table-col">
<a class="subtitle" [routerLink]="['/lightning/channel' | relativeUrl, channel.id]">{{ channel.id }}</a>
<table class="table table-borderless table-striped">
<tbody>

View File

@@ -1,3 +1,8 @@
.table-col {
max-width: calc(100% - 470px);
overflow: hidden;
}
.table {
font-size: 32px;
margin-top: 10px;

View File

@@ -1,3 +1,8 @@
.table-col {
max-width: calc(100% - 470px);
overflow: hidden;
}
.table {
margin-top: 6px;
font-size: 32px;
@@ -18,10 +23,6 @@
}
}
.table-col {
max-width: calc(100% - 470px);
}
.map-col {
flex-grow: 0;
flex-shrink: 0;

View File

@@ -21,7 +21,6 @@
</div>
<div class="box" *ngIf="!error">
<div class="row">
<div class="col-md">
<table class="table table-borderless table-striped table-fixed">
@@ -59,6 +58,9 @@
<td i18n="lightning.avg-distance" class="text-truncate">Avg channel distance</td>
<td class="direction-ltr">{{ avgDistance | amountShortener: 1 }} <span class="symbol">km</span> <span class="separator">·</span>{{ kmToMiles(avgDistance) | amountShortener: 1 }} <span class="symbol">mi</span></td>
</tr>
<tr *ngIf="!node.geolocation" class="d-none d-md-table-row">
<ng-container *ngTemplateOutlet="featurebits;context:{bits: node.featuresBits}"></ng-container>
</tr>
</tbody>
</table>
</div>
@@ -100,11 +102,50 @@
</td>
</ng-template>
</tr>
<tr *ngIf="node.geolocation && node.featuresBits">
<ng-container *ngTemplateOutlet="featurebits;context:{bits: node.featuresBits}"></ng-container>
</tr>
<tr *ngIf="!node.geolocation && node.featuresBits" class="d-table-row d-md-none">
<ng-container *ngTemplateOutlet="featurebits;context:{bits: node.featuresBits}"></ng-container>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<ng-template #featurebits let-bits="bits">
<td i18n="lightning.features" class="text-truncate label">Features</td>
<td class="d-flex justify-content-between">
<span class="text-truncate w-90">{{ bits }}</span>
<button type="button" class="btn btn-outline-info btn-xs" (click)="toggleFeatures()" i18n="transaction.details|Transaction Details">Details</button>
</td>
</ng-template>
<div class="box mt-2" *ngIf="!error && showFeatures">
<div class="row">
<div class="col-md">
<div class="mb-3">
<h5>Raw bits</h5>
<span class="text-wrap w-100"><small>{{ node.featuresBits }}</small></span>
</div>
<h5>Decoded</h5>
<table class="table table-borderless table-striped table-fixed">
<thead>
<th style="width: 13%">Bit</th>
<th>Name</th>
<th style="width: 25%; text-align: right">Required</th>
</thead>
<tbody>
<tr *ngFor="let feature of node.features">
<td style="width: 13%">{{ feature.bit }}</td>
<td>{{ feature.name }}</td>
<td style="width: 25%; text-align: right">{{ feature.is_required }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="input-group mt-3" *ngIf="!error && node.socketsObject.length">

View File

@@ -37,7 +37,7 @@ export class NodeComponent implements OnInit {
liquidityAd: ILiquidityAd;
tlvRecords: CustomRecord[];
avgChannelDistance$: Observable<number | null>;
showFeatures = false;
kmToMiles = kmToMiles;
constructor(
@@ -164,4 +164,9 @@ export class NodeComponent implements OnInit {
onLoadingEvent(e) {
this.channelListLoading = e;
}
toggleFeatures() {
this.showFeatures = !this.showFeatures;
return false;
}
}

View File

@@ -1,7 +1,7 @@
<div class="container-xl" style="min-height: 335px" [ngClass]="{'widget': widget, 'full-height': !widget}">
<h1 *ngIf="!widget" class="float-left" i18n="lightning.liquidity-ranking">Liquidity Ranking</h1>
<h1 *ngIf="!widget" class="float-left" i18n="lightning.connectivity-ranking">Connectivity Ranking</h1>
<div class="clearfix"></div>

View File

@@ -1,6 +1,7 @@
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
import { map, Observable } from 'rxjs';
import { INodesRanking, ITopNodesPerChannels } from '../../../interfaces/node-api.interface';
import { SeoService } from '../../../services/seo.service';
import { StateService } from '../../../services/state.service';
import { GeolocationData } from '../../../shared/components/geolocation/geolocation.component';
import { LightningApiService } from '../../lightning-api.service';
@@ -22,6 +23,7 @@ export class TopNodesPerChannels implements OnInit {
constructor(
private apiService: LightningApiService,
private stateService: StateService,
private seoService: SeoService,
) {}
ngOnInit(): void {
@@ -32,6 +34,8 @@ export class TopNodesPerChannels implements OnInit {
}
if (this.widget === false) {
this.seoService.setTitle($localize`:@@c50bf442cf99f6fc5f8b687c460f33234b879869:Connectivity Ranking`);
this.topNodesPerChannels$ = this.apiService.getTopNodesByChannels$().pipe(
map((ranking) => {
for (const i in ranking) {