mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2026-08-13 12:33:07 +02:00
CLN Manual Testing Done
This commit is contained in:
parent
7f275be31e
commit
c70911cdd3
48 changed files with 187 additions and 136 deletions
|
|
@ -238,7 +238,19 @@ export class DatabaseAdapter {
|
|||
try {
|
||||
const otherFiles = fs.readdirSync(this.dbFilePath);
|
||||
otherFiles.forEach((oFileName) => {
|
||||
if (oFileName.endsWith('.json') && oFileName !== ('rtldb-' + this.selNode.ln_implementation + '-' + collectionName + '.json')) {
|
||||
let collectionValid = false;
|
||||
switch (this.selNode.ln_implementation) {
|
||||
case 'CLN':
|
||||
collectionValid = CLNCollection.reduce((acc, collection) => acc || oFileName === ('rtldb-' + this.selNode.ln_implementation + '-' + collection + '.json'), false);
|
||||
break;
|
||||
case 'ECL':
|
||||
collectionValid = ECLCollection.reduce((acc, collection) => acc || oFileName === ('rtldb-' + this.selNode.ln_implementation + '-' + collection + '.json'), false);
|
||||
break;
|
||||
default:
|
||||
collectionValid = LNDCollection.reduce((acc, collection) => acc || oFileName === ('rtldb-' + this.selNode.ln_implementation + '-' + collection + '.json'), false);
|
||||
break;
|
||||
}
|
||||
if (oFileName.endsWith('.json') && !collectionValid) {
|
||||
fs.renameSync(this.dbFilePath + sep + oFileName, this.dbFilePath + sep + oFileName + '.tmp');
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -239,7 +239,21 @@ export class DatabaseAdapter {
|
|||
try {
|
||||
const otherFiles = fs.readdirSync(this.dbFilePath);
|
||||
otherFiles.forEach((oFileName) => {
|
||||
if (oFileName.endsWith('.json') && oFileName !== ('rtldb-' + this.selNode.ln_implementation + '-' + collectionName + '.json')) {
|
||||
let collectionValid = false;
|
||||
switch (this.selNode.ln_implementation) {
|
||||
case 'CLN':
|
||||
collectionValid = CLNCollection.reduce((acc, collection) => acc || oFileName === ('rtldb-' + this.selNode.ln_implementation + '-' + collection + '.json'), false);
|
||||
break;
|
||||
|
||||
case 'ECL':
|
||||
collectionValid = ECLCollection.reduce((acc, collection) => acc || oFileName === ('rtldb-' + this.selNode.ln_implementation + '-' + collection + '.json'), false);
|
||||
break;
|
||||
|
||||
default:
|
||||
collectionValid = LNDCollection.reduce((acc, collection) => acc || oFileName === ('rtldb-' + this.selNode.ln_implementation + '-' + collection + '.json'), false);
|
||||
break;
|
||||
}
|
||||
if (oFileName.endsWith('.json') && !collectionValid) {
|
||||
fs.renameSync(this.dbFilePath + sep + oFileName, this.dbFilePath + sep + oFileName + '.tmp');
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ export class CLNLiquidityAdsListComponent implements OnInit, OnDestroy {
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
<ng-template mat-tab-label>
|
||||
<span matBadge="{{numUtxos}}" matBadgeOverlap="false" class="tab-badge">UTXOs</span>
|
||||
</ng-template>
|
||||
<rtl-cln-on-chain-utxos [numDustUTXOs]="numDustUtxos" [isDustUTXO]="false" xLayout="row" fxFlex="100"></rtl-cln-on-chain-utxos>
|
||||
<rtl-cln-on-chain-utxos [numDustUTXOs]="numDustUtxos" [isDustUTXO]="false" [dustAmount]="DUST_AMOUNT" fxLayout="row" fxFlex="100"></rtl-cln-on-chain-utxos>
|
||||
</mat-tab>
|
||||
<mat-tab>
|
||||
<ng-template mat-tab-label>
|
||||
<span matBadge="{{numDustUtxos}}" matBadgeOverlap="false" class="tab-badge">Dust UTXOs</span>
|
||||
</ng-template>
|
||||
<rtl-cln-on-chain-utxos [numDustUTXOs]="numDustUtxos" [isDustUTXO]="true" fxLayout="row" fxFlex="100"></rtl-cln-on-chain-utxos>
|
||||
<rtl-cln-on-chain-utxos [numDustUTXOs]="numDustUtxos" [isDustUTXO]="true" [dustAmount]="DUST_AMOUNT" fxLayout="row" fxFlex="100"></rtl-cln-on-chain-utxos>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ export class CLNUTXOTablesComponent implements OnInit, OnDestroy {
|
|||
@Output() readonly selectedTableIndexChange = new EventEmitter<number>();
|
||||
public numUtxos = 0;
|
||||
public numDustUtxos = 0;
|
||||
public DUST_AMOUNT = 1000;
|
||||
private unSubs: Array<Subject<void>> = [new Subject(), new Subject()];
|
||||
|
||||
constructor(private logger: LoggerService, private store: Store<RTLState>) { }
|
||||
|
|
@ -30,7 +31,7 @@ export class CLNUTXOTablesComponent implements OnInit, OnDestroy {
|
|||
subscribe((utxosSeletor: { utxos: UTXO[], apiCallStatus: ApiCallStatusPayload }) => {
|
||||
if (utxosSeletor.utxos && utxosSeletor.utxos.length > 0) {
|
||||
this.numUtxos = utxosSeletor.utxos.length || 0;
|
||||
this.numDustUtxos = utxosSeletor.utxos?.filter((utxo) => +(utxo.value || 0) < 1000).length || 0;
|
||||
this.numDustUtxos = utxosSeletor.utxos?.filter((utxo) => +(utxo.value || 0) < this.DUST_AMOUNT).length || 0;
|
||||
}
|
||||
this.logger.info(utxosSeletor);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,18 +16,19 @@
|
|||
<div [perfectScrollbar] class="table-container" fxFlex="100">
|
||||
<mat-progress-bar *ngIf="apiCallStatus?.status === apiCallStatusEnum.INITIATED" mode="indeterminate"></mat-progress-bar>
|
||||
<table mat-table #table [dataSource]="listUTXOs" matSort [ngClass]="{'overflow-auto error-border': errorMessage !== '','overflow-auto': true}">
|
||||
<ng-container matColumnDef="is_dust">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before" matTooltip="Dust/Nondust"></th>
|
||||
<td mat-cell *matCellDef="let utxo">
|
||||
<span *ngIf="numDustUTXOs > 0 && !isDustUTXO && utxo.value < dustAmount; else emptySpace" matTooltip="Risk of dust attack" matTooltipPosition="right">
|
||||
<mat-icon fxLayoutAlign="start center" color="warn" class="small-icon">warning</mat-icon>
|
||||
</span>
|
||||
</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="status">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before" matTooltip="Status"></th>
|
||||
<td mat-cell *matCellDef="let utxo">
|
||||
<span fxLayout="row" fxLayoutAlign="end center" >
|
||||
<span *ngIf="numDustUTXOs > 0 && !isDustUTXO">
|
||||
<span *ngIf="utxo.value < 1000; else emptySpace" matTooltip="Risk of dust attack" matTooltipPosition="right">
|
||||
<mat-icon fxLayoutAlign="start start" color="warn" class="mr-1">warning</mat-icon>
|
||||
</span>
|
||||
</span>
|
||||
<span *ngIf="utxo.status === 'confirmed'" class="dot green" matTooltip="Confirmed" matTooltipPosition="right"></span>
|
||||
<span *ngIf="utxo.status !== 'confirmed'" class="dot yellow" matTooltip="{{utxo.status | titlecase}}" matTooltipPosition="right"></span>
|
||||
</span>
|
||||
<span *ngIf="utxo.status === 'confirmed'" class="dot green" matTooltip="Confirmed" matTooltipPosition="right"></span>
|
||||
<span *ngIf="utxo.status !== 'confirmed'" class="dot yellow" matTooltip="{{utxo.status | titlecase}}" matTooltipPosition="right"></span>
|
||||
</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="txid">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
.mat-column-is_dust {
|
||||
max-width: 1.2rem;
|
||||
width: 1.2rem;
|
||||
}
|
||||
|
||||
.mat-column-status {
|
||||
max-width: 1.2rem;
|
||||
width:1.2rem;
|
||||
width: 1.2rem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ export class CLNOnChainUtxosComponent implements OnInit, AfterViewInit, OnDestro
|
|||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
@Input() numDustUTXOs = 0;
|
||||
@Input() isDustUTXO = false;
|
||||
@Input() dustAmount = 1000;
|
||||
public nodePageDefs = CLN_PAGE_DEFS;
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
|
|
@ -40,6 +41,7 @@ export class CLNOnChainUtxosComponent implements OnInit, AfterViewInit, OnDestro
|
|||
public tableSetting: TableSetting = { tableId: 'utxos', recordsPerPage: PAGE_SIZE, sortBy: 'status', sortOrder: SortOrderEnum.DESCENDING };
|
||||
public displayedColumns: any[] = [];
|
||||
public utxos: UTXO[];
|
||||
public dustUtxos: UTXO[];
|
||||
public listUTXOs: any = new MatTableDataSource([]);
|
||||
public pageSize = PAGE_SIZE;
|
||||
public pageSizeOptions = PAGE_SIZE_OPTIONS;
|
||||
|
|
@ -79,17 +81,27 @@ export class CLNOnChainUtxosComponent implements OnInit, AfterViewInit, OnDestro
|
|||
this.logger.info(this.displayedColumns);
|
||||
});
|
||||
this.store.select(utxos).pipe(takeUntil(this.unSubs[1])).
|
||||
subscribe((utxosSeletor: { utxos: UTXO[], apiCallStatus: ApiCallStatusPayload }) => {
|
||||
subscribe((utxosSelector: { utxos: UTXO[], apiCallStatus: ApiCallStatusPayload }) => {
|
||||
this.errorMessage = '';
|
||||
this.apiCallStatus = utxosSeletor.apiCallStatus;
|
||||
this.apiCallStatus = utxosSelector.apiCallStatus;
|
||||
if (this.apiCallStatus.status === APICallStatusEnum.ERROR) {
|
||||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
this.utxos = (this.isDustUTXO) ? utxosSeletor.utxos?.filter((utxo) => +(utxo.value || 0) < 1000) : utxosSeletor.utxos ? utxosSeletor.utxos : [];
|
||||
if (this.utxos && this.utxos.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadUTXOsTable(this.utxos);
|
||||
if (utxosSelector.utxos && utxosSelector.utxos.length > 0) {
|
||||
this.dustUtxos = utxosSelector.utxos?.filter((utxo) => +(utxo.value || 0) < this.dustAmount);
|
||||
this.utxos = utxosSelector.utxos;
|
||||
if (this.isDustUTXO) {
|
||||
if (this.dustUtxos && this.dustUtxos.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadUTXOsTable(this.dustUtxos);
|
||||
}
|
||||
} else {
|
||||
this.displayedColumns.unshift('is_dust');
|
||||
if (this.utxos && this.utxos.length > 0 && this.sort && this.paginator && this.displayedColumns.length > 0) {
|
||||
this.loadUTXOsTable(this.utxos);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.logger.info(utxosSeletor);
|
||||
this.logger.info(utxosSelector);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -125,7 +137,7 @@ export class CLNOnChainUtxosComponent implements OnInit, AfterViewInit, OnDestro
|
|||
|
||||
getLabel(column: string) {
|
||||
const returnColumn: ColumnDefinition = this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find((col) => col.column === column);
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : column === 'is_dust' ? 'Dust' : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
|
|
@ -136,17 +148,30 @@ export class CLNOnChainUtxosComponent implements OnInit, AfterViewInit, OnDestro
|
|||
rowToFilter = JSON.stringify(rowData).toLowerCase();
|
||||
break;
|
||||
|
||||
case 'is_dust':
|
||||
rowToFilter = (rowData?.value || 0) < this.dustAmount ? 'dust' : 'nondust';
|
||||
break;
|
||||
|
||||
case 'status':
|
||||
rowToFilter = rowData?.status?.toLowerCase() || '';
|
||||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
return (this.selFilterBy === 'is_dust' || this.selFilterBy === 'status') ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
};
|
||||
}
|
||||
|
||||
loadUTXOsTable(utxos: any[]) {
|
||||
this.listUTXOs = new MatTableDataSource<UTXO>([...utxos]);
|
||||
this.listUTXOs.sortingDataAccessor = (data: any, sortHeaderId: string) => ((data[sortHeaderId] && isNaN(data[sortHeaderId])) ? data[sortHeaderId].toLocaleLowerCase() : data[sortHeaderId] ? +data[sortHeaderId] : null);
|
||||
this.listUTXOs.sortingDataAccessor = (data: UTXO, sortHeaderId: string) => {
|
||||
switch (sortHeaderId) {
|
||||
case 'is_dust': return +(data.value || 0) < this.dustAmount;
|
||||
default: return (data[sortHeaderId] && isNaN(data[sortHeaderId])) ? data[sortHeaderId].toLocaleLowerCase() : data[sortHeaderId] ? +data[sortHeaderId] : null;
|
||||
}
|
||||
};
|
||||
this.listUTXOs.sort = this.sort;
|
||||
this.listUTXOs.sort?.sort({ id: this.tableSetting.sortBy, start: this.tableSetting.sortOrder, disableClear: true });
|
||||
this.listUTXOs.paginator = this.paginator;
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ export class CLNChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return this.selFilterBy === 'connected' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ export class CLNChannelPendingTableComponent implements OnInit, AfterViewInit, O
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return (this.selFilterBy === 'connected' || this.selFilterBy === 'state') ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -210,11 +210,11 @@ export class CLNPeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
break;
|
||||
|
||||
case 'netaddr':
|
||||
rowToFilter = (rowData?.netaddr?.reduce((acc, curr) => acc + curr), ' ') || '';
|
||||
rowToFilter = rowData.netaddr ? rowData.netaddr.reduce((acc, curr) => acc + curr, ' ') : '';
|
||||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return this.selFilterBy === 'connected' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ export class CLNFailedTransactionsComponent implements OnInit, AfterViewInit, On
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ export class CLNForwardingHistoryComponent implements OnInit, OnChanges, AfterVi
|
|||
}
|
||||
}
|
||||
if (changes.selFilter && !changes.selFilter.firstChange) {
|
||||
this.selFilterBy = 'all';
|
||||
this.applyFilter();
|
||||
}
|
||||
}
|
||||
|
|
@ -182,7 +183,7 @@ export class CLNForwardingHistoryComponent implements OnInit, OnChanges, AfterVi
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ export class CLNLocalFailedTransactionsComponent implements OnInit, AfterViewIni
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return this.selFilterBy === 'failreason' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
<div fxLayout="column" fxLayoutAlign="start stretch" class="padding-gap-x">
|
||||
<div class="p-2 error-border my-2" *ngIf="errorMessage !== ''">{{errorMessage}}</div>
|
||||
<div *ngIf="errorMessage === ''" fxLayout="column" fxLayout.gt-md="row" fxFlex="100" fxLayoutAlign="space-between stretch" class="page-sub-title-container">
|
||||
<div *ngIf="errorMessage === ''" fxLayout="column" fxLayout.gt-md="row" fxFlex="100" fxLayoutAlign="space-between stretch" class="page-sub-title-container mt-2">
|
||||
<div fxLayout="column" fxFlex="49" fxLayoutAlign="start stretch">
|
||||
<div fxLayout="column" fxLayout.gt-sm="row" fxLayoutAlign.gt-sm="space-between center" fxLayoutAlign="start stretch" class="page-sub-title-container w-100" [ngClass]="{'mt-2': screenSize === screenSizeEnum.XS, 'mt-1': screenSize === screenSizeEnum.SM}">
|
||||
<div fxFlex="70">Incoming</div>
|
||||
<div fxFlex="30" fxLayoutAlign.gt-xs="space-between center" fxLayout="row" fxLayoutAlign="space-between stretch">
|
||||
<mat-form-field fxFlex="49">
|
||||
<mat-select placeholder="Filter By" tabindex="1" [(ngModel)]="selFilterByIn" (selectionChange)="selFilterIn=''; applyFilterIncoming()" name="filterByIn">
|
||||
<mat-option *ngFor="let column of ['all'].concat(displayedColumns)" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<!-- <mat-form-field fxFlex="49">
|
||||
<mat-select placeholder="Filter By" tabindex="1" [(ngModel)]="selFilterByIn" (selectionChange)="selFilterIn=''; applyIncomingFilter()" name="filterByIn">
|
||||
<mat-option *ngFor="let column of ['all'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="49">
|
||||
<input matInput [(ngModel)]="selFilterIn" (input)="applyFilterIncoming()" (keyup)="applyFilterIncoming()" name="filterin" placeholder="Filter">
|
||||
</mat-form-field>
|
||||
<input matInput [(ngModel)]="selFilterIn" (input)="applyIncomingFilter()" (keyup)="applyIncomingFilter()" name="filterin" placeholder="Filter">
|
||||
</mat-form-field> -->
|
||||
</div>
|
||||
</div>
|
||||
<div [perfectScrollbar] fxLayout="column" fxLayoutAlign="start stretch" fxFlex="100" class="table-container">
|
||||
|
|
@ -65,14 +65,14 @@
|
|||
<div fxLayout="column" fxLayout.gt-sm="row" fxLayoutAlign.gt-sm="space-between center" fxLayoutAlign="start stretch" class="page-sub-title-container w-100" [ngClass]="{'mt-2': screenSize !== screenSizeEnum.LG}">
|
||||
<div fxFlex="70">Outgoing</div>
|
||||
<div fxFlex="30" fxLayoutAlign.gt-xs="space-between center" fxLayout="row" fxLayoutAlign="space-between stretch">
|
||||
<mat-form-field fxFlex="49">
|
||||
<mat-select placeholder="Filter By" tabindex="1" [(ngModel)]="selFilterByOut" (selectionChange)="selFilterOut=''; applyFilterOutgoing()" name="filterByOut">
|
||||
<!-- <mat-form-field fxFlex="49">
|
||||
<mat-select placeholder="Filter By" tabindex="1" [(ngModel)]="selFilterByOut" (selectionChange)="selFilterOut=''; applyOutgoingFilter()" name="filterByOut">
|
||||
<mat-option *ngFor="let column of ['all'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="49">
|
||||
<input matInput [(ngModel)]="selFilterOut" (input)="applyFilterOutgoing()" (keyup)="applyFilterOutgoing()" name="filterout" placeholder="Filter">
|
||||
</mat-form-field>
|
||||
<input matInput [(ngModel)]="selFilterOut" (input)="applyOutgoingFilter()" (keyup)="applyOutgoingFilter()" name="filterout" placeholder="Filter">
|
||||
</mat-form-field> -->
|
||||
</div>
|
||||
</div>
|
||||
<div [perfectScrollbar] fxLayout="column" fxLayoutAlign="start end" fxFlex="100" class="table-container">
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ export class CLNRoutingPeersComponent implements OnInit, OnChanges, AfterViewIni
|
|||
public tableSetting: TableSetting = { tableId: 'routing_peers', recordsPerPage: PAGE_SIZE, sortBy: 'total_fee', sortOrder: SortOrderEnum.DESCENDING };
|
||||
public successfulEvents: ForwardingEvent[] = [];
|
||||
public displayedColumns: any[] = [];
|
||||
public routingPeersIncoming: any = [];
|
||||
public routingPeersOutgoing: any = [];
|
||||
public routingPeersIncoming: any = new MatTableDataSource([]);
|
||||
public routingPeersOutgoing: any = new MatTableDataSource([]);
|
||||
public pageSize = PAGE_SIZE;
|
||||
public pageSizeOptions = PAGE_SIZE_OPTIONS;
|
||||
public screenSize = '';
|
||||
|
|
@ -79,7 +79,7 @@ export class CLNRoutingPeersComponent implements OnInit, OnChanges, AfterViewIni
|
|||
this.displayedColumns = JSON.parse(JSON.stringify(this.tableSetting.columnSelection));
|
||||
}
|
||||
this.pageSize = this.tableSetting.recordsPerPage ? +this.tableSetting.recordsPerPage : PAGE_SIZE;
|
||||
this.colWidth = this.displayedColumns.length ? ((this.commonService.getContainerSize().width / this.displayedColumns.length) / 10) + 'rem' : '20rem';
|
||||
this.colWidth = this.displayedColumns.length ? ((this.commonService.getContainerSize().width / (this.displayedColumns.length * 2)) / 10) + 'rem' : '20rem';
|
||||
this.logger.info(this.displayedColumns);
|
||||
});
|
||||
this.store.select(forwardingHistory).pipe(takeUntil(this.unSubs[1])).
|
||||
|
|
@ -116,57 +116,45 @@ export class CLNRoutingPeersComponent implements OnInit, OnChanges, AfterViewIni
|
|||
}
|
||||
}
|
||||
|
||||
applyFilterIncoming() {
|
||||
applyIncomingFilter() {
|
||||
this.routingPeersIncoming.filter = this.filterIn.toLowerCase();
|
||||
}
|
||||
|
||||
applyFilterOutgoing() {
|
||||
applyOutgoingFilter() {
|
||||
this.routingPeersOutgoing.filter = this.filterOut.toLowerCase();
|
||||
}
|
||||
|
||||
getLabel(column: string) {
|
||||
const returnColumn: ColumnDefinition = this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find((col) => col.column === column);
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : 'all';
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.routingPeersIncoming.filterPredicate = (rowDataIn: RoutingPeer, fltr: string) => {
|
||||
let rowToFilterIn = '';
|
||||
switch (this.selFilterByIn) {
|
||||
case 'all':
|
||||
rowToFilterIn = JSON.stringify(rowDataIn).toLowerCase();
|
||||
break;
|
||||
this.routingPeersIncoming.filterPredicate = (rpIn: RoutingPeer, fltr: string) => JSON.stringify(rpIn).toLowerCase().includes(fltr);
|
||||
this.routingPeersOutgoing.filterPredicate = (rpOut: RoutingPeer, fltr: string) => JSON.stringify(rpOut).toLowerCase().includes(fltr);
|
||||
// this.routingPeersIncoming.filterPredicate = (rowData: RoutingPeer, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
// (rowData ? rowData..toLowerCase() : '') :
|
||||
// (rowData[this.displayedColumns[i]] ? rowData[this.displayedColumns[i]].toLowerCase() : '')
|
||||
// ) + ', ';
|
||||
// }
|
||||
// break;
|
||||
|
||||
case 'total_amount':
|
||||
case 'total_fee':
|
||||
rowToFilterIn = ((+(rowDataIn[this.selFilterByIn] || 0)) / 1000)?.toString() || '';
|
||||
break;
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// break;
|
||||
|
||||
default:
|
||||
rowToFilterIn = typeof rowDataIn[this.selFilterByIn] === 'string' ? rowDataIn[this.selFilterByIn].toLowerCase() : typeof rowDataIn[this.selFilterByIn] === 'boolean' ? (rowDataIn[this.selFilterByIn] ? 'yes' : 'no') : rowDataIn[this.selFilterByIn].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilterIn.includes(fltr);
|
||||
};
|
||||
|
||||
this.routingPeersOutgoing.filterPredicate = (rowDataOut: RoutingPeer, fltr: string) => {
|
||||
let rowToFilterOut = '';
|
||||
switch (this.selFilterByOut) {
|
||||
case 'all':
|
||||
rowToFilterOut = JSON.stringify(rowDataOut).toLowerCase();
|
||||
break;
|
||||
|
||||
case 'total_amount':
|
||||
case 'total_fee':
|
||||
rowToFilterOut = ((+(rowDataOut[this.selFilterByOut] || 0)) / 1000)?.toString() || '';
|
||||
break;
|
||||
|
||||
default:
|
||||
rowToFilterOut = typeof rowDataOut[this.selFilterByOut] === 'string' ? rowDataOut[this.selFilterByOut].toLowerCase() : typeof rowDataOut[this.selFilterByOut] === 'boolean' ? (rowDataOut[this.selFilterByOut] ? 'yes' : 'no') : rowDataOut[this.selFilterByOut].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilterOut.includes(fltr);
|
||||
};
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// break;
|
||||
// }
|
||||
// return rowToFilter.includes(fltr);
|
||||
// };
|
||||
}
|
||||
|
||||
loadRoutingPeersTable(events: ForwardingEvent[]) {
|
||||
|
|
@ -188,8 +176,8 @@ export class CLNRoutingPeersComponent implements OnInit, OnChanges, AfterViewIni
|
|||
this.routingPeersOutgoing = new MatTableDataSource<RoutingPeer>([]);
|
||||
}
|
||||
this.setFilterPredicate();
|
||||
this.applyFilterIncoming();
|
||||
this.applyFilterOutgoing();
|
||||
this.applyIncomingFilter();
|
||||
this.applyOutgoingFilter();
|
||||
this.logger.info(this.routingPeersIncoming);
|
||||
this.logger.info(this.routingPeersOutgoing);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ export class CLNLightningInvoicesTableComponent implements OnInit, AfterViewInit
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return (this.selFilterBy === 'status' || this.selFilterBy === 'type') ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ export class CLNOfferBookmarksTableComponent implements OnInit, AfterViewInit, O
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ export class CLNOffersTableComponent implements OnInit, AfterViewInit, OnDestroy
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return this.selFilterBy === 'active' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -344,7 +344,7 @@ export class CLNLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return (this.selFilterBy === 'status' || this.selFilterBy === 'type') ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ export class ECLOnChainTransactionHistoryComponent implements OnInit, OnDestroy
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ export class ECLChannelInactiveTableComponent implements OnInit, AfterViewInit,
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ export class ECLChannelPendingTableComponent implements OnInit, AfterViewInit, O
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ export class ECLPeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return this.selFilterBy === 'state' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ export class ECLForwardingHistoryComponent implements OnInit, OnChanges, AfterVi
|
|||
}
|
||||
}
|
||||
if (changes.selFilter && !changes.selFilter.firstChange) {
|
||||
this.selFilterBy = 'all';
|
||||
this.applyFilter();
|
||||
}
|
||||
}
|
||||
|
|
@ -167,7 +168,7 @@ export class ECLForwardingHistoryComponent implements OnInit, OnChanges, AfterVi
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
<div fxLayout="column" fxLayoutAlign="start stretch" class="padding-gap">
|
||||
<div class="p-2 error-border my-2" *ngIf="errorMessage !== ''">{{errorMessage}}</div>
|
||||
<div *ngIf="errorMessage === ''" fxLayout="column" fxLayout.gt-md="row" fxFlex="100" fxLayoutAlign="space-between stretch" class="page-sub-title-container">
|
||||
<div *ngIf="errorMessage === ''" fxLayout="column" fxLayout.gt-md="row" fxFlex="100" fxLayoutAlign="space-between stretch" class="page-sub-title-container mt-2">
|
||||
<div fxLayout="column" fxFlex="49" fxLayoutAlign="start stretch" class="mb-4">
|
||||
<div fxLayout="column" fxLayout.gt-sm="row" fxLayoutAlign.gt-sm="space-between center" fxLayoutAlign="start stretch" class="page-sub-title-container w-100" [ngClass]="{'mt-2': screenSize === screenSizeEnum.XS, 'mt-1': screenSize === screenSizeEnum.SM}">
|
||||
<div fxFlex="70">Incoming</div>
|
||||
<div fxFlex="30" fxLayoutAlign.gt-xs="space-between center" fxLayout="row" fxLayoutAlign="space-between stretch">
|
||||
<mat-form-field fxFlex="49">
|
||||
<!-- <mat-form-field fxFlex="49">
|
||||
<mat-select placeholder="Filter By" tabindex="1" [(ngModel)]="selFilterByIn" (selectionChange)="selFilterIn=''; applyFilterIncoming()" name="filterByIn">
|
||||
<mat-option *ngFor="let column of ['all'].concat(displayedColumns)" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="49">
|
||||
<input matInput [(ngModel)]="selFilterIn" (input)="applyFilterIncoming()" (keyup)="applyFilterIncoming()" name="filterin" placeholder="Filter">
|
||||
</mat-form-field>
|
||||
</mat-form-field> -->
|
||||
</div>
|
||||
</div>
|
||||
<div [perfectScrollbar] fxLayout="column" fxLayoutAlign="start start" fxFlex="100" class="table-container">
|
||||
|
|
@ -65,14 +65,14 @@
|
|||
<div fxLayout="column" fxLayout.gt-sm="row" fxLayoutAlign.gt-sm="space-between center" fxLayoutAlign="start stretch" class="page-sub-title-container w-100" [ngClass]="{'mt-2': screenSize !== screenSizeEnum.LG}">
|
||||
<div fxFlex="70">Outgoing</div>
|
||||
<div fxFlex="30" fxLayoutAlign.gt-xs="space-between center" fxLayout="row" fxLayoutAlign="space-between stretch">
|
||||
<mat-form-field fxFlex="49">
|
||||
<!-- <mat-form-field fxFlex="49">
|
||||
<mat-select placeholder="Filter By" tabindex="1" [(ngModel)]="selFilterByOut" (selectionChange)="selFilterOut=''; applyFilterOutgoing()" name="filterByOut">
|
||||
<mat-option *ngFor="let column of ['all'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="49">
|
||||
<input matInput [(ngModel)]="selFilterOut" (input)="applyFilterOutgoing()" (keyup)="applyFilterOutgoing()" name="filterout" placeholder="Filter">
|
||||
</mat-form-field>
|
||||
</mat-form-field> -->
|
||||
</div>
|
||||
</div>
|
||||
<div [perfectScrollbar] fxLayout="column" fxLayoutAlign="start end" fxFlex="100" class="table-container">
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ export class ECLRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro
|
|||
this.displayedColumns = JSON.parse(JSON.stringify(this.tableSetting.columnSelection));
|
||||
}
|
||||
this.pageSize = this.tableSetting.recordsPerPage ? +this.tableSetting.recordsPerPage : PAGE_SIZE;
|
||||
this.colWidth = this.displayedColumns.length ? ((this.commonService.getContainerSize().width / this.displayedColumns.length) / 10) + 'rem' : '20rem';
|
||||
this.colWidth = this.displayedColumns.length ? ((this.commonService.getContainerSize().width / (this.displayedColumns.length * 2)) / 10) + 'rem' : '20rem';
|
||||
this.logger.info(this.displayedColumns);
|
||||
});
|
||||
this.store.select(payments).pipe(takeUntil(this.unSubs[1])).
|
||||
|
|
@ -96,11 +96,11 @@ export class ECLRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro
|
|||
}
|
||||
|
||||
applyFilterIncoming() {
|
||||
this.routingPeersIncoming.filter = this.filterIn.toLowerCase();
|
||||
this.routingPeersIncoming.filter = this.filterIn.trim().toLowerCase();
|
||||
}
|
||||
|
||||
applyFilterOutgoing() {
|
||||
this.routingPeersOutgoing.filter = this.filterOut.toLowerCase();
|
||||
this.routingPeersOutgoing.filter = this.filterOut.trim().toLowerCase();
|
||||
}
|
||||
|
||||
getLabel(column: string) {
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ export class ECLLightningInvoicesComponent implements OnInit, AfterViewInit, OnD
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return this.selFilterBy === 'status' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ export class ECLLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ export class OnChainTransactionHistoryComponent implements OnInit, OnChanges, On
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<ng-template mat-tab-label>
|
||||
<span matBadge="{{numUtxos}}" matBadgeOverlap="false" class="tab-badge">UTXOs</span>
|
||||
</ng-template>
|
||||
<rtl-on-chain-utxos [isDustUTXO]="false" fxLayout="row" fxFlex="100"></rtl-on-chain-utxos>
|
||||
<rtl-on-chain-utxos [isDustUTXO]="false" [dustAmount]="DUST_AMOUNT" fxLayout="row" fxFlex="100"></rtl-on-chain-utxos>
|
||||
</mat-tab>
|
||||
<mat-tab>
|
||||
<ng-template mat-tab-label>
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
<ng-template mat-tab-label>
|
||||
<span matBadge="{{numDustUtxos}}" matBadgeOverlap="false" class="tab-badge">Dust UTXOs</span>
|
||||
</ng-template>
|
||||
<rtl-on-chain-utxos [isDustUTXO]="true" fxLayout="row" fxFlex="100"></rtl-on-chain-utxos>
|
||||
<rtl-on-chain-utxos [isDustUTXO]="true" [dustAmount]="DUST_AMOUNT" fxLayout="row" fxFlex="100"></rtl-on-chain-utxos>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ export class UTXOTablesComponent implements OnInit, OnDestroy {
|
|||
|
||||
@Input() selectedTableIndex = 0;
|
||||
@Output() readonly selectedTableIndexChange = new EventEmitter<number>();
|
||||
public DUST_AMOUNT = 1000;
|
||||
public numTransactions = 0;
|
||||
public numUtxos = 0;
|
||||
public numDustUtxos = 0;
|
||||
|
|
@ -34,7 +35,7 @@ export class UTXOTablesComponent implements OnInit, OnDestroy {
|
|||
subscribe((utxosSelector: { utxos: UTXO[], apiCallStatus: ApiCallStatusPayload }) => {
|
||||
if (utxosSelector.utxos && utxosSelector.utxos.length > 0) {
|
||||
this.numUtxos = utxosSelector.utxos.length;
|
||||
this.numDustUtxos = utxosSelector.utxos?.filter((utxo) => utxo.amount_sat && +utxo.amount_sat < 1000).length;
|
||||
this.numDustUtxos = utxosSelector.utxos?.filter((utxo) => utxo.amount_sat && +utxo.amount_sat < this.DUST_AMOUNT).length;
|
||||
}
|
||||
this.logger.info(utxosSelector);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
<mat-progress-bar *ngIf="apiCallStatus.status === apiCallStatusEnum.INITIATED" mode="indeterminate"></mat-progress-bar>
|
||||
<table mat-table #table fxFlex="100" [dataSource]="listUTXOs" matSort [ngClass]="{'overflow-auto error-border': errorMessage !== '','overflow-auto': true}">
|
||||
<ng-container matColumnDef="is_dust">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header matTooltip="Dust/Non-dust"></th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header matTooltip="Dust/Nondust"></th>
|
||||
<td mat-cell *matCellDef="let utxo">
|
||||
<span *ngIf="utxo.amount_sat < DUST_AMOUNT; else emptySpace" matTooltip="Risk of dust attack" matTooltipPosition="right">
|
||||
<span *ngIf="utxo.amount_sat < dustAmount; else emptySpace" matTooltip="Risk of dust attack" matTooltipPosition="right">
|
||||
<mat-icon fxLayoutAlign="start center" color="warn" class="small-icon">warning</mat-icon>
|
||||
</span>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ export class OnChainUTXOsComponent implements OnInit, OnChanges, OnDestroy {
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
@Input() isDustUTXO = false;
|
||||
@Input() dustAmount = 1000;
|
||||
public faMoneyBillWave = faMoneyBillWave;
|
||||
public DUST_AMOUNT = 50000;
|
||||
public nodePageDefs = LND_PAGE_DEFS;
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
|
|
@ -91,7 +91,7 @@ export class OnChainUTXOsComponent implements OnInit, OnChanges, OnDestroy {
|
|||
this.errorMessage = !this.apiCallStatus.message ? '' : (typeof (this.apiCallStatus.message) === 'object') ? JSON.stringify(this.apiCallStatus.message) : this.apiCallStatus.message;
|
||||
}
|
||||
if (utxosSelector.utxos && utxosSelector.utxos.length > 0) {
|
||||
this.dustUtxos = utxosSelector.utxos?.filter((utxo) => +(utxo.amount_sat || 0) < this.DUST_AMOUNT);
|
||||
this.dustUtxos = utxosSelector.utxos?.filter((utxo) => +(utxo.amount_sat || 0) < this.dustAmount);
|
||||
this.utxos = utxosSelector.utxos;
|
||||
if (this.utxos.length > 0 && this.dustUtxos.length > 0 && !this.isDustUTXO) {
|
||||
this.displayedColumns.unshift('is_dust');
|
||||
|
|
@ -131,7 +131,7 @@ export class OnChainUTXOsComponent implements OnInit, OnChanges, OnDestroy {
|
|||
break;
|
||||
|
||||
case 'is_dust':
|
||||
rowToFilter = (rowData?.amount_sat || 0) < this.DUST_AMOUNT ? 'dust' : 'non-dust';
|
||||
rowToFilter = (rowData?.amount_sat || 0) < this.dustAmount ? 'dust' : 'nondust';
|
||||
break;
|
||||
|
||||
case 'tx_id':
|
||||
|
|
@ -147,7 +147,7 @@ export class OnChainUTXOsComponent implements OnInit, OnChanges, OnDestroy {
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return (this.selFilterBy === 'is_dust' || this.selFilterBy === 'address_type') ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
@ -180,7 +180,7 @@ export class OnChainUTXOsComponent implements OnInit, OnChanges, OnDestroy {
|
|||
this.listUTXOs = new MatTableDataSource<UTXO>([...UTXOs]);
|
||||
this.listUTXOs.sortingDataAccessor = (data: any, sortHeaderId: string) => {
|
||||
switch (sortHeaderId) {
|
||||
case 'is_dust': return +(data.amount_sat || 0) < this.DUST_AMOUNT;
|
||||
case 'is_dust': return +(data.amount_sat || 0) < this.dustAmount;
|
||||
case 'tx_id': return data.outpoint.txid_str.toLocaleLowerCase();
|
||||
case 'output': return +data.outpoint.output_index;
|
||||
default: return (data[sortHeaderId] && isNaN(data[sortHeaderId])) ? data[sortHeaderId].toLocaleLowerCase() : data[sortHeaderId] ? +data[sortHeaderId] : null;
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ export class ChannelActiveHTLCsTableComponent implements OnInit, AfterViewInit,
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ export class ChannelClosedTableComponent implements OnInit, AfterViewInit, OnDes
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return this.selFilterBy === 'close_type' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ export class ChannelOpenTableComponent implements OnInit, AfterViewInit, OnDestr
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return this.selFilterBy === 'active' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ export class PeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ export class ForwardingHistoryComponent implements OnInit, AfterViewInit, OnChan
|
|||
}
|
||||
}
|
||||
if (changes.selFilter && !changes.selFilter.firstChange) {
|
||||
this.selFilterBy = 'all';
|
||||
this.applyFilter();
|
||||
}
|
||||
}
|
||||
|
|
@ -158,7 +159,7 @@ export class ForwardingHistoryComponent implements OnInit, AfterViewInit, OnChan
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ export class NonRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
<div fxLayout="column" fxLayoutAlign="start stretch" class="padding-gap-x">
|
||||
<div class="p-2 error-border my-2" *ngIf="errorMessage !== ''">{{errorMessage}}</div>
|
||||
<div *ngIf="errorMessage === ''" fxLayout="column" fxLayout.gt-md="row" fxFlex="100" fxLayoutAlign="space-between start" class="page-sub-title-container">
|
||||
<div *ngIf="errorMessage === ''" fxLayout="column" fxLayout.gt-md="row" fxFlex="100" fxLayoutAlign="space-between start" class="page-sub-title-container mt-2">
|
||||
<div fxLayout="column" fxFlex="49" fxLayoutAlign="start stretch" class="mb-4">
|
||||
<div fxLayout="column" fxLayout.gt-sm="row" fxLayoutAlign.gt-sm="space-between center" fxLayoutAlign="start stretch" class="page-sub-title-container w-100" [ngClass]="{'mt-2': screenSize === screenSizeEnum.XS, 'mt-1': screenSize === screenSizeEnum.SM}">
|
||||
<div fxFlex="70">Incoming</div>
|
||||
<div fxFlex="30" fxLayoutAlign.gt-xs="space-between center" fxLayout="row" fxLayoutAlign="space-between stretch">
|
||||
<mat-form-field fxFlex="49">
|
||||
<!-- <mat-form-field fxFlex="49">
|
||||
<mat-select placeholder="Filter By" tabindex="1" [(ngModel)]="selFilterByIn" (selectionChange)="selFilterIn=''; applyFilterIncoming()" name="filterByIn">
|
||||
<mat-option *ngFor="let column of ['all'].concat(displayedColumns)" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="49">
|
||||
<input matInput [(ngModel)]="selFilterIn" (input)="applyFilterIncoming()" (keyup)="applyFilterIncoming()" name="filterin" placeholder="Filter">
|
||||
</mat-form-field>
|
||||
</mat-form-field> -->
|
||||
</div>
|
||||
</div>
|
||||
<div [perfectScrollbar] fxLayout="column" fxLayoutAlign="start start" fxFlex="100" class="table-container">
|
||||
|
|
@ -69,14 +69,14 @@
|
|||
<div fxLayout="column" fxLayout.gt-sm="row" fxLayoutAlign.gt-sm="space-between center" fxLayoutAlign="start stretch" class="page-sub-title-container w-100" [ngClass]="{'mt-2': screenSize !== screenSizeEnum.LG}">
|
||||
<div fxFlex="70">Outgoing</div>
|
||||
<div fxFlex="30" fxLayoutAlign.gt-xs="space-between center" fxLayout="row" fxLayoutAlign="space-between stretch">
|
||||
<mat-form-field fxFlex="49">
|
||||
<!-- <mat-form-field fxFlex="49">
|
||||
<mat-select placeholder="Filter By" tabindex="1" [(ngModel)]="selFilterByOut" (selectionChange)="selFilterOut=''; applyFilterOutgoing()" name="filterByOut">
|
||||
<mat-option *ngFor="let column of ['all'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="49">
|
||||
<input matInput [(ngModel)]="selFilterOut" (input)="applyFilterOutgoing()" (keyup)="applyFilterOutgoing()" name="filterout" placeholder="Filter">
|
||||
</mat-form-field>
|
||||
</mat-form-field> -->
|
||||
</div>
|
||||
</div>
|
||||
<div [perfectScrollbar] fxLayout="column" fxLayoutAlign="start start" fxFlex="100" class="table-container">
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ export class RoutingPeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
this.displayedColumns = JSON.parse(JSON.stringify(this.tableSetting.columnSelection));
|
||||
}
|
||||
this.pageSize = this.tableSetting.recordsPerPage ? +this.tableSetting.recordsPerPage : PAGE_SIZE;
|
||||
this.colWidth = this.displayedColumns.length ? ((this.commonService.getContainerSize().width / this.displayedColumns.length) / 10) + 'rem' : '20rem';
|
||||
this.colWidth = this.displayedColumns.length ? ((this.commonService.getContainerSize().width / (this.displayedColumns.length * 2)) / 10) + 'rem' : '20rem';
|
||||
this.logger.info(this.displayedColumns);
|
||||
});
|
||||
this.store.select(forwardingHistory).pipe(takeUntil(this.unSubs[1])).
|
||||
|
|
@ -125,11 +125,11 @@ export class RoutingPeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
}
|
||||
|
||||
applyFilterIncoming() {
|
||||
this.routingPeersIncoming.filter = this.filterIn.toLowerCase();
|
||||
this.routingPeersIncoming.filter = this.filterIn.trim().toLowerCase();
|
||||
}
|
||||
|
||||
applyFilterOutgoing() {
|
||||
this.routingPeersOutgoing.filter = this.filterOut.toLowerCase();
|
||||
this.routingPeersOutgoing.filter = this.filterOut.trim().toLowerCase();
|
||||
}
|
||||
|
||||
getLabel(column: string) {
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ export class LightningInvoicesComponent implements OnInit, AfterViewInit, OnDest
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return (this.selFilterBy === 'is_keysend' || this.selFilterBy === 'is_amp') ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -466,7 +466,7 @@ export class LightningPaymentsComponent implements OnInit, AfterViewInit, OnDest
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ export class BoltzSwapsComponent implements OnInit, AfterViewInit, OnChanges, On
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return this.selFilterBy === 'status' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ export class SwapsComponent implements OnInit, AfterViewInit, OnChanges, OnDestr
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return this.selFilterBy === 'state' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ export class TransactionsReportTableComponent implements OnInit, AfterViewInit,
|
|||
this.loadTransactionsTable(this.dataList);
|
||||
}
|
||||
if (changes.selFilter && !changes.selFilter.firstChange) {
|
||||
this.selFilterBy = 'all';
|
||||
this.applyFilter();
|
||||
}
|
||||
}
|
||||
|
|
@ -115,7 +116,7 @@ export class TransactionsReportTableComponent implements OnInit, AfterViewInit,
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
rowToFilter = !rowData[this.selFilterBy] ? '' : typeof rowData[this.selFilterBy] === 'string' ? rowData[this.selFilterBy].toLowerCase() : typeof rowData[this.selFilterBy] === 'boolean' ? (rowData[this.selFilterBy] ? 'yes' : 'no') : rowData[this.selFilterBy].toString();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue