lnd pending channels page layout

pull/1127/head
ShahanaFarooqui 2 years ago
parent cc1cda3e56
commit 5c79a078fa

@ -94,9 +94,6 @@ export const validatePageSettings = (documentToValidate) => {
if (!table.hasOwnProperty(CollectionFieldsEnum.SORT_ORDER)) {
errMsg = errMsg + 'Sort Order is mandatory.';
}
if (!table.hasOwnProperty(CollectionFieldsEnum.RECORDS_PER_PAGE)) {
errMsg = errMsg + 'Records/Page is mandatory.';
}
if (!table.hasOwnProperty(CollectionFieldsEnum.COLUMN_SELECTION_SM)) {
errMsg = errMsg + 'Column Selection (Mobile) is mandatory.';
}

@ -105,9 +105,6 @@ export const validatePageSettings = (documentToValidate): any => {
if (!table.hasOwnProperty(CollectionFieldsEnum.SORT_ORDER)) {
errMsg = errMsg + 'Sort Order is mandatory.';
}
if (!table.hasOwnProperty(CollectionFieldsEnum.RECORDS_PER_PAGE)) {
errMsg = errMsg + 'Records/Page is mandatory.';
}
if (!table.hasOwnProperty(CollectionFieldsEnum.COLUMN_SELECTION_SM)) {
errMsg = errMsg + 'Column Selection (Mobile) is mandatory.';
}

@ -11,7 +11,27 @@
<table mat-table #table fxFlex="100" [dataSource]="pendingOpenChannels" matSort [ngClass]="{'error-border bordered-box': errorMessage !== '','bordered-box': true}">
<ng-container matColumnDef="remote_alias">
<mat-header-cell *matHeaderCellDef mat-sort-header> Peer </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '30rem'}">{{channel.channel.remote_alias}}</mat-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.remote_alias}}</mat-cell>
</ng-container>
<ng-container matColumnDef="remote_node_pub">
<mat-header-cell *matHeaderCellDef mat-sort-header> Pubkey </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.remote_node_pub}}</mat-cell>
</ng-container>
<ng-container matColumnDef="channel_point">
<mat-header-cell *matHeaderCellDef mat-sort-header> Channel </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.channel_point}}</mat-cell>
</ng-container>
<ng-container matColumnDef="initiator">
<mat-header-cell *matHeaderCellDef mat-sort-header> Initiator </mat-header-cell>
<mat-cell *matCellDef="let channel">{{channel.channel.initiator}}</mat-cell>
</ng-container>
<ng-container matColumnDef="commitment_type">
<mat-header-cell *matHeaderCellDef mat-sort-header> Commitment Type </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.commitment_type}}</mat-cell>
</ng-container>
<ng-container matColumnDef="confirmation_height">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Confirmation Height</mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.confirmation_height | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="commit_fee">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Commit Fee (Sats) </mat-header-cell>
@ -21,10 +41,22 @@
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Commit Weight </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.commit_weight | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="fee_per_kw">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Fee/KW</mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.fee_per_kw | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="capacity">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Capacity (Sats)</mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.capacity | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="local_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Local Balance (Sats)</mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.local_balance | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="remote_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Remote Balance (Sats)</mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.remote_balance | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="actions">
<mat-header-cell fxLayoutAlign="end center" class="pl-3 pr-4" *matHeaderCellDef>
<div class="bordered-box table-actions-select" fxLayoutAlign="center center">Actions</div>
@ -59,22 +91,58 @@
</mat-expansion-panel-header>
<div [perfectScrollbar] fxLayout="column" fxLayoutAlign="start center" fxFlex="100" class="table-container">
<table mat-table #table [dataSource]="pendingForceClosingChannels" matSort [ngClass]="{'error-border bordered-box': errorMessage !== '','bordered-box': true}">
<ng-container matColumnDef="closing_txid">
<mat-header-cell *matHeaderCellDef mat-sort-header> Closing Tx Id </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.closing_txid}}</mat-cell>
</ng-container>
<ng-container matColumnDef="remote_alias">
<mat-header-cell *matHeaderCellDef mat-sort-header> Peer </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '30rem'}">{{channel.channel.remote_alias}}</mat-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.remote_alias}}</mat-cell>
</ng-container>
<ng-container matColumnDef="recovered_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Recovered Balance (Sats) </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.recovered_balance | number}}</mat-cell>
<ng-container matColumnDef="remote_node_pub">
<mat-header-cell *matHeaderCellDef mat-sort-header> Pubkey </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.remote_node_pub}}</mat-cell>
</ng-container>
<ng-container matColumnDef="channel_point">
<mat-header-cell *matHeaderCellDef mat-sort-header> Channel </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.channel_point}}</mat-cell>
</ng-container>
<ng-container matColumnDef="initiator">
<mat-header-cell *matHeaderCellDef mat-sort-header> Initiator </mat-header-cell>
<mat-cell *matCellDef="let channel">{{channel.channel.initiator}}</mat-cell>
</ng-container>
<ng-container matColumnDef="commitment_type">
<mat-header-cell *matHeaderCellDef mat-sort-header> Commitment Type </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.commitment_type}}</mat-cell>
</ng-container>
<ng-container matColumnDef="limbo_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Limbo Balance (Sats) </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.limbo_balance | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="maturity_height">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Maturity Height</mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.maturity_height | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="blocks_til_maturity">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Blocks till Maturity</mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.blocks_til_maturity | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="recovered_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Recovered Balance (Sats) </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.recovered_balance | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="capacity">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Capacity (Sats) </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.capacity | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="local_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Local Balance (Sats)</mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.local_balance | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="remote_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Remote Balance (Sats)</mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.remote_balance | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="actions">
<mat-header-cell fxLayoutAlign="end center" class="pl-4 pr-3" *matHeaderCellDef>
<div class="bordered-box table-actions-select" fxLayoutAlign="center center">Actions</div>
@ -102,29 +170,42 @@
<mat-panel-title>Pending Closing ({{pendingClosingChannelsLength}})</mat-panel-title>
</mat-expansion-panel-header>
<div [perfectScrollbar] fxLayout="column" fxLayoutAlign="start center" fxFlex="100" class="table-container">
<table mat-table #table [dataSource]="pendingClosingChannels" matSort
[ngClass]="{'error-border bordered-box': errorMessage !== '','bordered-box': true}">
<table mat-table #table [dataSource]="pendingClosingChannels" matSort [ngClass]="{'error-border bordered-box': errorMessage !== '','bordered-box': true}">
<ng-container matColumnDef="closing_txid">
<mat-header-cell *matHeaderCellDef mat-sort-header> Closing Tx Id </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.closing_txid}}</mat-cell>
</ng-container>
<ng-container matColumnDef="remote_alias">
<mat-header-cell class="pl-2" *matHeaderCellDef mat-sort-header> Peer </mat-header-cell>
<mat-cell class="pl-2" *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '30rem'}">{{channel.channel.remote_alias}}</mat-cell>
<mat-header-cell *matHeaderCellDef mat-sort-header> Peer </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.remote_alias}}</mat-cell>
</ng-container>
<ng-container matColumnDef="local_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Local Balance (Sats) </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.local_balance |
number}}</mat-cell>
<ng-container matColumnDef="remote_node_pub">
<mat-header-cell *matHeaderCellDef mat-sort-header> Pubkey </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.remote_node_pub}}</mat-cell>
</ng-container>
<ng-container matColumnDef="remote_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Remote Balance (Sats) </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.remote_balance |
number}}</mat-cell>
<ng-container matColumnDef="channel_point">
<mat-header-cell *matHeaderCellDef mat-sort-header> Channel </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.channel_point}}</mat-cell>
</ng-container>
<ng-container matColumnDef="initiator">
<mat-header-cell *matHeaderCellDef mat-sort-header> Initiator </mat-header-cell>
<mat-cell *matCellDef="let channel">{{channel.channel.initiator}}</mat-cell>
</ng-container>
<ng-container matColumnDef="commitment_type">
<mat-header-cell *matHeaderCellDef mat-sort-header> Commitment Type </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.commitment_type}}</mat-cell>
</ng-container>
<ng-container matColumnDef="capacity">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Capacity (Sats) </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.capacity |
number}}</mat-cell>
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Capacity (Sats) </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.capacity | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="local_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Local Balance (Sats)</mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.local_balance | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="remote_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Remote Balance (Sats)</mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.remote_balance | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="actions">
<mat-header-cell fxLayoutAlign="end center" class="pl-4 pr-3" *matHeaderCellDef>
@ -153,35 +234,42 @@
<mat-panel-title>Waiting Close ({{pendingWaitClosingChannelsLength}})</mat-panel-title>
</mat-expansion-panel-header>
<div [perfectScrollbar] fxLayout="column" fxLayoutAlign="start center" fxFlex="100" class="table-container">
<table mat-table #table [dataSource]="pendingWaitClosingChannels" matSort
[ngClass]="{'error-border bordered-box': errorMessage !== '','bordered-box': true}">
<table mat-table #table [dataSource]="pendingWaitClosingChannels" matSort [ngClass]="{'error-border bordered-box': errorMessage !== '','bordered-box': true}">
<ng-container matColumnDef="remote_alias">
<mat-header-cell class="pl-2" *matHeaderCellDef mat-sort-header> Peer </mat-header-cell>
<mat-cell class="pl-2" *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '30rem'}">{{channel.channel.remote_alias}}</mat-cell>
<mat-header-cell *matHeaderCellDef mat-sort-header> Peer </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.remote_alias}}</mat-cell>
</ng-container>
<ng-container matColumnDef="remote_node_pub">
<mat-header-cell *matHeaderCellDef mat-sort-header> Pubkey </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.remote_node_pub}}</mat-cell>
</ng-container>
<ng-container matColumnDef="channel_point">
<mat-header-cell *matHeaderCellDef mat-sort-header> Channel </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.channel_point}}</mat-cell>
</ng-container>
<ng-container matColumnDef="initiator">
<mat-header-cell *matHeaderCellDef mat-sort-header> Initiator </mat-header-cell>
<mat-cell *matCellDef="let channel">{{channel.channel.initiator}}</mat-cell>
</ng-container>
<ng-container matColumnDef="commitment_type">
<mat-header-cell *matHeaderCellDef mat-sort-header> Commitment Type </mat-header-cell>
<mat-cell *matCellDef="let channel" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">{{channel.channel.commitment_type}}</mat-cell>
</ng-container>
<ng-container matColumnDef="limbo_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Limbo Balance (Sats) </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.limbo_balance | number}}
</mat-cell>
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Limbo Balance (Sats) </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.limbo_balance | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="capacity">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Capacity (Sats) </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.capacity | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="local_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Local Balance (Sats) </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.local_balance |
number}}</mat-cell>
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Local Balance (Sats)</mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.local_balance | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="remote_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Remote Balance (Sats) </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.remote_balance |
number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="capacity">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Capacity (Sats) </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.capacity |
number}}</mat-cell>
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Remote Balance (Sats)</mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.remote_balance | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="actions">
<mat-header-cell fxLayoutAlign="end center" class="pl-4 pr-3" *matHeaderCellDef>

