Pending and backup channels

Pending and backup channels
pull/260/head
Shahana Farooqui 5 years ago
parent 5bf45be695
commit a9474889c2

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -9,8 +9,8 @@
<link rel="icon" type="image/png" sizes="32x32" href="assets/images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon/favicon-16x16.png">
<link rel="manifest" href="assets/images/favicon/site.webmanifest">
<link rel="stylesheet" href="styles.754b1a5321d3de1387e5.css"></head>
<link rel="stylesheet" href="styles.58bb0d5e23e447322101.css"></head>
<body>
<rtl-app></rtl-app>
<script src="runtime.af8e8f4b78a7bd889ad1.js"></script><script src="polyfills-es5.92f4069201c83f4833ef.js" nomodule></script><script src="polyfills.5ddcccdb990eb395f306.js"></script><script src="main.642a811d13ebedcd22b4.js"></script></body>
<script src="runtime.97120254803e999a5dc0.js"></script><script src="polyfills-es5.92f4069201c83f4833ef.js" nomodule></script><script src="polyfills.5ddcccdb990eb395f306.js"></script><script src="main.4f4bd66420eabc97480b.js"></script></body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
!function(e){function r(r){for(var n,i,a=r[0],c=r[1],f=r[2],p=0,s=[];p<a.length;p++)o[i=a[p]]&&s.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++)0!==o[t[a]]&&(n=!1);n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={0:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+""+({}[e]||e)+"."+{1:"c7ef37d92d6c98e58e25",6:"bb075656f8b4a826eed4",7:"bada1b79d7bc28f5bfed"}[e]+".js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,(function(r){return e[r]}).bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var l=c;t()}([]);
!function(e){function r(r){for(var n,i,a=r[0],c=r[1],f=r[2],p=0,s=[];p<a.length;p++)o[i=a[p]]&&s.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++)0!==o[t[a]]&&(n=!1);n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={0:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+""+({}[e]||e)+"."+{1:"c7ef37d92d6c98e58e25",6:"bb075656f8b4a826eed4",7:"207f6b0883d4876d89ed"}[e]+".js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,(function(r){return e[r]}).bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var l=c;t()}([]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -42,7 +42,7 @@ export class CLEffects implements OnDestroy {
this.initializeRemainingData(info, action.payload.loadPage);
return {
type: RTLActions.SET_INFO_CL,
payload: (undefined !== info) ? info : {}
payload: info ? info : {}
};
}),
catchError((err) => {
@ -81,7 +81,7 @@ export class CLEffects implements OnDestroy {
this.logger.info(fees);
return {
type: RTLActions.SET_FEES_CL,
payload: (undefined !== fees) ? fees : {}
payload: fees ? fees : {}
};
}),
catchError((err: any) => {
@ -101,7 +101,7 @@ export class CLEffects implements OnDestroy {
this.logger.info(feeRates);
return {
type: RTLActions.SET_FEE_RATES_CL,
payload: (undefined !== feeRates) ? feeRates : {}
payload: feeRates ? feeRates : {}
};
}),
catchError((err: any) => {
@ -121,7 +121,7 @@ export class CLEffects implements OnDestroy {
this.logger.info(balance);
return {
type: RTLActions.SET_BALANCE_CL,
payload: (undefined !== balance) ? balance : {}
payload: balance ? balance : {}
};
}),
catchError((err: any) => {
@ -141,7 +141,7 @@ export class CLEffects implements OnDestroy {
this.logger.info(lrBalance);
return {
type: RTLActions.SET_LOCAL_REMOTE_BALANCE_CL,
payload: (undefined !== lrBalance) ? lrBalance : {}
payload: lrBalance ? lrBalance : {}
};
}),
catchError((err: any) => {
@ -160,7 +160,7 @@ export class CLEffects implements OnDestroy {
this.store.dispatch(new RTLActions.CloseSpinner());
return {
type: RTLActions.SET_NEW_ADDRESS_CL,
payload: (undefined !== newAddress && undefined !== newAddress.address) ? newAddress.address : {}
payload: (newAddress && newAddress.address) ? newAddress.address : {}
};
}),
catchError((err: any) => {
@ -190,7 +190,7 @@ export class CLEffects implements OnDestroy {
this.logger.info(peers);
return {
type: RTLActions.SET_PEERS_CL,
payload: (undefined !== peers) ? peers : []
payload: peers ? peers : []
};
}),
catchError((err: any) => {
@ -213,7 +213,7 @@ export class CLEffects implements OnDestroy {
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '70%', data: { type: 'SUCCESS', titleMessage: 'Peer Added Successfully!' }}}));
return {
type: RTLActions.SET_PEERS_CL,
payload: (undefined !== postRes && postRes.length > 0) ? postRes : []
payload: (postRes && postRes.length > 0) ? postRes : []
};
}),
catchError((err: any) => {
@ -258,7 +258,7 @@ export class CLEffects implements OnDestroy {
this.logger.info(channels);
return {
type: RTLActions.SET_CHANNELS_CL,
payload: (undefined !== channels && channels.length > 0) ? channels : []
payload: (channels && channels.length > 0) ? channels : []
};
},
catchError((err: any) => {
@ -350,7 +350,7 @@ export class CLEffects implements OnDestroy {
this.logger.info(payments);
return {
type: RTLActions.SET_PAYMENTS_CL,
payload: (undefined !== payments && null != payments) ? payments : []
payload: payments ? payments : []
};
}),
catchError((err: any) => {
@ -370,7 +370,7 @@ export class CLEffects implements OnDestroy {
this.store.dispatch(new RTLActions.CloseSpinner());
return {
type: RTLActions.SET_DECODED_PAYMENT_CL,
payload: (undefined !== decodedPayment) ? decodedPayment : {}
payload: decodedPayment ? decodedPayment : {}
};
}),
catchError((err: any) => {

@ -27,12 +27,18 @@
{{transaction?.num_confirmations | number}} </span></td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef class="pl-3 pr-3"><span fxLayoutAlign="end center">Actions</span></th>
<th mat-header-cell *matHeaderCellDef class="pl-3 pr-3"><span fxLayoutAlign="end center">Actions</span></th>
<td mat-cell *matCellDef="let transaction" class="pl-3">
<button mat-stroked-button color="primary" type="button" tabindex="4"
(click)="onTransactionClick(transaction, $event)">View Info</button>
</td>
</ng-container>
<ng-container matColumnDef="no_transaction">
<td mat-footer-cell *matFooterCellDef colspan="4">
<p *ngIf="!listTransactions.data || listTransactions.data.length<1">No transactions available.</p>
</td>
</ng-container>
<tr mat-footer-row *matFooterRowDef="['no_transaction']" [ngClass]="{'display-none': listTransactions.data && listTransactions.data.length>0}"></tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: flgSticky;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>

@ -1,51 +1,47 @@
<div fxLayout="column" fxLayoutAlign="center center" class="test-banner mx-1">
<h5>Save your backup files in a redundant location</h5>
</div>
<div fxLayout="column">
<div class="padding-gap">
<mat-card>
<mat-card-header>
<mat-card-subtitle>
<h2>Channels Backup</h2>
</mat-card-subtitle>
</mat-card-header>
<mat-card-content>
<div fxLayout="column" fxLayout.gt-sm="row wrap" fxFlex="100" fxLayoutAlign="space-between start">
<h4 fxFlex="100">Backup folder location: {{selNode.channelBackupPath}}</h4>
<button fxFlex="49" fxLayoutAlign="center center" mat-raised-button color="primary" tabindex="1" (click)="onBackupChannels({})">Backup All Channels</button>
<button fxFlex="49" fxLayoutAlign="center center" mat-raised-button color="primary" tabindex="2" (click)="onVerifyChannels({})">Verify All Channels Backup</button>
</div>
</mat-card-content>
</mat-card>
<div fxLayout="column" fxLayoutAlign="space-between stretch" fxLayout.gt-md="row wrap">
<h4 fxFlex="100">Save your backup files in a redundant location.</h4>
<h4 fxFlex="100" class="mt-1">Backup folder location: {{selNode.channelBackupPath}}</h4>
<div fxLayout="row" fxFlex.gt-sm="30" fxLayoutAlign.gt-sm="space-between start" fxLayoutAlign="start start" class="mt-2">
<button fxFlex="48" fxLayoutAlign="center center" mat-stroked-button color="primary" tabindex="1" (click)="onVerifyChannels({})">Verify All Channels Backup</button>
<button fxFlex="48" fxLayoutAlign="center center" mat-raised-button color="primary" tabindex="2" (click)="onBackupChannels({})">Backup All Channels</button>
</div>
</div>
<div fxLayout="row" fxLayoutAlign="start center" class="padding-gap-x page-sub-title-container mt-minus-2">
<div fxFlex="70"></div>
<mat-form-field fxFlex="30">
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field>
</div>
<div class="padding-gap">
<mat-card>
<mat-card-content class="table-card-content">
<div fxLayout="row" fxLayoutAlign="start start">
<mat-form-field fxFlex="30">
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field>
</div>
<div perfectScrollbar class="table-container">
<mat-progress-bar *ngIf="flgLoading[0]===true" mode="indeterminate"></mat-progress-bar>
<table mat-table #table [dataSource]="channels" matSort [ngClass]="{'overflow-auto error-border': flgLoading[0]==='error','overflow-auto': true}">
<ng-container matColumnDef="chan_point">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Channel Point </th>
<td mat-cell *matCellDef="let channel">{{channel?.channel_point}}</td>
</ng-container>
<ng-container matColumnDef="backup">
<th mat-header-cell *matHeaderCellDef>Backup</th>
<td mat-cell *matCellDef="let channel"><mat-icon color="primary" (click)="onBackupChannels(channel)">save_alt</mat-icon></td>
</ng-container>
<ng-container matColumnDef="verify">
<th mat-header-cell *matHeaderCellDef>Verify</th>
<td mat-cell *matCellDef="let channel"><mat-icon color="primary" (click)="onVerifyChannels(channel)">verified_user</mat-icon></td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: flgSticky;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" (click)="onChannelClick(row, $event)"></tr>
</table>
</div>
</mat-card-content>
</mat-card>
<div perfectScrollbar fxLayout="row" fxLayoutAlign="start center" fxFlex="100" class="table-container">
<mat-progress-bar *ngIf="flgLoading[0]===true" mode="indeterminate"></mat-progress-bar>
<table mat-table #table [dataSource]="channels" matSort [ngClass]="{'overflow-auto error-border': flgLoading[0]==='error','overflow-auto': true}">
<ng-container matColumnDef="chan_point">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Channel Point </th>
<td mat-cell *matCellDef="let channel">{{channel?.channel_point}}</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef class="pr-3"><span fxLayoutAlign="end center">Actions</span></th>
<td mat-cell *matCellDef="let channel" fxLayoutAlign="end center">
<div fxFlex="100" class="bordered-box table-actions-select" fxLayoutAlign="center center">
<mat-select placeholder="Actions" tabindex="1" class="mr-0">
<mat-select-trigger></mat-select-trigger>
<mat-option (click)="onChannelClick(channel, $event)">View Info</mat-option>
<mat-option (click)="onBackupChannels(channel)">Backup</mat-option>
<mat-option (click)="onVerifyChannels(channel)">Verify</mat-option>
</mat-select>
</div>
</td>
</ng-container>
<ng-container matColumnDef="no_channel">
<td mat-footer-cell *matFooterCellDef colspan="4">
<p *ngIf="!channels.data || channels.data.length<1">No channels available.</p>
</td>
</ng-container>
<tr mat-footer-row *matFooterRowDef="['no_channel']" [ngClass]="{'display-none': channels.data && channels.data.length>0}"></tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: flgSticky;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div>
<mat-paginator [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions" showFirstLastButtons class="mb-4"></mat-paginator>
</div>

@ -1,12 +1,6 @@
.mat-column-chan_point {
flex: 1 1 25%;
min-width: 100px;
max-width: 100px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
table {
width:100%;
}

@ -6,9 +6,11 @@ import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
import { MatTableDataSource, MatSort } from '@angular/material';
import { MatTableDataSource, MatSort, MatPaginator, MatPaginatorIntl } from '@angular/material';
import { SelNodeChild } from '../../../../../shared/models/RTLconfig';
import { Channel } from '../../../../../shared/models/lndModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '../../../../../shared/models/enums';
import { getPaginatorLabel } from '../../../../../shared/services/paginator.service';
import { LoggerService } from '../../../../../shared/services/logger.service';
import { RTLEffects } from '../../../../../store/rtl.effects';
@ -18,16 +20,22 @@ import * as fromRTLReducer from '../../../../../store/rtl.reducers';
@Component({
selector: 'rtl-channel-backup-table',
templateUrl: './channel-backup-table.component.html',
styleUrls: ['./channel-backup-table.component.scss']
styleUrls: ['./channel-backup-table.component.scss'],
providers: [
{ provide: MatPaginatorIntl, useValue: getPaginatorLabel('Channels') }
]
})
export class ChannelBackupTableComponent implements OnInit, OnDestroy {
@ViewChild(MatSort, { static: true }) sort: MatSort;
@ViewChild(MatPaginator, {static: true}) paginator: MatPaginator;
public selNode: SelNodeChild = {};
public displayedColumns = ['chan_point', 'backup', 'verify'];
public displayedColumns = ['chan_point', 'actions'];
public selChannel: Channel;
public channels: any;
public flgLoading: Array<Boolean | 'error'> = [true]; // 0: channels
public flgSticky = false;
public pageSize = PAGE_SIZE;
public pageSizeOptions = PAGE_SIZE_OPTIONS;
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.RTLState>, private rtlEffects: RTLEffects, private actions$: Actions, private router: Router) {}
@ -49,8 +57,9 @@ export class ChannelBackupTableComponent implements OnInit, OnDestroy {
this.channels.data = rtlStore.allChannels;
}
this.channels.sort = this.sort;
this.channels.paginator = this.paginator;
this.channels.filterPredicate = (channel: Channel, fltr: string) => {
const newChannel = ((channel.active) ? 'active' : 'inactive') + (channel.chan_id ? channel.chan_id : '') +
const newChannel = ((channel.active) ? 'active' : 'inactive') + (channel.channel_point ? channel.channel_point : '') + (channel.chan_id ? channel.chan_id : '') +
(channel.remote_pubkey ? channel.remote_pubkey : '') + (channel.remote_alias ? channel.remote_alias : '') +
(channel.capacity ? channel.capacity : '') + (channel.local_balance ? channel.local_balance : '') +
(channel.remote_balance ? channel.remote_balance : '') + (channel.total_satoshis_sent ? channel.total_satoshis_sent : '') +

@ -1,4 +1,4 @@
<div fxLayout="column" class="padding-gap">
<div fxLayout="column">
<div fxLayout="row" fxLayoutAlign="start center" class="padding-gap-x page-sub-title-container mt-minus-2">
<div fxFlex="70"></div>
<mat-form-field fxFlex="30">
@ -7,48 +7,48 @@
</div>
<div perfectScrollbar fxLayout="row" fxLayoutAlign="start center" fxFlex="100" class="table-container">
<mat-progress-bar *ngIf="flgLoading[0]===true" mode="indeterminate"></mat-progress-bar>
<table mat-table #table [dataSource]="closedChannels" matSort [ngClass]="{'overflow-auto error-border': flgLoading[0]==='error','overflow-auto': true}">
<table mat-table #table [dataSource]="closedChannels" matSort
[ngClass]="{'overflow-auto error-border': flgLoading[0]==='error','overflow-auto': true}">
<ng-container matColumnDef="close_type">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Close Type </th>
<td mat-cell *matCellDef="let channel"> {{channel.close_type}} </td>
</ng-container>
<ng-container matColumnDef="channel_point">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Channel Point </th>
<td mat-cell *matCellDef="let channel"> {{channel.channel_point | slice:0:10}}...</td>
</ng-container>
<ng-container matColumnDef="chan_id">
<th mat-header-cell *matHeaderCellDef mat-sort-header> ID </th>
<td mat-cell *matCellDef="let channel"> {{channel.chan_id}} </td>
</ng-container>
<ng-container matColumnDef="closing_tx_hash">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Closing Txn Hash </th>
<td mat-cell *matCellDef="let channel">
<div>{{channel.closing_tx_hash | slice:0:10}}...</div></td>
</ng-container>
<ng-container matColumnDef="remote_pubkey">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Pub Key </th>
<td mat-cell *matCellDef="let channel">
<div>{{channel.remote_pubkey | slice:0:10}}...</div></td>
</ng-container>
<ng-container matColumnDef="capacity">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Capacity </th>
<td mat-cell *matCellDef="let channel"><span fxLayoutAlign="end center"> {{channel.capacity | number}} </span></td>
<td mat-cell *matCellDef="let channel"><span fxLayoutAlign="end center"> {{channel.capacity | number}} </span>
</td>
</ng-container>
<ng-container matColumnDef="close_height">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Close Height </th>
<td mat-cell *matCellDef="let channel"><span fxLayoutAlign="end center"> {{channel.close_height | number}} </span></td>
<td mat-cell *matCellDef="let channel"><span fxLayoutAlign="end center"> {{channel.close_height | number}}
</span></td>
</ng-container>
<ng-container matColumnDef="settled_balance">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Settled Balance </th>
<td mat-cell *matCellDef="let channel"><span fxLayoutAlign="end center"> {{channel.settled_balance | number}} </span></td>
</ng-container>
<ng-container matColumnDef="time_locked_balance">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Time Locked Balance </th>
<td mat-cell *matCellDef="let channel"><span fxLayoutAlign="end center"> {{channel.time_locked_balance | number}} </span></td>
</ng-container>
<td mat-cell *matCellDef="let channel"><span fxLayoutAlign="end center"> {{channel.settled_balance | number}}
</span></td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef class="pl-4 pr-3"><span fxLayoutAlign="end center">Actions</span></th>
<td mat-cell *matCellDef="let channel" class="pl-4">
<span fxLayoutAlign="end center">
<button mat-stroked-button color="primary" type="button" tabindex="4" (click)="onClosedChannelClick(channel,$event)">View Info</button>
</span>
</td>
</ng-container>
<ng-container matColumnDef="no_closed_channel">
<td mat-footer-cell *matFooterCellDef colspan="4">
<p *ngIf="!closedChannels.data || closedChannels.data.length<1">No closed channels available.</p>
</td>
</ng-container>
<tr mat-footer-row *matFooterRowDef="['no_closed_channel']" [ngClass]="{'display-none': closedChannels.data && closedChannels.data.length>0}"></tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: flgSticky;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" (click)="onClosedChannelClick(row, $event)"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div>
</div>
<mat-paginator [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions" showFirstLastButtons class="mb-4"></mat-paginator>
</div>

@ -3,10 +3,13 @@ import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
import { faHistory } from '@fortawesome/free-solid-svg-icons';
import { MatTableDataSource, MatSort } from '@angular/material';
import { MatTableDataSource, MatSort, MatPaginator, MatPaginatorIntl } from '@angular/material';
import { ClosedChannel } from '../../../../../shared/models/lndModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '../../../../../shared/models/enums';
import { LoggerService } from '../../../../../shared/services/logger.service';
import { getPaginatorLabel } from '../../../../../shared/services/paginator.service';
import { RTLEffects } from '../../../../../store/rtl.effects';
import * as RTLActions from '../../../../../store/rtl.actions';
@ -15,37 +18,42 @@ import * as fromRTLReducer from '../../../../../store/rtl.reducers';
@Component({
selector: 'rtl-channel-closed-table',
templateUrl: './channel-closed-table.component.html',
styleUrls: ['./channel-closed-table.component.scss']
styleUrls: ['./channel-closed-table.component.scss'],
providers: [
{ provide: MatPaginatorIntl, useValue: getPaginatorLabel('Channels') }
]
})
export class ChannelClosedTableComponent implements OnInit, OnDestroy {
@ViewChild(MatSort, { static: true }) sort: MatSort;
@ViewChild(MatPaginator, {static: true}) paginator: MatPaginator;
faHistory = faHistory;
public displayedColumns = [];
public closedChannels: any;
public flgLoading: Array<Boolean | 'error'> = [true];
public selectedFilter = '';
public flgSticky = false;
public pageSize = PAGE_SIZE;
public pageSizeOptions = PAGE_SIZE_OPTIONS;
private unsub: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.RTLState>, private rtlEffects: RTLEffects, private actions$: Actions) {
switch (true) {
case (window.innerWidth <= 415):
this.displayedColumns = ['close_type', 'chan_id', 'settled_balance'];
this.displayedColumns = ['close_type', 'chan_id', 'actions'];
break;
case (window.innerWidth > 415 && window.innerWidth <= 730):
this.displayedColumns = ['close_type', 'channel_point', 'chan_id', 'settled_balance'];
this.displayedColumns = ['close_type', 'chan_id', 'close_height', 'settled_balance', 'actions'];
break;
case (window.innerWidth > 730 && window.innerWidth <= 1024):
this.displayedColumns = ['close_type', 'channel_point', 'chan_id', 'capacity', 'close_height', 'settled_balance'];
this.displayedColumns = ['close_type', 'chan_id', 'capacity', 'close_height', 'settled_balance', 'actions'];
break;
case (window.innerWidth > 1024 && window.innerWidth <= 1280):
this.flgSticky = true;
this.displayedColumns = ['close_type', 'channel_point', 'chan_id', 'closing_tx_hash', 'remote_pubkey', 'capacity',
'close_height', 'settled_balance', 'time_locked_balance'];
this.displayedColumns = ['close_type', 'chan_id', 'capacity', 'close_height', 'settled_balance', 'actions'];
break;
default:
this.flgSticky = true;
this.displayedColumns = ['close_type', 'channel_point', 'chan_id', 'closing_tx_hash', 'remote_pubkey', 'capacity',
'close_height', 'settled_balance', 'time_locked_balance'];
this.displayedColumns = ['close_type', 'chan_id', 'capacity', 'close_height', 'settled_balance', 'actions'];
break;
}
}
@ -94,6 +102,7 @@ export class ChannelClosedTableComponent implements OnInit, OnDestroy {
loadClosedChannelsTable(closedChannels) {
this.closedChannels = new MatTableDataSource<ClosedChannel>([...closedChannels]);
this.closedChannels.sort = this.sort;
this.closedChannels.paginator = this.paginator;
this.logger.info(this.closedChannels);
}

@ -35,7 +35,7 @@
</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef class="pr-3"><span fxLayoutAlign="end center">Actions</span></th>
<th mat-header-cell *matHeaderCellDef class="pr-3"><span fxLayoutAlign="end center">Actions</span></th>
<td mat-cell *matCellDef="let channel" fxLayoutAlign="end center">
<div fxFlex="100" class="bordered-box table-actions-select" fxLayoutAlign="center center">
<mat-select placeholder="Actions" tabindex="1" class="mr-0">
@ -50,11 +50,12 @@
<ng-container matColumnDef="no_peer">
<td mat-footer-cell *matFooterCellDef colspan="4">
<p *ngIf="numPeers<1">No peers connected. Add a peer in order to open a channel.</p>
<p *ngIf="numPeers>0 && (!channels.data || channels.data.length<1)">No channels available.</p>
</td>
</ng-container>
<tr mat-footer-row *matFooterRowDef="['no_peer']" [ngClass]="{'display-none': numPeers>1 && channels.data && channels.data.length>0}"></tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: flgSticky;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
<tr mat-footer-row *matFooterRowDef="['no_peer']" [ngClass]="{'display-none': numPeers>1}"></tr>
</table>
</div>
<mat-paginator [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions" showFirstLastButtons class="mb-4"></mat-paginator>

@ -1,234 +1,197 @@
<div fxLayout="column">
<div fxFlex="100" class="padding-gap">
<span class="page-title">Total Limbo Balance: {{pendingChannels.total_limbo_balance | number}} {{information?.smaller_currency_unit}}</span>
<div class="">
<mat-accordion displayMode="flat">
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>Pending Open Channels({{pendingOpenChannelsLength}})</mat-panel-title>
<mat-progress-bar *ngIf="flgLoading[0]===true" mode="indeterminate"></mat-progress-bar>
</mat-expansion-panel-header>
<div perfectScrollbar fxLayout="row" fxLayoutAlign="start center" fxFlex="100" class="table-container">
<mat-table #table [dataSource]="pendingOpenChannels" matSort [ngClass]="{'overflow-auto error-border bordered-box': flgLoading[0]==='error','overflow-auto bordered-box': true}">
<ng-container matColumnDef="remote_node_pub">
<mat-header-cell class="pl-2" *matHeaderCellDef mat-sort-header> Remote Node Pub </mat-header-cell>
<mat-cell class="pl-2" *matCellDef="let channel">{{channel.channel.remote_node_pub}}</mat-cell>
</ng-container>
<ng-container matColumnDef="local_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Local Balance </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.local_balance |
number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="commit_fee">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Commit Fee </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.commit_fee | number}}
</mat-cell>
</ng-container>
<ng-container matColumnDef="remote_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Remote Balance </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 </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.capacity |
number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="commit_weight">
<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 Per KW </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.fee_per_kw | number}}
</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="channel_point">
<mat-header-cell class="pl-2" *matHeaderCellDef mat-sort-header> Channel Point </mat-header-cell>
<mat-cell class="pl-2" *matCellDef="let channel">{{channel.channel.channel_point}}</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedOpenColumns"></mat-header-row>
<mat-row fxLayoutAlign="stretch stretch" *matRowDef="let row; columns: displayedOpenColumns;"
(click)="onOpenClick(row, $event)"></mat-row>
</mat-table>
</div>
</mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>Pending Force Closing Channels({{pendingForceClosingChannelsLength}})</mat-panel-title>
<mat-progress-bar *ngIf="flgLoading[0]===true" mode="indeterminate"></mat-progress-bar>
</mat-expansion-panel-header>
<div perfectScrollbar fxLayout="row" fxLayoutAlign="start center" fxFlex="100" class="table-container">
<mat-table #table [dataSource]="pendingForceClosingChannels" matSort
[ngClass]="{'overflow-auto error-border bordered-box': flgLoading[0]==='error','overflow-auto bordered-box': true}">
<ng-container matColumnDef="remote_node_pub">
<mat-header-cell class="pl-2" *matHeaderCellDef mat-sort-header> Remote Node Pub </mat-header-cell>
<mat-cell class="pl-2" *matCellDef="let channel">{{channel.channel.remote_node_pub}}</mat-cell>
</ng-container>
<ng-container matColumnDef="recovered_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Recovered Balance </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.recovered_balance |
number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="limbo_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Limbo Balance </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.limbo_balance | number}}
</mat-cell>
</ng-container>
<ng-container matColumnDef="blocks_til_maturity">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Block 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="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="local_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Local Balance </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 </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 </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.capacity |
number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="closing_txid">
<mat-header-cell *matHeaderCellDef mat-sort-header> Transaction Id </mat-header-cell>
<mat-cell *matCellDef="let channel">
<div class="flex-ellipsis">{{channel.closing_txid}}</div>
</mat-cell>
</ng-container>
<ng-container matColumnDef="channel_point">
<mat-header-cell class="pl-2" *matHeaderCellDef mat-sort-header> Channel Point </mat-header-cell>
<mat-cell class="pl-2" *matCellDef="let channel">{{channel.channel.channel_point}}</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedForceClosingColumns"></mat-header-row>
<mat-row fxLayoutAlign="stretch stretch" *matRowDef="let row; columns: displayedForceClosingColumns;"
(click)="onForceClosingClick(row, $event)"></mat-row>
</mat-table>
</div>
</mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>Pending Closing Channels({{pendingClosingChannelsLength}})</mat-panel-title>
<mat-progress-bar *ngIf="flgLoading[0]===true" mode="indeterminate"></mat-progress-bar>
</mat-expansion-panel-header>
<div perfectScrollbar fxLayout="row" fxLayoutAlign="start center" fxFlex="100" class="table-container">
<mat-table #table [dataSource]="pendingClosingChannels" matSort
[ngClass]="{'overflow-auto error-border bordered-box': flgLoading[0]==='error','overflow-auto bordered-box': true}">
<ng-container matColumnDef="remote_node_pub">
<mat-header-cell class="pl-2" *matHeaderCellDef mat-sort-header> Remote Node Pub </mat-header-cell>
<mat-cell class="pl-2" *matCellDef="let channel">{{channel.channel.remote_node_pub}}</mat-cell>
</ng-container>
<ng-container matColumnDef="local_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Local Balance </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 </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 </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.capacity |
number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="closing_txid">
<mat-header-cell *matHeaderCellDef mat-sort-header> Transaction Id </mat-header-cell>
<mat-cell *matCellDef="let channel">
<div class="flex-ellipsis">{{channel.closing_txid}}</div>
</mat-cell>
</ng-container>
<ng-container matColumnDef="channel_point">
<mat-header-cell class="pl-2" *matHeaderCellDef mat-sort-header> Channel Point </mat-header-cell>
<mat-cell class="pl-2" *matCellDef="let channel">{{channel.channel.channel_point}}</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedClosingColumns"></mat-header-row>
<mat-row fxLayoutAlign="stretch stretch" *matRowDef="let row; columns: displayedClosingColumns;"
(click)="onClosingClick(row, $event)"></mat-row>
</mat-table>
</div>
</mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>Waiting Close Channels({{pendingWaitClosingChannelsLength}})</mat-panel-title>
<mat-progress-bar *ngIf="flgLoading[0]===true" mode="indeterminate"></mat-progress-bar>
</mat-expansion-panel-header>
<div perfectScrollbar fxLayout="row" fxLayoutAlign="start center" fxFlex="100" class="table-container">
<mat-table #table [dataSource]="pendingWaitClosingChannels" matSort
[ngClass]="{'overflow-auto error-border bordered-box': flgLoading[0]==='error','overflow-auto bordered-box': true}">
<ng-container matColumnDef="remote_node_pub">
<mat-header-cell class="pl-2" *matHeaderCellDef mat-sort-header> Remote Node Pub </mat-header-cell>
<mat-cell class="pl-2" *matCellDef="let channel">{{channel.channel.remote_node_pub}}</mat-cell>
</ng-container>
<ng-container matColumnDef="limbo_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Limbo Balance </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.limbo_balance | number}}
</mat-cell>
</ng-container>
<ng-container matColumnDef="local_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Local Balance </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 </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.remote_balance |
<div fxLayout="column" class="mb-2">
<span class="page-title">Total Limbo Balance: {{pendingChannels.total_limbo_balance | number}} {{information?.smaller_currency_unit}}</span>
<mat-accordion displayMode="flat" class="mt-1">
<mat-progress-bar *ngIf="flgLoading[0]===true" mode="indeterminate"></mat-progress-bar>
<mat-expansion-panel fxLayout="column" class="flat-expansion-panel">
<mat-expansion-panel-header>
<mat-panel-title>Pending Open Channels({{pendingOpenChannelsLength}})</mat-panel-title>
</mat-expansion-panel-header>
<div perfectScrollbar class="table-container">
<mat-table #table [dataSource]="pendingOpenChannels" matSort [ngClass]="{'error-border bordered-box': flgLoading[0]==='error','bordered-box': true}">
<ng-container matColumnDef="channel_point">
<mat-header-cell class="pl-2" *matHeaderCellDef mat-sort-header> Channel Point </mat-header-cell>
<mat-cell class="pl-2" *matCellDef="let channel">{{channel.channel.channel_point}}</mat-cell>
</ng-container>
<ng-container matColumnDef="commit_fee">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Commit Fee </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.commit_fee | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="commit_weight">
<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="capacity">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Capacity </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.capacity | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="actions">
<mat-header-cell fxLayoutAlign="end center" class="pl-4 pr-3" *matHeaderCellDef>Actions</mat-header-cell>
<td mat-cell *matCellDef="let channel" class="pl-4">
<span fxLayoutAlign="end center">
<button mat-stroked-button color="primary" type="button" tabindex="1" (click)="onPendingClick(channel,$event)">View Info</button>
</span>
</td>
</ng-container>
<ng-container matColumnDef="no_pending_open">
<td mat-footer-cell *matFooterCellDef colspan="4">
<p *ngIf="!pendingOpenChannels || !pendingOpenChannels.data || pendingOpenChannels.data.length<1">No pending open channels.</p>
</td>
</ng-container>
<tr mat-footer-row fxLayoutAlign="start center" *matFooterRowDef="['no_pending_open']" [ngClass]="{'display-none': pendingOpenChannels && pendingOpenChannels.data && pendingOpenChannels.data.length>0}"></tr>
<mat-header-row *matHeaderRowDef="displayedOpenColumns"></mat-header-row>
<mat-row fxLayoutAlign="stretch stretch" *matRowDef="let row; columns: displayedOpenColumns;"
(click)="onOpenClick(row, $event)"></mat-row>
</mat-table>
</div>
</mat-expansion-panel>
<mat-progress-bar *ngIf="flgLoading[0]===true" mode="indeterminate"></mat-progress-bar>
<mat-expansion-panel fxLayout="column" class="flat-expansion-panel">
<mat-expansion-panel-header>
<mat-panel-title>Pending Force Closing Channels({{pendingForceClosingChannelsLength}})</mat-panel-title>
</mat-expansion-panel-header>
<div perfectScrollbar class="table-container">
<mat-table #table [dataSource]="pendingForceClosingChannels" matSort [ngClass]="{'error-border bordered-box': flgLoading[0]==='error','bordered-box': true}">
<ng-container matColumnDef="channel_point">
<mat-header-cell *matHeaderCellDef mat-sort-header> Channel Point </mat-header-cell>
<mat-cell *matCellDef="let channel">{{channel.channel.channel_point}}</mat-cell>
</ng-container>
<ng-container matColumnDef="recovered_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Recovered Balance </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.recovered_balance | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="limbo_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">Limbo Balance </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 </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.capacity | number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="actions">
<mat-header-cell fxLayoutAlign="end center" class="pl-4 pr-3" *matHeaderCellDef>Actions</mat-header-cell>
<td mat-cell *matCellDef="let channel" class="pl-4">
<span fxLayoutAlign="end center">
<button mat-stroked-button color="primary" type="button" tabindex="2" (click)="onPendingClick(channel,$event)">View Info</button>
</span>
</td>
</ng-container>
<ng-container matColumnDef="no_pending_force_closing">
<td mat-footer-cell *matFooterCellDef colspan="4">
<p *ngIf="!pendingForceClosingChannels || !pendingForceClosingChannels.data || pendingForceClosingChannels.data.length<1">No pending force closing channels.</p>
</td>
</ng-container>
<tr mat-footer-row fxLayoutAlign="start center" *matFooterRowDef="['no_pending_force_closing']" [ngClass]="{'display-none': pendingForceClosingChannels && pendingForceClosingChannels.data && pendingForceClosingChannels.data.length>0}"></tr>
<mat-header-row *matHeaderRowDef="displayedForceClosingColumns"></mat-header-row>
<mat-row fxLayoutAlign="stretch stretch" *matRowDef="let row; columns: displayedForceClosingColumns;"
(click)="onForceClosingClick(row, $event)"></mat-row>
</mat-table>
</div>
</mat-expansion-panel>
<mat-progress-bar *ngIf="flgLoading[0]===true" mode="indeterminate"></mat-progress-bar>
<mat-expansion-panel fxLayout="column" class="flat-expansion-panel">
<mat-expansion-panel-header>
<mat-panel-title>Pending Closing Channels({{pendingClosingChannelsLength}})</mat-panel-title>
</mat-expansion-panel-header>
<div perfectScrollbar class="table-container">
<mat-table #table [dataSource]="pendingClosingChannels" matSort
[ngClass]="{'error-border bordered-box': flgLoading[0]==='error','bordered-box': true}">
<ng-container matColumnDef="channel_point">
<mat-header-cell class="pl-2" *matHeaderCellDef mat-sort-header> Channel Point </mat-header-cell>
<mat-cell class="pl-2" *matCellDef="let channel">{{channel.channel.channel_point}}</mat-cell>
</ng-container>
<ng-container matColumnDef="local_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Local Balance </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 </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 </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.capacity |
number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="capacity">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Capacity </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.capacity |
number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="channel_point">
<mat-header-cell class="pl-2" *matHeaderCellDef mat-sort-header> Channel Point </mat-header-cell>
<mat-cell class="pl-2" *matCellDef="let channel">{{channel.channel.channel_point}}</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedWaitClosingColumns"></mat-header-row>
<mat-row fxLayoutAlign="stretch stretch" *matRowDef="let row; columns: displayedWaitClosingColumns;"
(click)="onWaitClosingClick(row, $event)"></mat-row>
</mat-table>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</ng-container>
<ng-container matColumnDef="actions">
<mat-header-cell fxLayoutAlign="end center" class="pl-4 pr-3" *matHeaderCellDef>Actions</mat-header-cell>
<td mat-cell *matCellDef="let channel" class="pl-4">
<span fxLayoutAlign="end center">
<button mat-stroked-button color="primary" type="button" tabindex="3" (click)="onPendingClick(channel,$event)">View Info</button>
</span>
</td>
</ng-container>
<ng-container matColumnDef="no_pending_closing">
<td mat-footer-cell *matFooterCellDef colspan="4">
<p *ngIf="!pendingClosingChannels || !pendingClosingChannels.data || pendingClosingChannels.data.length<1">No pending closing channels.</p>
</td>
</ng-container>
<tr mat-footer-row fxLayoutAlign="start center" *matFooterRowDef="['no_pending_closing']" [ngClass]="{'display-none': pendingClosingChannels && pendingClosingChannels.data && pendingClosingChannels.data.length>0}"></tr>
<mat-header-row *matHeaderRowDef="displayedClosingColumns"></mat-header-row>
<mat-row fxLayoutAlign="stretch stretch" *matRowDef="let row; columns: displayedClosingColumns;"
(click)="onClosingClick(row, $event)"></mat-row>
</mat-table>
</div>
</mat-expansion-panel>
<mat-progress-bar *ngIf="flgLoading[0]===true" mode="indeterminate"></mat-progress-bar>
<mat-expansion-panel fxLayout="column" class="flat-expansion-panel">
<mat-expansion-panel-header>
<mat-panel-title>Waiting Close Channels({{pendingWaitClosingChannelsLength}})</mat-panel-title>
</mat-expansion-panel-header>
<div perfectScrollbar class="table-container">
<mat-table #table [dataSource]="pendingWaitClosingChannels" matSort
[ngClass]="{'error-border bordered-box': flgLoading[0]==='error','bordered-box': true}">
<ng-container matColumnDef="channel_point">
<mat-header-cell class="pl-2" *matHeaderCellDef mat-sort-header> Channel Point </mat-header-cell>
<mat-cell class="pl-2" *matCellDef="let channel">{{channel.channel.channel_point}}</mat-cell>
</ng-container>
<ng-container matColumnDef="limbo_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Limbo Balance </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.limbo_balance | number}}
</mat-cell>
</ng-container>
<ng-container matColumnDef="local_balance">
<mat-header-cell fxLayoutAlign="end center" *matHeaderCellDef mat-sort-header arrowPosition="before">
Local Balance </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 </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 </mat-header-cell>
<mat-cell fxLayoutAlign="end center" *matCellDef="let channel">{{channel.channel.capacity |
number}}</mat-cell>
</ng-container>
<ng-container matColumnDef="actions">
<mat-header-cell fxLayoutAlign="end center" class="pl-4 pr-3" *matHeaderCellDef>Actions</mat-header-cell>
<td mat-cell *matCellDef="let channel" class="pl-4">
<span fxLayoutAlign="end center">
<button mat-stroked-button color="primary" type="button" tabindex="4" (click)="onPendingClick(channel,$event)">View Info</button>
</span>
</td>
</ng-container>
<ng-container matColumnDef="no_pending_wait_closing">
<td mat-footer-cell *matFooterCellDef colspan="4">
<p *ngIf="!pendingWaitClosingChannels || !pendingWaitClosingChannels.data || pendingWaitClosingChannels.data.length<1">No pending wait closing channels.</p>
</td>
</ng-container>
<tr mat-footer-row fxLayoutAlign="start center" *matFooterRowDef="['no_pending_wait_closing']" [ngClass]="{'py-0': true, 'display-none': pendingWaitClosingChannels && pendingWaitClosingChannels.data && pendingWaitClosingChannels.data.length>0}"></tr>
<mat-header-row *matHeaderRowDef="displayedWaitClosingColumns"></mat-header-row>
<mat-row fxLayoutAlign="stretch stretch" *matRowDef="let row; columns: displayedWaitClosingColumns;"
(click)="onWaitClosingClick(row, $event)"></mat-row>
</mat-table>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>

@ -1,6 +1,3 @@
.flex-ellipsis {
padding-right: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
tr.mat-footer-row td.mat-footer-cell {
border-bottom: none;
}

@ -25,25 +25,22 @@ export class ChannelPendingTableComponent implements OnInit, OnDestroy {
public pendingChannels: PendingChannels = {};
public displayedClosingColumns = [
'closing_txid',
'channel_point', 'remote_balance', 'local_balance', 'remote_node_pub', 'capacity'
'channel_point', 'remote_balance', 'local_balance', 'remote_node_pub', 'capacity', 'actions'
];
public pendingClosingChannelsLength = 0;
public pendingClosingChannels: any;
public displayedForceClosingColumns = [
'closing_txid', 'limbo_balance', 'maturity_height', 'blocks_til_maturity', 'recovered_balance',
'channel_point', 'remote_balance', 'local_balance', 'remote_node_pub', 'capacity'
'channel_point', 'remote_balance', 'local_balance', 'remote_node_pub', 'capacity', 'actions'
];
public pendingForceClosingChannelsLength = 0;
public pendingForceClosingChannels: any;
public displayedOpenColumns = [
'commit_weight', 'confirmation_height', 'fee_per_kw', 'commit_fee',
'channel_point', 'remote_balance', 'local_balance', 'remote_node_pub', 'capacity'
];
public displayedOpenColumns = ['channel_point', 'commit_fee', 'commit_weight', 'capacity', 'actions'];
public pendingOpenChannelsLength = 0;
public pendingOpenChannels: any;
public displayedWaitClosingColumns = [
'limbo_balance',
'channel_point', 'remote_balance', 'local_balance', 'remote_node_pub', 'capacity'
'channel_point', 'remote_balance', 'local_balance', 'remote_node_pub', 'capacity', 'actions'
];
public pendingWaitClosingChannelsLength = 0;
public pendingWaitClosingChannels: any;
@ -53,44 +50,34 @@ export class ChannelPendingTableComponent implements OnInit, OnDestroy {
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.RTLState>, private rtlEffects: RTLEffects) {
switch (true) {
case (window.innerWidth <= 415):
this.displayedClosingColumns = ['remote_node_pub', 'local_balance', 'remote_balance'];
this.displayedForceClosingColumns = ['remote_node_pub', 'recovered_balance', 'limbo_balance'];
this.displayedOpenColumns = ['remote_node_pub', 'local_balance', 'commit_fee'];
this.displayedWaitClosingColumns = ['remote_node_pub', 'limbo_balance', 'local_balance'];
this.displayedClosingColumns = ['channel_point', 'capacity', 'actions'];
this.displayedForceClosingColumns = ['channel_point', 'limbo_balance', 'actions'];
this.displayedOpenColumns = ['channel_point', 'commit_fee', 'actions'];
this.displayedWaitClosingColumns = ['channel_point', 'limbo_balance', 'actions'];
break;
case (window.innerWidth > 415 && window.innerWidth <= 730):
this.displayedClosingColumns = ['remote_node_pub', 'local_balance', 'remote_balance', 'capacity'];
this.displayedForceClosingColumns = ['remote_node_pub', 'recovered_balance', 'limbo_balance', 'blocks_til_maturity', 'maturity_height'];
this.displayedOpenColumns = ['remote_node_pub', 'local_balance', 'commit_fee', 'remote_balance'];
this.displayedWaitClosingColumns = ['remote_node_pub', 'limbo_balance', 'local_balance', 'remote_balance'];
this.displayedClosingColumns = ['channel_point', 'local_balance', 'remote_balance', 'actions'];
this.displayedForceClosingColumns = ['channel_point', 'recovered_balance', 'limbo_balance', 'actions'];
this.displayedOpenColumns = ['channel_point', 'commit_fee', 'commit_weight', 'actions'];
this.displayedWaitClosingColumns = ['channel_point', 'limbo_balance', 'capacity', 'actions'];
break;
case (window.innerWidth > 730 && window.innerWidth <= 1024):
this.displayedClosingColumns = ['remote_node_pub', 'local_balance', 'remote_balance', 'capacity', 'closing_txid'];
this.displayedForceClosingColumns = ['remote_node_pub', 'recovered_balance', 'limbo_balance', 'blocks_til_maturity', 'maturity_height', 'local_balance'];
this.displayedOpenColumns = ['remote_node_pub', 'local_balance', 'commit_fee', 'remote_balance', 'capacity'];
this.displayedWaitClosingColumns = ['remote_node_pub', 'limbo_balance', 'local_balance', 'remote_balance', 'capacity', 'channel_point'];
this.displayedClosingColumns = ['channel_point', 'local_balance', 'remote_balance', 'capacity', 'actions'];
this.displayedForceClosingColumns = ['channel_point', 'recovered_balance', 'limbo_balance', 'capacity', 'actions'];
this.displayedOpenColumns = ['channel_point', 'commit_fee', 'commit_weight', 'capacity', 'actions'];
this.displayedWaitClosingColumns = ['channel_point', 'limbo_balance', 'local_balance', 'remote_balance', 'actions'];
break;
case (window.innerWidth > 1024 && window.innerWidth <= 1280):
this.displayedClosingColumns = ['remote_node_pub', 'local_balance', 'remote_balance', 'capacity', 'closing_txid', 'channel_point'];
this.displayedForceClosingColumns = [
'remote_node_pub', 'recovered_balance', 'limbo_balance', 'blocks_til_maturity',
'maturity_height', 'local_balance', 'remote_balance', 'capacity', 'closing_txid', 'channel_point'
];
this.displayedOpenColumns = [
'remote_node_pub', 'local_balance', 'commit_fee', 'remote_balance', 'capacity', 'commit_weight', 'fee_per_kw', 'confirmation_height', 'channel_point'
];
this.displayedWaitClosingColumns = ['remote_node_pub', 'limbo_balance', 'local_balance', 'remote_balance', 'capacity', 'channel_point'];
this.displayedClosingColumns = ['channel_point', 'local_balance', 'remote_balance', 'capacity', 'actions'];
this.displayedForceClosingColumns = ['channel_point', 'recovered_balance', 'limbo_balance', 'capacity', 'actions'];
this.displayedOpenColumns = ['channel_point', 'commit_fee', 'commit_weight', 'capacity', 'actions'];
this.displayedWaitClosingColumns = ['channel_point', 'limbo_balance', 'local_balance', 'remote_balance', 'actions'];
break;
default:
this.displayedClosingColumns = ['remote_node_pub', 'local_balance', 'remote_balance', 'capacity', 'closing_txid', 'channel_point'];
this.displayedForceClosingColumns = [
'remote_node_pub', 'recovered_balance', 'limbo_balance', 'blocks_til_maturity',
'maturity_height', 'local_balance', 'remote_balance', 'capacity', 'closing_txid', 'channel_point'
];
this.displayedOpenColumns = [
'remote_node_pub', 'local_balance', 'commit_fee', 'remote_balance', 'capacity', 'commit_weight', 'fee_per_kw', 'confirmation_height', 'channel_point'
];
this.displayedWaitClosingColumns = ['remote_node_pub', 'limbo_balance', 'local_balance', 'remote_balance', 'capacity', 'channel_point'];
this.displayedClosingColumns = ['channel_point', 'local_balance', 'remote_balance', 'capacity', 'actions'];
this.displayedForceClosingColumns = ['channel_point', 'recovered_balance', 'limbo_balance', 'capacity', 'actions'];
this.displayedOpenColumns = ['channel_point', 'commit_fee', 'commit_weight', 'capacity', 'actions'];
this.displayedWaitClosingColumns = ['channel_point', 'limbo_balance', 'local_balance', 'remote_balance', 'actions'];
break;
}
}
@ -108,23 +95,23 @@ export class ChannelPendingTableComponent implements OnInit, OnDestroy {
this.selNode = rtlStore.nodeSettings;
this.information = rtlStore.information;
this.pendingChannels = rtlStore.pendingChannels;
if (undefined !== this.pendingChannels.total_limbo_balance) {
if (this.pendingChannels.total_limbo_balance) {
this.flgLoading[1] = false;
if (undefined !== this.pendingChannels.pending_closing_channels) {
if (this.pendingChannels.pending_closing_channels) {
this.loadClosingChannelsTable(this.pendingChannels.pending_closing_channels);
}
if (undefined !== this.pendingChannels.pending_force_closing_channels) {
if (this.pendingChannels.pending_force_closing_channels) {
this.loadForceClosingChannelsTable(this.pendingChannels.pending_force_closing_channels);
}
if (undefined !== this.pendingChannels.pending_open_channels) {
if (this.pendingChannels.pending_open_channels) {
this.loadOpenChannelsTable(this.pendingChannels.pending_open_channels);
}
if (undefined !== this.pendingChannels.waiting_close_channels) {
if (this.pendingChannels.waiting_close_channels) {
this.loadWaitClosingChannelsTable(this.pendingChannels.waiting_close_channels);
}
}
if (this.flgLoading[0] !== 'error') {
this.flgLoading[0] = (undefined !== this.information.identity_pubkey) ? false : true;
this.flgLoading[0] = (this.information.identity_pubkey) ? false : true;
}
this.logger.info(rtlStore);
});
@ -191,7 +178,7 @@ export class ChannelPendingTableComponent implements OnInit, OnDestroy {
channels.sort(function(a, b) {
return (a.active === b.active) ? 0 : ((b.active) ? -1 : 1);
});
this.pendingOpenChannelsLength = (undefined !== channels.length) ? channels.length : 0;
this.pendingOpenChannelsLength = (channels.length) ? channels.length : 0;
this.pendingOpenChannels = new MatTableDataSource<Channel>([...channels]);
this.pendingOpenChannels.sort = this.sort;
this.logger.info(this.pendingOpenChannels);
@ -201,7 +188,7 @@ export class ChannelPendingTableComponent implements OnInit, OnDestroy {
channels.sort(function(a, b) {
return (a.active === b.active) ? 0 : ((b.active) ? -1 : 1);
});
this.pendingForceClosingChannelsLength = (undefined !== channels.length) ? channels.length : 0;
this.pendingForceClosingChannelsLength = (channels.length) ? channels.length : 0;
this.pendingForceClosingChannels = new MatTableDataSource<Channel>([...channels]);
this.pendingForceClosingChannels.sort = this.sort;
this.logger.info(this.pendingForceClosingChannels);
@ -211,7 +198,7 @@ export class ChannelPendingTableComponent implements OnInit, OnDestroy {
channels.sort(function(a, b) {
return (a.active === b.active) ? 0 : ((b.active) ? -1 : 1);
});
this.pendingClosingChannelsLength = (undefined !== channels.length) ? channels.length : 0;
this.pendingClosingChannelsLength = (channels.length) ? channels.length : 0;
this.pendingClosingChannels = new MatTableDataSource<Channel>([...channels]);
this.pendingClosingChannels.sort = this.sort;
this.logger.info(this.pendingClosingChannels);
@ -221,7 +208,7 @@ export class ChannelPendingTableComponent implements OnInit, OnDestroy {
channels.sort(function(a, b) {
return (a.active === b.active) ? 0 : ((b.active) ? -1 : 1);
});
this.pendingWaitClosingChannelsLength = (undefined !== channels.length) ? channels.length : 0;
this.pendingWaitClosingChannelsLength = (channels.length) ? channels.length : 0;
this.pendingWaitClosingChannels = new MatTableDataSource<Channel>([...channels]);
this.pendingWaitClosingChannels.sort = this.sort;
this.logger.info(this.pendingWaitClosingChannels);
@ -231,6 +218,21 @@ export class ChannelPendingTableComponent implements OnInit, OnDestroy {
this.selectedFilter = selFilter;
}
onPendingClick(selRow: any, event: any) {
// // const flgExpansionClicked = event.target.className.includes('mat-expansion-panel-header') || event.target.className.includes('mat-expansion-indicator');
// // if (flgExpansionClicked) { return; }
// const selPayment = this.payments.data.filter(payment => {
// return payment.payment_hash === selRow.payment_hash;
// })[0];
// const reorderedPayment = JSON.parse(JSON.stringify(selPayment, [
// 'creation_date_str', 'payment_hash', 'fee', 'value_msat', 'value_sat', 'value', 'payment_preimage', 'path'
// ] , 2));
// this.store.dispatch(new RTLActions.OpenAlert({config: { width: '75%', data: {
// type: 'INFO',
// message: JSON.stringify(reorderedPayment)
// }}}));
}
ngOnDestroy() {
this.unsub.forEach(completeSub => {
completeSub.next();

@ -51,7 +51,7 @@
</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef class="pr-3"><span fxLayoutAlign="end center">Actions</span></th>
<th mat-header-cell *matHeaderCellDef class="pr-3"><span fxLayoutAlign="end center">Actions</span></th>
<td mat-cell *matCellDef="let peer" fxLayoutAlign="end center">
<div fxFlex="100" class="bordered-box table-actions-select" fxLayoutAlign="center center">
<mat-select placeholder="Actions" tabindex="1" class="mr-0">
@ -68,9 +68,9 @@
<p *ngIf="!peers.data || peers.data.length<1">No connected peers.</p>
</td>
</ng-container>
<tr mat-footer-row *matFooterRowDef="['no_peer']" [ngClass]="{'display-none': peers.data && peers.data.length>1}"></tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: flgSticky;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [@newlyAddedRowAnimation]="(row.pub_key === newlyAddedPeer && flgAnimate) ? 'added' : 'notAdded'"></tr>
<tr mat-footer-row *matFooterRowDef="['no_peer']" [ngClass]="{'display-none': peers.data && peers.data.length>1}"></tr>
</table>
</div>
<mat-paginator [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions" showFirstLastButtons class="mb-4"></mat-paginator>

@ -56,7 +56,7 @@ export class LNDEffects implements OnDestroy {
this.initializeRemainingData(info, action.payload.loadPage);
return {
type: RTLActions.SET_INFO,
payload: (undefined !== info) ? info : {}
payload: info ? info : {}
};
}
}),
@ -103,7 +103,7 @@ export class LNDEffects implements OnDestroy {
this.logger.info(peers);
return {
type: RTLActions.SET_PEERS,
payload: (undefined !== peers) ? peers : []
payload: peers ? peers : []
};
}),
catchError((err: any) => {
@ -126,7 +126,7 @@ export class LNDEffects implements OnDestroy {
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '70%', data: { type: 'SUCCESS', titleMessage: 'Peer Added Successfully!' }}}));
return {
type: RTLActions.SET_PEERS,
payload: (undefined !== postRes && postRes.length > 0) ? postRes : []
payload: (postRes && postRes.length > 0) ? postRes : []
};
}),
catchError((err: any) => {
@ -365,7 +365,7 @@ export class LNDEffects implements OnDestroy {
this.logger.info(fees);
return {
type: RTLActions.SET_FEES,
payload: (undefined !== fees) ? fees : {}
payload: fees ? fees : {}
};
}),
catchError((err: any) => {
@ -389,7 +389,7 @@ export class LNDEffects implements OnDestroy {
const emptyRes = (action.payload === 'channels') ? { balance: '', btc_balance: '' } : { total_balance: '', btc_total_balance: '' };
return {
type: RTLActions.SET_BALANCE,
payload: (undefined !== res) ? { target: action.payload, balance: res } : { target: action.payload, balance: emptyRes }
payload: res ? { target: action.payload, balance: res } : { target: action.payload, balance: emptyRes }
};
}),
catchError((err: any) => {
@ -411,7 +411,7 @@ export class LNDEffects implements OnDestroy {
this.logger.info(networkInfo);
return {
type: RTLActions.SET_NETWORK,
payload: (undefined !== networkInfo) ? networkInfo : {}
payload: networkInfo ? networkInfo : {}
};
}),
catchError((err: any) => {
@ -449,17 +449,17 @@ export class LNDEffects implements OnDestroy {
this.store.dispatch(new RTLActions.SetNodePendingChannelsData(pendingChannels));
return {
type: RTLActions.SET_PENDING_CHANNELS,
payload: (undefined !== channels) ? { channels: channels, pendingChannels: pendingChannels } : {channels: {}, pendingChannels: pendingChannels}
payload: channels ? { channels: channels, pendingChannels: pendingChannels } : {channels: {}, pendingChannels: pendingChannels}
};
} else if (action.payload.routeParam === 'closed') {
return {
type: RTLActions.SET_CLOSED_CHANNELS,
payload: (undefined !== channels && undefined !== channels.channels && channels.channels.length > 0) ? channels.channels : []
payload: (channels && channels.channels && channels.channels.length > 0) ? channels.channels : []
};
} else if (action.payload.routeParam === 'all') {
return {
type: RTLActions.SET_CHANNELS,
payload: (undefined !== channels && undefined !== channels.channels && channels.channels.length > 0) ? channels.channels : []
payload: (channels && channels.channels && channels.channels.length > 0) ? channels.channels : []
};
}
},
@ -508,7 +508,7 @@ export class LNDEffects implements OnDestroy {
this.logger.info(transactions);
return {
type: RTLActions.SET_TRANSACTIONS,
payload: (undefined !== transactions && transactions.length > 0) ? transactions : []
payload: (transactions && transactions.length > 0) ? transactions : []
};
}),
catchError((err: any) => {
@ -528,7 +528,7 @@ export class LNDEffects implements OnDestroy {
this.logger.info(payments);
return {
type: RTLActions.SET_PAYMENTS,
payload: (undefined !== payments && null != payments) ? payments : []
payload: payments ? payments : []
};
}),
catchError((err: any) => {
@ -548,7 +548,7 @@ export class LNDEffects implements OnDestroy {
this.store.dispatch(new RTLActions.CloseSpinner());
return {
type: RTLActions.SET_DECODED_PAYMENT,
payload: (undefined !== decodedPayment) ? decodedPayment : {}
payload: decodedPayment ? decodedPayment : {}
};
}),
catchError((err: any) => {
@ -636,7 +636,7 @@ export class LNDEffects implements OnDestroy {
this.store.dispatch(new RTLActions.CloseSpinner());
return {
type: RTLActions.SET_GRAPH_NODE,
payload: (undefined !== graphNode) ? graphNode : {}
payload: graphNode ? graphNode : {}
};
}),
catchError((err: any) => {
@ -665,7 +665,7 @@ export class LNDEffects implements OnDestroy {
this.store.dispatch(new RTLActions.CloseSpinner());
return {
type: RTLActions.SET_NEW_ADDRESS,
payload: (undefined !== newAddress && undefined !== newAddress.address) ? newAddress.address : {}
payload: (newAddress && newAddress.address) ? newAddress.address : {}
};
}),
catchError((err: any) => {
@ -998,7 +998,7 @@ export class LNDEffects implements OnDestroy {
initializeRemainingData(info: any, landingPage: string) {
this.sessionService.setItem('lndUnlocked', 'true');
if (undefined !== info.chains) {
if (info.chains) {
if (typeof info.chains[0] === 'string') {
info.smaller_currency_unit = (info.chains[0].toString().toLowerCase().indexOf('bitcoin') < 0) ? CurrencyUnitEnum.LITOSHIS : CurrencyUnitEnum.SATS;
info.currency_unit = (info.chains[0].toString().toLowerCase().indexOf('bitcoin') < 0) ? CurrencyUnitEnum.LTC : CurrencyUnitEnum.BTC;

@ -64,11 +64,17 @@
<td mat-cell *matCellDef="let invoice" class="pl-4">{{invoice.settle_date_str || '-'}}</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef class="pr-3"><span fxLayoutAlign="end center">Actions</span></th>
<th mat-header-cell *matHeaderCellDef class="pr-3"><span fxLayoutAlign="end center">Actions</span></th>
<td mat-cell *matCellDef="let invoice">
<button mat-stroked-button color="primary" type="button" tabindex="4" (click)="onInvoiceClick(invoice, $event)">View Info</button>
</td>
</ng-container>
<ng-container matColumnDef="no_invoice">
<td mat-footer-cell *matFooterCellDef colspan="4">
<p *ngIf="!invoices.data || invoices.data.length<1">No invoices available.</p>
</td>
</ng-container>
<tr mat-footer-row *matFooterRowDef="['no_invoice']" [ngClass]="{'display-none': invoices.data && invoices.data.length>0}"></tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: flgSticky;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [@newlyAddedRowAnimation]="(row.memo == newlyAddedInvoiceMemo && row.value == newlyAddedInvoiceValue && flgAnimate) ? 'added' : 'notAdded'" class="row-invoices"></tr>
</table>

@ -49,6 +49,12 @@
<button mat-stroked-button color="primary" type="button" tabindex="4" (click)="onPaymentClick(payment,$event)">View Info</button>
</td>
</ng-container>
<ng-container matColumnDef="no_payment">
<td mat-footer-cell *matFooterCellDef colspan="4">
<p *ngIf="!payments.data || payments.data.length<1">No payments available.</p>
</td>
</ng-container>
<tr mat-footer-row *matFooterRowDef="['no_payment']" [ngClass]="{'display-none': payments.data && payments.data.length>0}"></tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: flgSticky;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [@newlyAddedRowAnimation]="(row.payment_hash === newlyAddedPayment && flgAnimate) ? 'added' : 'notAdded'"></tr>
</table>

@ -262,4 +262,13 @@
color: $foreground-text;
}
}
.mat-expansion-panel.flat-expansion-panel {
box-shadow: none;
padding: 0;
border: 1px solid $foreground-divider;
border-radius: 4px;
background: none;
}
}

@ -267,6 +267,10 @@ body {
margin-left: 1rem !important;
}
.ml-minus-1 {
margin-left: -1rem !important;
}
.mr-0 {
margin-right: 0 !important;
}

Loading…
Cancel
Save