diff --git a/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.html b/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.html
index 5ac00e20..55f2ac31 100644
--- a/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.html
+++ b/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.html
@@ -12,11 +12,59 @@
Channel ID |
- {{nonRPeer.chan_id}} |
+ {{nonRPeer.chan_id}} |
Peer Alias |
- {{nonRPeer.remote_alias}} |
+ {{nonRPeer.remote_alias}} |
+
+
+ Peer Pubkey |
+ {{nonRPeer.remote_pubkey}} |
+
+
+ Channel Point |
+ {{nonRPeer.channel_point}} |
+
+
+ Uptime ({{timeUnit}}) |
+ {{nonRPeer.uptime_str}} |
+
+
+ Lifetime ({{timeUnit}}) |
+ {{nonRPeer.lifetime_str}} |
+
+
+ Commit Fee (Sats) |
+ {{nonRPeer.commit_fee | number}} |
+
+
+ Commit Weight |
+ {{nonRPeer.commit_weight | number}} |
+
+
+ Fee/KW |
+ {{nonRPeer.fee_per_kw | number}} |
+
+
+ Updates |
+ {{nonRPeer.num_updates | number}} |
+
+
+ Unsettled Balance (Sats) |
+ {{nonRPeer.unsettled_balance | number}} |
+
+
+ Capacity (Sats) |
+ {{nonRPeer.capacity | number}} |
+
+
+ Local Reserve (Sats) |
+ {{nonRPeer.local_chan_reserve_sat | number}} |
+
+
+ Remote Reserve (Sats) |
+ {{nonRPeer.remote_chan_reserve_sat | number}} |
Sats Sent |
diff --git a/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.scss b/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.scss
index 5db2c5aa..0119765d 100644
--- a/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.scss
+++ b/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.scss
@@ -1,10 +1,33 @@
-.mat-column-chan_id, .mat-column-alias {
- flex: 1 1 25%;
+@import "../../../shared/theme/styles/mixins.scss";
+
+.mat-column-chan_id, .mat-column-remote_alias, .mat-column-remote_pubkey, .mat-column-channel_point {
+ flex: 1 1 20%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
+.mat-column-uptime, .mat-column-lifetime, .mat-column-local_balance, .mat-column-remote_balance, .mat-column-total_satoshis_sent, .mat-column-total_satoshis_received {
+ flex: 1 1 10%;
+ width: 10%;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ @include for_screensize(tab-land) {
+ white-space: unset;
+ flex: 1 1 25%;
+ width: 25%;
+ }
+ @include for_screensize(tab-port) {
+ flex: 0 0 15%;
+ width: 15%;
+ }
+ @include for_screensize(phone) {
+ white-space: unset;
+ }
+}
+
+
.mat-column-actions {
min-height: 4.8rem;
}
diff --git a/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.ts b/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.ts
index bcbdd3d6..cf4040f2 100644
--- a/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.ts
+++ b/src/app/lnd/routing/non-routing-peers/non-routing-peers.component.ts
@@ -1,4 +1,5 @@
import { Component, OnInit, ViewChild, OnDestroy, AfterViewInit } from '@angular/core';
+import { DecimalPipe } from '@angular/common';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@@ -40,11 +41,12 @@ export class NonRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro
public errorMessage = '';
public filter = '';
public activeChannels: Channel[] = [];
+ public timeUnit = 'mins:secs';
public apiCallStatus: ApiCallStatusPayload | null = null;
public apiCallStatusEnum = APICallStatusEnum;
private unSubs: Array> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject()];
- constructor(private logger: LoggerService, private commonService: CommonService, private store: Store, private router: Router, private activatedRoute: ActivatedRoute) {
+ constructor(private logger: LoggerService, private commonService: CommonService, private store: Store, private router: Router, private activatedRoute: ActivatedRoute, private decimalPipe: DecimalPipe) {
this.screenSize = this.commonService.getScreenSize();
}
@@ -102,6 +104,57 @@ export class NonRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro
}
}
+ calculateUptime(channels: Channel[]) {
+ const minutesDivider = 60;
+ const hoursDivider = minutesDivider * 60;
+ const daysDivider = hoursDivider * 24;
+ const yearsDivider = daysDivider * 365;
+ let maxDivider = minutesDivider;
+ let minDivider = 1;
+ let max_uptime = 0;
+ channels.forEach((channel) => {
+ if (channel.uptime && +channel.uptime > max_uptime) {
+ max_uptime = +channel.uptime;
+ }
+ });
+ switch (true) {
+ case max_uptime < hoursDivider:
+ this.timeUnit = 'Mins:Secs';
+ maxDivider = minutesDivider;
+ minDivider = 1;
+ break;
+
+ case max_uptime >= hoursDivider && max_uptime < daysDivider:
+ this.timeUnit = 'Hrs:Mins';
+ maxDivider = hoursDivider;
+ minDivider = minutesDivider;
+ break;
+
+ case max_uptime >= daysDivider && max_uptime < yearsDivider:
+ this.timeUnit = 'Days:Hrs';
+ maxDivider = daysDivider;
+ minDivider = hoursDivider;
+ break;
+
+ case max_uptime > yearsDivider:
+ this.timeUnit = 'Yrs:Days';
+ maxDivider = yearsDivider;
+ minDivider = daysDivider;
+ break;
+
+ default:
+ this.timeUnit = 'Mins:Secs';
+ maxDivider = minutesDivider;
+ minDivider = 1;
+ break;
+ }
+ channels.forEach((channel) => {
+ channel.uptime_str = channel.uptime ? (this.decimalPipe.transform(Math.floor(+channel.uptime / maxDivider), '2.0-0') + ':' + this.decimalPipe.transform(Math.round((+channel.uptime % maxDivider) / minDivider), '2.0-0')) : '---';
+ channel.lifetime_str = channel.lifetime ? (this.decimalPipe.transform(Math.floor(+channel.lifetime / maxDivider), '2.0-0') + ':' + this.decimalPipe.transform(Math.round((+channel.lifetime % maxDivider) / minDivider), '2.0-0')) : '---';
+ });
+ return channels;
+ }
+
onManagePeer(selNonRoutingChannel: Channel) {
this.router.navigate(['../../', 'connections', 'channels', 'open'], { relativeTo: this.activatedRoute, state: { filter: selNonRoutingChannel.chan_id } });
}
@@ -134,7 +187,7 @@ export class NonRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro
loadNonRoutingPeersTable(forwardingEvents: ForwardingEvent[]) {
if (forwardingEvents.length > 0) {
// const grpdRoutingPeers = this.groupRoutingPeers(forwardingEvents);
- const filteredNonRoutingChannels = this.activeChannels?.filter((actvChnl) => forwardingEvents.findIndex((evnt) => (evnt.chan_id_in === actvChnl.chan_id || evnt.chan_id_out === actvChnl.chan_id)) < 0);
+ const filteredNonRoutingChannels = this.calculateUptime(this.activeChannels?.filter((actvChnl) => forwardingEvents.findIndex((evnt) => (evnt.chan_id_in === actvChnl.chan_id || evnt.chan_id_out === actvChnl.chan_id)) < 0));
this.NonRoutingPeers = new MatTableDataSource(filteredNonRoutingChannels);
this.NonRoutingPeers.sort = this.sort;
this.NonRoutingPeers.sort?.sort({ id: this.tableSetting.sortBy, start: this.tableSetting.sortOrder, disableClear: true });
diff --git a/src/app/shared/services/consts-enums-functions.ts b/src/app/shared/services/consts-enums-functions.ts
index 38a6ca1c..20bbc2d8 100644
--- a/src/app/shared/services/consts-enums-functions.ts
+++ b/src/app/shared/services/consts-enums-functions.ts
@@ -998,8 +998,8 @@ export const LND_TABLES_DEF = {
allowedColumns: ['chan_id', 'alias', 'events', 'total_amount']
},
non_routing_peers: {
- maxColumns: 6,
- allowedColumns: ['chan_id', 'remote_alias', 'total_satoshis_received', 'total_satoshis_sent', 'local_balance', 'remote_balance']
+ maxColumns: 8,
+ allowedColumns: ['chan_id', 'remote_alias', 'remote_pubkey', 'channel_point', 'uptime', 'lifetime', 'commit_fee', 'commit_weight', 'fee_per_kw', 'num_updates', 'unsettled_balance', 'capacity', 'local_chan_reserve_sat', 'remote_chan_reserve_sat', 'total_satoshis_sent', 'total_satoshis_received', 'local_balance', 'remote_balance']
}
},
reports: {