@ -1,4 +1,5 @@
.mat-column-channel_point {
.mat-column-channel_point, .mat-column-remote_alias, .mat-column-remote_node_pub,
.mat-column-commitment_type, .mat-column-closing_txid {
flex: 1 1 10%;
white-space: nowrap;
overflow: hidden;

@ -6,7 +6,7 @@ import { Store } from '@ngrx/store';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { Channel, GetInfo, PendingChannels, PendingOpenChannel } from '../../../../../shared/models/lndModels';
import { AlertTypeEnum, APICallStatusEnum, DataTypeEnum, ScreenSizeEnum } from '../../../../../shared/services/consts-enums-functions';
import { AlertTypeEnum, APICallStatusEnum, DataTypeEnum, LND_DEFAULT_PAGE_SETTINGS, PAGE_SIZE, ScreenSizeEnum, SortOrderEnum } from '../../../../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../../../../shared/models/apiCallsPayload';
import { SelNodeChild } from '../../../../../shared/models/RTLconfig';
import { LoggerService } from '../../../../../shared/services/logger.service';
@ -15,7 +15,8 @@ import { BumpFeeComponent } from '../../bump-fee-modal/bump-fee.component';
import { openAlert } from '../../../../../store/rtl.actions';
import { RTLState } from '../../../../../store/rtl.state';
import { lndNodeInformation, lndNodeSettings, pendingChannels } from '../../../../store/lnd.selector';
import { lndNodeInformation, lndNodeSettings, lndPageSettings, pendingChannels } from '../../../../store/lnd.selector';
import { PageSettings, TableSetting } from '../../../../../shared/models/pageSettings';
@Component({
selector: 'rtl-channel-pending-table',
@ -25,20 +26,25 @@ import { lndNodeInformation, lndNodeSettings, pendingChannels } from '../../../.
export class ChannelPendingTableComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
public PAGE_ID = 'peers_channels';
public openTableSetting: TableSetting = { tableId: 'pending_open', recordsPerPage: PAGE_SIZE, sortBy: 'capacity', sortOrder: SortOrderEnum.DESCENDING };
public forceClosingopenTableSetting: TableSetting = { tableId: 'pending_force_closing', recordsPerPage: PAGE_SIZE, sortBy: 'limbo_balance', sortOrder: SortOrderEnum.DESCENDING };
public closingOpenTableSetting: TableSetting = { tableId: 'pending_closing', recordsPerPage: PAGE_SIZE, sortBy: 'capacity', sortOrder: SortOrderEnum.DESCENDING };
public waitingCloseopenTableSetting: TableSetting = { tableId: 'pending_waiting_close', recordsPerPage: PAGE_SIZE, sortBy: 'limbo_balance', sortOrder: SortOrderEnum.DESCENDING };
public selNode: SelNodeChild | null = {};
public selectedFilter = '';
public information: GetInfo = {};
public pendingChannels: PendingChannels = {};
public displayedOpenColumns = ['remote_alias', 'commit_fee', 'commit_weight', 'capacity', 'actions'];
public displayedOpenColumns: any[] = [];
public pendingOpenChannelsLength = 0;
public pendingOpenChannels: any;
public displayedForceClosingColumns = ['remote_alias', 'recovered_balance', 'limbo_balance', 'capacity', 'actions'];
public displayedForceClosingColumns: any[] = [];
public pendingForceClosingChannelsLength = 0;
public pendingForceClosingChannels: any;
public displayedClosingColumns = ['remote_alias', 'local_balance', 'remote_balance', 'capacity', 'actions'];
public displayedClosingColumns: any[] = [];
public pendingClosingChannelsLength = 0;
public pendingClosingChannels: any;
public displayedWaitClosingColumns = ['remote_alias', 'limbo_balance', 'local_balance', 'remote_balance', 'actions'];
public displayedWaitClosingColumns: any[] = [];
public pendingWaitClosingChannelsLength = 0;
public pendingWaitClosingChannels: any;
public screenSize = '';
@ -46,32 +52,56 @@ export class ChannelPendingTableComponent implements OnInit, AfterViewInit, OnDe
public errorMessage = '';
public apiCallStatus: ApiCallStatusPayload | null = null;
public apiCallStatusEnum = APICallStatusEnum;
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()];
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<RTLState>, private commonService: CommonService) {
this.screenSize = this.commonService.getScreenSize();
if (this.screenSize === ScreenSizeEnum.XS) {
this.displayedOpenColumns = ['remote_alias', 'actions'];
this.displayedForceClosingColumns = ['remote_alias', 'actions'];
this.displayedClosingColumns = ['remote_alias', 'actions'];
this.displayedWaitClosingColumns = ['remote_alias', 'actions'];
} else if (this.screenSize === ScreenSizeEnum.SM || this.screenSize === ScreenSizeEnum.MD) {
this.displayedOpenColumns = ['remote_alias', 'commit_fee', 'actions'];
this.displayedForceClosingColumns = ['remote_alias', 'limbo_balance', 'actions'];
this.displayedClosingColumns = ['remote_alias', 'remote_balance', 'actions'];
this.displayedWaitClosingColumns = ['remote_alias', 'limbo_balance', 'actions'];
} else {
this.displayedOpenColumns = ['remote_alias', 'commit_fee', 'commit_weight', 'capacity', 'actions'];
this.displayedForceClosingColumns = ['remote_alias', 'recovered_balance', 'limbo_balance', 'capacity', 'actions'];
this.displayedClosingColumns = ['remote_alias', 'local_balance', 'remote_balance', 'capacity', 'actions'];
this.displayedWaitClosingColumns = ['remote_alias', 'limbo_balance', 'local_balance', 'remote_balance', 'actions'];
}
}
ngOnInit() {
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: SelNodeChild | null) => { this.selNode = nodeSettings; });
this.store.select(lndNodeInformation).pipe(takeUntil(this.unSubs[1])).subscribe((nodeInfo: GetInfo) => { this.information = nodeInfo; });
this.store.select(pendingChannels).pipe(takeUntil(this.unSubs[0])).
this.store.select(lndPageSettings).pipe(takeUntil(this.unSubs[2])).
subscribe((settings: { pageSettings: PageSettings[], apiCallStatus: ApiCallStatusPayload }) => {
this.errorMessage = '';
this.apiCallStatus = settings.apiCallStatus;
if (this.apiCallStatus.status === APICallStatusEnum.ERROR) {
this.errorMessage = this.apiCallStatus.message || '';
}
this.openTableSetting = settings.pageSettings.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.openTableSetting.tableId) || LND_DEFAULT_PAGE_SETTINGS.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.openTableSetting.tableId)!;
if (this.screenSize === ScreenSizeEnum.XS || this.screenSize === ScreenSizeEnum.SM) {
this.displayedOpenColumns = JSON.parse(JSON.stringify(this.openTableSetting.columnSelectionSM));
} else {
this.displayedOpenColumns = JSON.parse(JSON.stringify(this.openTableSetting.columnSelection));
}
this.displayedOpenColumns.push('actions');
this.logger.info(this.displayedOpenColumns);
this.forceClosingopenTableSetting = settings.pageSettings.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.forceClosingopenTableSetting.tableId) || LND_DEFAULT_PAGE_SETTINGS.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.forceClosingopenTableSetting.tableId)!;
if (this.screenSize === ScreenSizeEnum.XS || this.screenSize === ScreenSizeEnum.SM) {
this.displayedForceClosingColumns = JSON.parse(JSON.stringify(this.forceClosingopenTableSetting.columnSelectionSM));
} else {
this.displayedForceClosingColumns = JSON.parse(JSON.stringify(this.forceClosingopenTableSetting.columnSelection));
}
this.displayedForceClosingColumns.push('actions');
this.logger.info(this.displayedForceClosingColumns);
this.closingOpenTableSetting = settings.pageSettings.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.closingOpenTableSetting.tableId) || LND_DEFAULT_PAGE_SETTINGS.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.closingOpenTableSetting.tableId)!;
if (this.screenSize === ScreenSizeEnum.XS || this.screenSize === ScreenSizeEnum.SM) {
this.displayedClosingColumns = JSON.parse(JSON.stringify(this.closingOpenTableSetting.columnSelectionSM));
} else {
this.displayedClosingColumns = JSON.parse(JSON.stringify(this.closingOpenTableSetting.columnSelection));
}
this.displayedClosingColumns.push('actions');
this.logger.info(this.displayedClosingColumns);
this.waitingCloseopenTableSetting = settings.pageSettings.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.waitingCloseopenTableSetting.tableId) || LND_DEFAULT_PAGE_SETTINGS.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.waitingCloseopenTableSetting.tableId)!;
if (this.screenSize === ScreenSizeEnum.XS || this.screenSize === ScreenSizeEnum.SM) {
this.displayedWaitClosingColumns = JSON.parse(JSON.stringify(this.waitingCloseopenTableSetting.columnSelectionSM));
} else {
this.displayedWaitClosingColumns = JSON.parse(JSON.stringify(this.waitingCloseopenTableSetting.columnSelection));
}
this.displayedWaitClosingColumns.push('actions');
this.logger.info(this.displayedWaitClosingColumns);
});
this.store.select(pendingChannels).pipe(takeUntil(this.unSubs[3])).
subscribe((pendingChannelsSelector: { pendingChannels: PendingChannels, apiCallStatus: ApiCallStatusPayload }) => {
this.errorMessage = '';
this.apiCallStatus = pendingChannelsSelector.apiCallStatus;

@ -13,7 +13,7 @@
<div fxLayout="row" fxLayoutAlign="space-between center">
<span fxFlex="10">{{table.tableId | camelcaseWithReplace:'_'}}: </span>
<mat-form-field fxFlex="10">
<mat-select [(ngModel)]="table.recordsPerPage" placeholder="Records/Page" name="{{table.tableId}}-page-size-options" tabindex="2" required>
<mat-select [disabled]="disbalePageSize(page.pageId, table.tableId)" [(ngModel)]="table.recordsPerPage" placeholder="Records/Page" name="{{table.tableId}}-page-size-options" tabindex="2" required>
<mat-option *ngFor="let pageSizeOption of pageSizeOptions" [value]="pageSizeOption">
{{pageSizeOption}}
</mat-option>

@ -205,6 +205,14 @@ export class PageSettingsComponent implements OnInit, OnDestroy {
}
}
disbalePageSize(pageId: string, tableId: string) {
return (this.selNode.lnImplementation === 'LND' && pageId === 'peers_channels' && tableId === 'pending_open') ||
(this.selNode.lnImplementation === 'LND' && pageId === 'peers_channels' && tableId === 'pending_force_closing') ||
(this.selNode.lnImplementation === 'LND' && pageId === 'peers_channels' && tableId === 'pending_closing') ||
(this.selNode.lnImplementation === 'LND' && pageId === 'peers_channels' && tableId === 'pending_waiting_close');
}
ngOnDestroy() {
this.unSubs.forEach((unsub) => {
unsub.next();

@ -860,16 +860,16 @@ export const LND_DEFAULT_PAGE_SETTINGS: PageSettings[] = [
{ tableId: 'open', recordsPerPage: PAGE_SIZE, sortBy: 'balancedness', sortOrder: SortOrderEnum.DESCENDING,
columnSelectionSM: ['remote_alias', 'local_balance', 'remote_balance'],
columnSelection: ['remote_alias', 'uptime', 'total_satoshis_sent', 'total_satoshis_received', 'local_balance', 'remote_balance', 'balancedness'] },
{ tableId: 'pending_open', recordsPerPage: PAGE_SIZE, sortBy: 'capacity', sortOrder: SortOrderEnum.DESCENDING,
{ tableId: 'pending_open', sortBy: 'capacity', sortOrder: SortOrderEnum.DESCENDING,
columnSelectionSM: ['remote_alias', 'capacity'],
columnSelection: ['remote_alias', 'commit_fee', 'commit_weight', 'capacity'] },
{ tableId: 'pending_force_closing', recordsPerPage: PAGE_SIZE, sortBy: 'limbo_balance', sortOrder: SortOrderEnum.DESCENDING,
{ tableId: 'pending_force_closing', sortBy: 'limbo_balance', sortOrder: SortOrderEnum.DESCENDING,
columnSelectionSM: ['remote_alias', 'limbo_balance'],
columnSelection: ['remote_alias', 'recovered_balance', 'limbo_balance', 'capacity'] },
{ tableId: 'pending_closing', recordsPerPage: PAGE_SIZE, sortBy: 'capacity', sortOrder: SortOrderEnum.DESCENDING,
{ tableId: 'pending_closing', sortBy: 'capacity', sortOrder: SortOrderEnum.DESCENDING,
columnSelectionSM: ['remote_alias', 'capacity'],
columnSelection: ['remote_alias', 'local_balance', 'remote_balance', 'capacity'] },
{ tableId: 'pending_waiting_close', recordsPerPage: PAGE_SIZE, sortBy: 'limbo_balance', sortOrder: SortOrderEnum.DESCENDING,
{ tableId: 'pending_waiting_close', sortBy: 'limbo_balance', sortOrder: SortOrderEnum.DESCENDING,
columnSelectionSM: ['remote_alias', 'limbo_balance'],
columnSelection: ['remote_alias', 'limbo_balance', 'local_balance', 'remote_balance'] },
{ tableId: 'closed', recordsPerPage: PAGE_SIZE, sortBy: 'close_type', sortOrder: SortOrderEnum.DESCENDING,
@ -950,20 +950,20 @@ export const LND_TABLES_DEF = {
allowedColumns: ['remote_alias', 'uptime', 'total_satoshis_sent', 'total_satoshis_received', 'local_balance', 'remote_balance', 'balancedness']
},
pending_open: {
maxColumns: 4,
allowedColumns: ['remote_alias', 'commit_fee', 'commit_weight', 'capacity']
maxColumns: 7,
allowedColumns: ['remote_alias', 'remote_node_pub', 'channel_point', 'initiator', 'commitment_type', 'confirmation_height', 'commit_fee', 'commit_weight', 'fee_per_kw', 'capacity', 'local_balance', 'remote_balance']
},
pending_force_closing: {
maxColumns: 4,
allowedColumns: ['remote_alias', 'recovered_balance', 'limbo_balance', 'capacity']
maxColumns: 7,
allowedColumns: ['closing_txid', 'remote_alias', 'remote_node_pub', 'channel_point', 'initiator', 'commitment_type', 'limbo_balance', 'maturity_height', 'blocks_til_maturity', 'recovered_balance', 'capacity', 'local_balance', 'remote_balance']
},
pending_closing: {
maxColumns: 4,
allowedColumns: ['remote_alias', 'local_balance', 'remote_balance', 'capacity']
maxColumns: 7,
allowedColumns: ['closing_txid', 'remote_alias', 'remote_node_pub', 'channel_point', 'initiator', 'commitment_type', 'capacity', 'local_balance', 'remote_balance']
},
pending_waiting_close: {
maxColumns: 4,
allowedColumns: ['remote_alias', 'limbo_balance', 'local_balance', 'remote_balance']
maxColumns: 7,
allowedColumns: ['remote_alias', 'remote_node_pub', 'channel_point', 'initiator', 'commitment_type', 'limbo_balance', 'capacity', 'local_balance', 'remote_balance']
},
closed: {
maxColumns: 5,

Loading…
Cancel
Save