[lightning] show decoded features in node page

This commit is contained in:
nymkappa 2023-07-08 10:43:37 +02:00
parent 556eb65320
commit 6336c529ed
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04
2 changed files with 33 additions and 2 deletions

View File

@ -118,10 +118,36 @@
<td i18n="lightning.features" class="text-truncate label">Features</td> <td i18n="lightning.features" class="text-truncate label">Features</td>
<td class="d-flex justify-content-between"> <td class="d-flex justify-content-between">
<span class="text-truncate w-90">{{ bits }}</span> <span class="text-truncate w-90">{{ bits }}</span>
<a href="#" class="w-10"></a> <a href="#" class="w-10" (click)="toggleFeatures()"></a>
</td> </td>
</ng-template> </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"> <div class="input-group mt-3" *ngIf="!error && node.socketsObject.length">
<div class="d-inline-block" ngbDropdown #myDrop="ngbDropdown" <div class="d-inline-block" ngbDropdown #myDrop="ngbDropdown"
*ngIf="node.socketsObject.length > 1; else noDropdown"> *ngIf="node.socketsObject.length > 1; else noDropdown">

View File

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