mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2026-08-13 12:33:07 +02:00
CLN Filter by selected column
This commit is contained in:
parent
38e2c84957
commit
7fea447975
84 changed files with 669 additions and 626 deletions
|
|
@ -24,7 +24,7 @@ export const savePageSettings = (req, res, next) => {
|
|||
res.status(201).json(insertRes);
|
||||
}).catch((insertErrRes) => {
|
||||
const err = common.handleError(insertErrRes, 'Page Settings', 'Page Settings Update Error', req.session.selectedNode);
|
||||
throw new Error(JSON.stringify({ message: err.message, error: err.error }));
|
||||
return res.status(err.statusCode).json({ message: err.message, error: err.error });
|
||||
});
|
||||
}).catch((errRes) => {
|
||||
const err = common.handleError(errRes, 'Page Settings', 'Page Settings Validation Error', req.session.selectedNode);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,10 @@ export class CommonService {
|
|||
this.read_dummy_data = false;
|
||||
this.baseHref = '/rtl';
|
||||
this.dummy_data_array_from_file = [];
|
||||
this.MONTHS = [{ name: 'JAN', days: 31 }, { name: 'FEB', days: 28 }, { name: 'MAR', days: 31 }, { name: 'APR', days: 30 }, { name: 'MAY', days: 31 }, { name: 'JUN', days: 30 }, { name: 'JUL', days: 31 }, { name: 'AUG', days: 31 }, { name: 'SEP', days: 30 }, { name: 'OCT', days: 31 }, { name: 'NOV', days: 30 }, { name: 'DEC', days: 31 }];
|
||||
this.MONTHS = [
|
||||
{ name: 'JAN', days: 31 }, { name: 'FEB', days: 28 }, { name: 'MAR', days: 31 }, { name: 'APR', days: 30 }, { name: 'MAY', days: 31 }, { name: 'JUN', days: 30 },
|
||||
{ name: 'JUL', days: 31 }, { name: 'AUG', days: 31 }, { name: 'SEP', days: 30 }, { name: 'OCT', days: 31 }, { name: 'NOV', days: 30 }, { name: 'DEC', days: 31 }
|
||||
];
|
||||
this.getSwapServerOptions = (req) => {
|
||||
const swapOptions = {
|
||||
url: req.session.selectedNode.swap_server_url,
|
||||
|
|
@ -253,16 +256,26 @@ export class CommonService {
|
|||
break;
|
||||
}
|
||||
this.logger.log({ selectedNode: selectedNode, level: 'ERROR', fileName: fileName, msg: errMsg, error: (typeof err === 'object' ? JSON.stringify(err) : (typeof err === 'string') ? err : 'Unknown Error') });
|
||||
const newErrorObj = {
|
||||
statusCode: err.statusCode ? err.statusCode : err.status ? err.status : (err.error && err.error.code && err.error.code === 'ECONNREFUSED') ? 503 : 500,
|
||||
message: (err.error && err.error.message) ? err.error.message : err.message ? err.message : errMsg,
|
||||
error: ((err.error && err.error.error && err.error.error.error && typeof err.error.error.error === 'string') ? err.error.error.error :
|
||||
(err.error && err.error.error && typeof err.error.error === 'string') ? err.error.error :
|
||||
(err.error && err.error.error && err.error.error.message && typeof err.error.error.message === 'string') ? err.error.error.message :
|
||||
(err.error && err.error.message && typeof err.error.message === 'string') ? err.error.message :
|
||||
(err.error && typeof err.error === 'string') ? err.error :
|
||||
(err.message && typeof err.message === 'string') ? err.message : (typeof err === 'string') ? err : 'Unknown Error')
|
||||
};
|
||||
let newErrorObj = {};
|
||||
if (err.code && err.code === 'ENOENT') {
|
||||
newErrorObj = {
|
||||
statusCode: 500,
|
||||
message: 'No such file or directory ' + (err.path ? err.path : ''),
|
||||
error: 'No such file or directory ' + (err.path ? err.path : '')
|
||||
};
|
||||
}
|
||||
else {
|
||||
newErrorObj = {
|
||||
statusCode: err.statusCode ? err.statusCode : err.status ? err.status : (err.error && err.error.code && err.error.code === 'ECONNREFUSED') ? 503 : 500,
|
||||
message: (err.error && err.error.message) ? err.error.message : err.message ? err.message : errMsg,
|
||||
error: ((err.error && err.error.error && err.error.error.error && typeof err.error.error.error === 'string') ? err.error.error.error :
|
||||
(err.error && err.error.error && typeof err.error.error === 'string') ? err.error.error :
|
||||
(err.error && err.error.error && err.error.error.message && typeof err.error.error.message === 'string') ? err.error.error.message :
|
||||
(err.error && err.error.message && typeof err.error.message === 'string') ? err.error.message :
|
||||
(err.error && typeof err.error === 'string') ? err.error :
|
||||
(err.message && typeof err.message === 'string') ? err.message : (typeof err === 'string') ? err : 'Unknown Error')
|
||||
};
|
||||
}
|
||||
return newErrorObj;
|
||||
};
|
||||
this.getRequestIP = (req) => ((typeof req.headers['x-forwarded-for'] === 'string' && req.headers['x-forwarded-for'].split(',').shift()) ||
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ export class DatabaseService {
|
|||
catch (err) {
|
||||
const selNode = this.nodeDatabase[nodeIndex] && this.nodeDatabase[nodeIndex].adapter && this.nodeDatabase[nodeIndex].adapter.selNode ? this.nodeDatabase[nodeIndex].adapter.selNode : null;
|
||||
this.logger.log({ selectedNode: selNode, level: 'ERROR', fileName: 'Database', msg: 'Database Save Error', error: err });
|
||||
return new Error(err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
unloadDatabase(nodeIndex, sessionID) {
|
||||
|
|
@ -220,11 +220,11 @@ export class DatabaseAdapter {
|
|||
fetchData(collectionName) {
|
||||
try {
|
||||
if (!fs.existsSync(this.dbFilePath)) {
|
||||
fs.mkdirSync(this.dbFilePath);
|
||||
this.common.createDirectory(this.dbFilePath);
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
return new Error('Unable to Create Directory Error ' + JSON.stringify(err));
|
||||
throw new Error(JSON.stringify(err));
|
||||
}
|
||||
const collectionFilePath = this.dbFilePath + sep + 'rtldb-' + this.selNode.ln_implementation + '-' + collectionName + '.json';
|
||||
try {
|
||||
|
|
@ -233,7 +233,7 @@ export class DatabaseAdapter {
|
|||
}
|
||||
}
|
||||
catch (err) {
|
||||
return new Error('Unable to Create Database File Error ' + JSON.stringify(err));
|
||||
throw new Error(JSON.stringify(err));
|
||||
}
|
||||
try {
|
||||
const otherFiles = fs.readdirSync(this.dbFilePath);
|
||||
|
|
@ -252,7 +252,7 @@ export class DatabaseAdapter {
|
|||
return dataObj;
|
||||
}
|
||||
catch (err) {
|
||||
return new Error('Database Read Error ' + JSON.stringify(err));
|
||||
throw new Error(JSON.stringify(err));
|
||||
}
|
||||
}
|
||||
getSelNode() {
|
||||
|
|
@ -269,7 +269,7 @@ export class DatabaseAdapter {
|
|||
return true;
|
||||
}
|
||||
catch (err) {
|
||||
return new Error('Database Write Error ' + JSON.stringify(err));
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
insertSession(id = '') {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Database, DatabaseService } from '../../utils/database.js';
|
||||
import { Logger, LoggerService } from '../../utils/logger.js';
|
||||
import { Common, CommonService } from '../../utils/common.js';
|
||||
import { CollectionFieldsEnum, CollectionsEnum, PageSettings } from '../../models/database.model.js';
|
||||
import { CollectionsEnum, PageSettings } from '../../models/database.model.js';
|
||||
|
||||
const logger: LoggerService = Logger;
|
||||
const common: CommonService = Common;
|
||||
|
|
@ -27,7 +27,7 @@ export const savePageSettings = (req, res, next) => {
|
|||
res.status(201).json(insertRes);
|
||||
}).catch((insertErrRes) => {
|
||||
const err = common.handleError(insertErrRes, 'Page Settings', 'Page Settings Update Error', req.session.selectedNode);
|
||||
throw new Error(JSON.stringify({ message: err.message, error: err.error }));
|
||||
return res.status(err.statusCode).json({ message: err.message, error: err.error });
|
||||
});
|
||||
}).catch((errRes) => {
|
||||
const err = common.handleError(errRes, 'Page Settings', 'Page Settings Validation Error', req.session.selectedNode);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,10 @@ export class CommonService {
|
|||
public read_dummy_data = false;
|
||||
public baseHref = '/rtl';
|
||||
private dummy_data_array_from_file = [];
|
||||
private MONTHS = [{ name: 'JAN', days: 31 }, { name: 'FEB', days: 28 }, { name: 'MAR', days: 31 }, { name: 'APR', days: 30 }, { name: 'MAY', days: 31 }, { name: 'JUN', days: 30 }, { name: 'JUL', days: 31 }, { name: 'AUG', days: 31 }, { name: 'SEP', days: 30 }, { name: 'OCT', days: 31 }, { name: 'NOV', days: 30 }, { name: 'DEC', days: 31 }];
|
||||
private MONTHS = [
|
||||
{ name: 'JAN', days: 31 }, { name: 'FEB', days: 28 }, { name: 'MAR', days: 31 }, { name: 'APR', days: 30 }, { name: 'MAY', days: 31 }, { name: 'JUN', days: 30 },
|
||||
{ name: 'JUL', days: 31 }, { name: 'AUG', days: 31 }, { name: 'SEP', days: 30 }, { name: 'OCT', days: 31 }, { name: 'NOV', days: 30 }, { name: 'DEC', days: 31 }
|
||||
];
|
||||
|
||||
constructor() { }
|
||||
|
||||
|
|
@ -268,18 +271,27 @@ export class CommonService {
|
|||
break;
|
||||
}
|
||||
this.logger.log({ selectedNode: selectedNode, level: 'ERROR', fileName: fileName, msg: errMsg, error: (typeof err === 'object' ? JSON.stringify(err) : (typeof err === 'string') ? err : 'Unknown Error') });
|
||||
const newErrorObj = {
|
||||
statusCode: err.statusCode ? err.statusCode : err.status ? err.status : (err.error && err.error.code && err.error.code === 'ECONNREFUSED') ? 503 : 500,
|
||||
message: (err.error && err.error.message) ? err.error.message : err.message ? err.message : errMsg,
|
||||
error: (
|
||||
(err.error && err.error.error && err.error.error.error && typeof err.error.error.error === 'string') ? err.error.error.error :
|
||||
(err.error && err.error.error && typeof err.error.error === 'string') ? err.error.error :
|
||||
(err.error && err.error.error && err.error.error.message && typeof err.error.error.message === 'string') ? err.error.error.message :
|
||||
(err.error && err.error.message && typeof err.error.message === 'string') ? err.error.message :
|
||||
(err.error && typeof err.error === 'string') ? err.error :
|
||||
(err.message && typeof err.message === 'string') ? err.message : (typeof err === 'string') ? err : 'Unknown Error'
|
||||
)
|
||||
};
|
||||
let newErrorObj = {};
|
||||
if (err.code && err.code === 'ENOENT') {
|
||||
newErrorObj = {
|
||||
statusCode: 500,
|
||||
message: 'No such file or directory ' + (err.path ? err.path : ''),
|
||||
error: 'No such file or directory ' + (err.path ? err.path : '')
|
||||
};
|
||||
} else {
|
||||
newErrorObj = {
|
||||
statusCode: err.statusCode ? err.statusCode : err.status ? err.status : (err.error && err.error.code && err.error.code === 'ECONNREFUSED') ? 503 : 500,
|
||||
message: (err.error && err.error.message) ? err.error.message : err.message ? err.message : errMsg,
|
||||
error: (
|
||||
(err.error && err.error.error && err.error.error.error && typeof err.error.error.error === 'string') ? err.error.error.error :
|
||||
(err.error && err.error.error && typeof err.error.error === 'string') ? err.error.error :
|
||||
(err.error && err.error.error && err.error.error.message && typeof err.error.error.message === 'string') ? err.error.error.message :
|
||||
(err.error && err.error.message && typeof err.error.message === 'string') ? err.error.message :
|
||||
(err.error && typeof err.error === 'string') ? err.error :
|
||||
(err.message && typeof err.message === 'string') ? err.message : (typeof err === 'string') ? err : 'Unknown Error'
|
||||
)
|
||||
};
|
||||
}
|
||||
return newErrorObj;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ export class DatabaseService {
|
|||
} catch (err) {
|
||||
const selNode = this.nodeDatabase[nodeIndex] && this.nodeDatabase[nodeIndex].adapter && this.nodeDatabase[nodeIndex].adapter.selNode ? this.nodeDatabase[nodeIndex].adapter.selNode : null;
|
||||
this.logger.log({ selectedNode: selNode, level: 'ERROR', fileName: 'Database', msg: 'Database Save Error', error: err });
|
||||
return new Error(err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -223,10 +223,10 @@ export class DatabaseAdapter {
|
|||
fetchData(collectionName: string) {
|
||||
try {
|
||||
if (!fs.existsSync(this.dbFilePath)) {
|
||||
fs.mkdirSync(this.dbFilePath);
|
||||
this.common.createDirectory(this.dbFilePath);
|
||||
}
|
||||
} catch (err) {
|
||||
return new Error('Unable to Create Directory Error ' + JSON.stringify(err));
|
||||
throw new Error(JSON.stringify(err));
|
||||
}
|
||||
const collectionFilePath = this.dbFilePath + sep + 'rtldb-' + this.selNode.ln_implementation + '-' + collectionName + '.json';
|
||||
try {
|
||||
|
|
@ -234,7 +234,7 @@ export class DatabaseAdapter {
|
|||
fs.writeFileSync(collectionFilePath, '[]');
|
||||
}
|
||||
} catch (err) {
|
||||
return new Error('Unable to Create Database File Error ' + JSON.stringify(err));
|
||||
throw new Error(JSON.stringify(err));
|
||||
}
|
||||
try {
|
||||
const otherFiles = fs.readdirSync(this.dbFilePath);
|
||||
|
|
@ -251,7 +251,7 @@ export class DatabaseAdapter {
|
|||
const dataObj = !dataFromFile ? null : (<Collections>JSON.parse(dataFromFile));
|
||||
return dataObj;
|
||||
} catch (err) {
|
||||
return new Error('Database Read Error ' + JSON.stringify(err));
|
||||
throw new Error(JSON.stringify(err));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -269,7 +269,7 @@ export class DatabaseAdapter {
|
|||
}
|
||||
return true;
|
||||
} catch (err) {
|
||||
return new Error('Database Write Error ' + JSON.stringify(err));
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import { RTLState } from '../../../store/rtl.state';
|
|||
import { RTLEffects } from '../../../store/rtl.effects';
|
||||
import { CLNOpenLiquidityChannelComponent } from '../open-liquidity-channel-modal/open-liquidity-channel-modal.component';
|
||||
import { clnPageSettings, nodeInfoAndNodeSettingsAndBalance } from '../../store/cln.selector';
|
||||
import { DecimalPipe } from '@angular/common';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ColumnDefinition, PageSettings, TableSetting } from '../../../shared/models/pageSettings';
|
||||
import { CamelCaseWithReplacePipe } from '../../../shared/pipes/app.pipe';
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ export class CLNLiquidityAdsListComponent implements OnInit, OnDestroy {
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public nodePageDefs = CLN_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'liquidity_ads';
|
||||
public tableSetting: TableSetting = { tableId: 'liquidity_ads', recordsPerPage: PAGE_SIZE, sortBy: 'channel_opening_fee', sortOrder: SortOrderEnum.ASCENDING };
|
||||
|
|
@ -64,7 +64,7 @@ export class CLNLiquidityAdsListComponent implements OnInit, OnDestroy {
|
|||
public apiCallStatusEnum = APICallStatusEnum;
|
||||
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()];
|
||||
|
||||
constructor(private logger: LoggerService, private store: Store<RTLState>, private dataService: DataService, private commonService: CommonService, private rtlEffects: RTLEffects, private decimalPipe: DecimalPipe, private camelCaseWithReplace: CamelCaseWithReplacePipe) {
|
||||
constructor(private logger: LoggerService, private store: Store<RTLState>, private dataService: DataService, private commonService: CommonService, private rtlEffects: RTLEffects, private datePipe: DatePipe, private camelCaseWithReplace: CamelCaseWithReplacePipe) {
|
||||
this.askTooltipMsg = 'Specify the liquidity requirements for your node: \n 1. Channel Amount - Amount in Sats you need on the channel opened to your node \n 2. Channel opening fee rate - Rate in Sats/vByte that you are willing to pay to open the channel to you';
|
||||
this.nodesTooltipMsg = 'These nodes are advertising their liquidity offering on the network.\nYou should pay attention to the following aspects to evaluate each node offer: \n- The total bitcoin deployed on the node, the more the better\n';
|
||||
this.nodesTooltipMsg = this.nodesTooltipMsg + '- The number of channels open on the node, the more the better' +
|
||||
|
|
@ -140,40 +140,46 @@ export class CLNLiquidityAdsListComponent implements OnInit, OnDestroy {
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.liquidityNodes.filterPredicate = (node: LookupNode, fltr: string) => {
|
||||
const newNode = ((node.alias) ? node.alias.toLocaleLowerCase() : '') + (node.channel_opening_fee ? node.channel_opening_fee + ' Sats' : '') +
|
||||
(node.option_will_fund?.lease_fee_base_msat ? (node.option_will_fund?.lease_fee_base_msat / 1000) + ' Sats' : '') + (node.option_will_fund?.lease_fee_basis ? (this.decimalPipe.transform(node.option_will_fund?.lease_fee_basis / 100, '1.2-2') + '%') : '') +
|
||||
(node.option_will_fund?.channel_fee_max_base_msat ? (node.option_will_fund?.channel_fee_max_base_msat / 1000) + ' Sats' : '') + (node.option_will_fund?.channel_fee_max_proportional_thousandths ? (node.option_will_fund?.channel_fee_max_proportional_thousandths * 1000) + ' ppm' : '') +
|
||||
(node.address_types ? node.address_types.reduce((acc, curr) => acc + (curr === 'tor' ? ' tor' : curr === 'ipv' ? ' clearnet' : (' ' + curr.toLowerCase())), '') : '');
|
||||
return newNode.includes(fltr);
|
||||
this.liquidityNodes.filterPredicate = (rowData: LookupNode, fltr: string) => {
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterBy) {
|
||||
case 'all':
|
||||
rowToFilter = ((rowData.alias) ? rowData.alias.toLocaleLowerCase() : '') + (rowData.channel_opening_fee ? rowData.channel_opening_fee + ' Sats' : '') +
|
||||
(rowData.option_will_fund?.lease_fee_base_msat ? (rowData.option_will_fund?.lease_fee_base_msat / 1000) + ' Sats' : '') + (rowData.option_will_fund?.lease_fee_basis ? ((rowData.option_will_fund?.lease_fee_basis / 100) + '%') : '') +
|
||||
(rowData.option_will_fund?.channel_fee_max_base_msat ? (rowData.option_will_fund?.channel_fee_max_base_msat / 1000) + ' Sats' : '') + (rowData.option_will_fund?.channel_fee_max_proportional_thousandths ? (rowData.option_will_fund?.channel_fee_max_proportional_thousandths * 1000) + ' ppm' : '') +
|
||||
(rowData.address_types ? rowData.address_types.reduce((acc, curr) => acc + (curr === 'tor' ? ' tor' : curr === 'ipv' ? ' clearnet' : (' ' + curr.toLowerCase())), '') : '');
|
||||
break;
|
||||
|
||||
case 'alias':
|
||||
rowToFilter = ((rowData?.alias?.toLowerCase() || ' ') + rowData?.address_types?.reduce((acc, curr) => acc + (!curr ? '' : (curr === 'ipv' ? 'clearnet' : curr)), ' ')) || '';
|
||||
break;
|
||||
|
||||
case 'last_timestamp':
|
||||
rowToFilter = this.datePipe.transform(new Date((rowData.last_timestamp || 0) * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() || '';
|
||||
break;
|
||||
|
||||
case 'compact_lease':
|
||||
rowToFilter = rowData?.option_will_fund?.compact_lease?.toLowerCase() || '';
|
||||
break;
|
||||
|
||||
case 'lease_fee':
|
||||
rowToFilter = ((((rowData.option_will_fund?.lease_fee_base_msat || 0) / 1000) + ' sats ' || ' ') + (((rowData.option_will_fund?.lease_fee_basis || 0) / 100) + '%')) || '';
|
||||
break;
|
||||
|
||||
case 'routing_fee':
|
||||
rowToFilter = ((((rowData.option_will_fund?.channel_fee_max_base_msat || 0) / 1000) + ' sats ' || ' ') + (((rowData.option_will_fund?.channel_fee_max_proportional_thousandths || 0) * 1000) + ' ppm')) || '';
|
||||
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();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
};
|
||||
// this.liquidityNodes.filterPredicate = (rowData: LookupNode, 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 '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// break;
|
||||
// }
|
||||
// return rowToFilter.includes(fltr);
|
||||
// };
|
||||
}
|
||||
|
||||
loadLiqNodesTable(liqNodes: LookupNode[]) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
@ -12,13 +12,12 @@
|
|||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
{{displayedColumns}}
|
||||
<div fxLayout="row" fxLayoutAlign="start start">
|
||||
<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="status">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before" matTooltip="UTXO Status"></th>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ export class CLNOnChainUtxosComponent implements OnInit, AfterViewInit, OnDestro
|
|||
@Input() numDustUTXOs = 0;
|
||||
@Input() isDustUTXO = false;
|
||||
public nodePageDefs = CLN_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'on_chain';
|
||||
public tableSetting: TableSetting = { tableId: 'utxos', recordsPerPage: PAGE_SIZE, sortBy: 'status', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -125,34 +125,23 @@ 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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.listUTXOs.filterPredicate = (utxo: UTXO, fltr: string) => JSON.stringify(utxo).toLowerCase().includes(fltr);
|
||||
// this.listUTXOs.filterPredicate = (rowData: UTXO, 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;
|
||||
this.listUTXOs.filterPredicate = (rowData: UTXO, fltr: string) => {
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterBy) {
|
||||
case 'all':
|
||||
rowToFilter = JSON.stringify(rowData).toLowerCase();
|
||||
break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// break;
|
||||
// }
|
||||
// return rowToFilter.includes(fltr);
|
||||
// };
|
||||
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();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
};
|
||||
}
|
||||
|
||||
loadUTXOsTable(utxos: any[]) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
<div [perfectScrollbar] fxLayout="row" fxLayoutAlign="start center" fxFlex="100" class="table-container w-100">
|
||||
<table mat-table #table [dataSource]="channels" matSort [ngClass]="{'overflow-auto error-border': errorMessage !== '','overflow-auto': true}">
|
||||
<ng-container matColumnDef="private">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header></th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header matTooltip="Private"></th>
|
||||
<td mat-cell *matCellDef="let channel">
|
||||
<span *ngIf="channel.private" class="mr-1" matTooltip="Private" matTooltipPosition="right"><fa-icon [icon]="faEyeSlash"></fa-icon></span>
|
||||
<span *ngIf="!channel.private" class="mr-1" matTooltip="Public" matTooltipPosition="right"><fa-icon [icon]="faEye"></fa-icon></span>
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export class CLNChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
|
|||
public faEye = faEye;
|
||||
public faEyeSlash = faEyeSlash;
|
||||
public nodePageDefs = CLN_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'peers_channels';
|
||||
public tableSetting: TableSetting = { tableId: 'open_channels', recordsPerPage: PAGE_SIZE, sortBy: 'alias', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -272,42 +272,43 @@ export class CLNChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.channels.filterPredicate = (channel: Channel, fltr: string) => {
|
||||
const newChannel = ((channel.connected) ? 'connected' : 'disconnected') + (channel.channel_id ? channel.channel_id.toLowerCase() : '') +
|
||||
(channel.short_channel_id ? channel.short_channel_id.toLowerCase() : '') + (channel.id ? channel.id.toLowerCase() : '') + (channel.alias ? channel.alias.toLowerCase() : '') +
|
||||
(channel.private ? 'private' : 'public') + (channel.state ? channel.state.toLowerCase() : '') +
|
||||
(channel.funding_txid ? channel.funding_txid.toLowerCase() : '') + (channel.msatoshi_to_us ? channel.msatoshi_to_us : '') +
|
||||
(channel.msatoshi_total ? channel.msatoshi_total : '') + (channel.their_channel_reserve_satoshis ? channel.their_channel_reserve_satoshis : '') +
|
||||
(channel.our_channel_reserve_satoshis ? channel.our_channel_reserve_satoshis : '') + (channel.spendable_msatoshi ? channel.spendable_msatoshi : '');
|
||||
return newChannel.includes(fltr);
|
||||
this.channels.filterPredicate = (rowData: Channel, fltr: string) => {
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterBy) {
|
||||
case 'all':
|
||||
rowToFilter = ((rowData.connected) ? 'connected' : 'disconnected') + (rowData.channel_id ? rowData.channel_id.toLowerCase() : '') +
|
||||
(rowData.short_channel_id ? rowData.short_channel_id.toLowerCase() : '') + (rowData.id ? rowData.id.toLowerCase() : '') + (rowData.alias ? rowData.alias.toLowerCase() : '') +
|
||||
(rowData.private ? 'private' : 'public') + (rowData.state ? rowData.state.toLowerCase() : '') +
|
||||
(rowData.funding_txid ? rowData.funding_txid.toLowerCase() : '') + (rowData.msatoshi_to_us ? rowData.msatoshi_to_us : '') +
|
||||
(rowData.msatoshi_total ? rowData.msatoshi_total : '') + (rowData.their_channel_reserve_satoshis ? rowData.their_channel_reserve_satoshis : '') +
|
||||
(rowData.our_channel_reserve_satoshis ? rowData.our_channel_reserve_satoshis : '') + (rowData.spendable_msatoshi ? rowData.spendable_msatoshi : '');
|
||||
break;
|
||||
|
||||
case 'private':
|
||||
rowToFilter = rowData?.private ? 'private' : 'public';
|
||||
break;
|
||||
|
||||
case 'connected':
|
||||
rowToFilter = rowData?.connected ? 'connected' : 'disconnected';
|
||||
break;
|
||||
|
||||
case 'msatoshi_total':
|
||||
case 'spendable_msatoshi':
|
||||
case 'msatoshi_to_us':
|
||||
case 'msatoshi_to_them':
|
||||
rowToFilter = ((+(rowData[this.selFilterBy] || 0)) / 1000)?.toString() || '';
|
||||
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();
|
||||
break;
|
||||
}
|
||||
return this.selFilterBy === 'connected' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
};
|
||||
// this.invoices.filterPredicate = (rowData: Invoice, 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 '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// break;
|
||||
// }
|
||||
// return rowToFilter.includes(fltr);
|
||||
// };
|
||||
}
|
||||
|
||||
loadChannelsTable(mychannels) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
<div [perfectScrollbar] fxLayout="row" fxLayoutAlign="start center" fxFlex="100" class="table-container w-100">
|
||||
<table mat-table #table [dataSource]="channels" matSort [ngClass]="{'overflow-auto error-border': errorMessage !== '','overflow-auto': true}">
|
||||
<ng-container matColumnDef="private">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header></th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header matTooltip="Private"></th>
|
||||
<td mat-cell *matCellDef="let channel">
|
||||
<span *ngIf="channel.private" class="mr-1" matTooltip="Private" matTooltipPosition="right"><fa-icon [icon]="faEyeSlash"></fa-icon></span>
|
||||
<span *ngIf="!channel.private" class="mr-1" matTooltip="Public" matTooltipPosition="right"><fa-icon [icon]="faEye"></fa-icon></span>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export class CLNChannelPendingTableComponent implements OnInit, AfterViewInit, O
|
|||
public faEye = faEye;
|
||||
public faEyeSlash = faEyeSlash;
|
||||
public nodePageDefs = CLN_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'peers_channels';
|
||||
public tableSetting: TableSetting = { tableId: 'pending_inactive_channels', recordsPerPage: PAGE_SIZE, sortBy: 'alias', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -170,42 +170,43 @@ export class CLNChannelPendingTableComponent implements OnInit, AfterViewInit, O
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.channels.filterPredicate = (channel: Channel, fltr: string) => {
|
||||
const newChannel = ((channel.connected) ? 'connected' : 'disconnected') + (channel.channel_id ? channel.channel_id.toLowerCase() : '') +
|
||||
(channel.short_channel_id ? channel.short_channel_id.toLowerCase() : '') + (channel.id ? channel.id.toLowerCase() : '') + (channel.alias ? channel.alias.toLowerCase() : '') +
|
||||
(channel.private ? 'private' : 'public') + ((channel.state && this.CLNChannelPendingState[channel.state]) ? this.CLNChannelPendingState[channel.state].toLowerCase() : '') +
|
||||
(channel.funding_txid ? channel.funding_txid.toLowerCase() : '') + (channel.msatoshi_to_us ? channel.msatoshi_to_us : '') +
|
||||
(channel.msatoshi_total ? channel.msatoshi_total : '') + (channel.their_channel_reserve_satoshis ? channel.their_channel_reserve_satoshis : '') +
|
||||
(channel.our_channel_reserve_satoshis ? channel.our_channel_reserve_satoshis : '') + (channel.spendable_msatoshi ? channel.spendable_msatoshi : '');
|
||||
return newChannel.includes(fltr);
|
||||
this.channels.filterPredicate = (rowData: Channel, fltr: string) => {
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterBy) {
|
||||
case 'all':
|
||||
rowToFilter = ((rowData.connected) ? 'connected' : 'disconnected') + (rowData.channel_id ? rowData.channel_id.toLowerCase() : '') +
|
||||
(rowData.short_channel_id ? rowData.short_channel_id.toLowerCase() : '') + (rowData.id ? rowData.id.toLowerCase() : '') + (rowData.alias ? rowData.alias.toLowerCase() : '') +
|
||||
(rowData.private ? 'private' : 'public') + ((rowData.state && this.CLNChannelPendingState[rowData.state]) ? this.CLNChannelPendingState[rowData.state].toLowerCase() : '') +
|
||||
(rowData.funding_txid ? rowData.funding_txid.toLowerCase() : '') + (rowData.msatoshi_to_us ? rowData.msatoshi_to_us : '') +
|
||||
(rowData.msatoshi_total ? rowData.msatoshi_total : '') + (rowData.their_channel_reserve_satoshis ? rowData.their_channel_reserve_satoshis : '') +
|
||||
(rowData.our_channel_reserve_satoshis ? rowData.our_channel_reserve_satoshis : '') + (rowData.spendable_msatoshi ? rowData.spendable_msatoshi : '');
|
||||
break;
|
||||
|
||||
case 'private':
|
||||
rowToFilter = rowData?.private ? 'private' : 'public';
|
||||
break;
|
||||
|
||||
case 'connected':
|
||||
rowToFilter = rowData?.connected ? 'connected' : 'disconnected';
|
||||
break;
|
||||
|
||||
case 'msatoshi_total':
|
||||
case 'spendable_msatoshi':
|
||||
case 'msatoshi_to_us':
|
||||
case 'msatoshi_to_them':
|
||||
rowToFilter = ((+(rowData[this.selFilterBy] || 0)) / 1000)?.toString() || '';
|
||||
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();
|
||||
break;
|
||||
}
|
||||
return this.selFilterBy === 'connected' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
};
|
||||
// this.invoices.filterPredicate = (rowData: Invoice, 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 '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// break;
|
||||
// }
|
||||
// return rowToFilter.includes(fltr);
|
||||
// };
|
||||
}
|
||||
|
||||
loadChannelsTable(mychannels) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export class CLNPeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public faUsers = faUsers;
|
||||
public nodePageDefs = CLN_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'peers_channels';
|
||||
public tableSetting: TableSetting = { tableId: 'peers', recordsPerPage: PAGE_SIZE, sortBy: 'alias', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -194,34 +194,31 @@ export class CLNPeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.peers.filterPredicate = (peer: Peer, fltr: string) => JSON.stringify(peer).toLowerCase().includes(fltr);
|
||||
// this.peers.filterPredicate = (rowData: Peer, 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;
|
||||
this.peers.filterPredicate = (rowData: Peer, fltr: string) => {
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterBy) {
|
||||
case 'all':
|
||||
rowToFilter = JSON.stringify(rowData).toLowerCase();
|
||||
break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// break;
|
||||
case 'connected':
|
||||
rowToFilter = rowData?.connected ? 'connected' : 'disconnected';
|
||||
break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// break;
|
||||
// }
|
||||
// return rowToFilter.includes(fltr);
|
||||
// };
|
||||
case 'netaddr':
|
||||
rowToFilter = (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();
|
||||
break;
|
||||
}
|
||||
return this.selFilterBy === 'connected' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
};
|
||||
}
|
||||
|
||||
loadPeersTable(peersArr: Peer[]) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export class CLNFailedTransactionsComponent implements OnInit, AfterViewInit, On
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public nodePageDefs = CLN_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'routing';
|
||||
public tableSetting: TableSetting = { tableId: 'failed', recordsPerPage: PAGE_SIZE, sortBy: 'received_time', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -132,43 +132,38 @@ export class CLNFailedTransactionsComponent implements OnInit, AfterViewInit, On
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.failedForwardingEvents.filterPredicate = (event: ForwardingEvent, fltr: string) => {
|
||||
const newEvent =
|
||||
(event.received_time ? this.datePipe.transform(new Date(event.received_time * 1000), 'dd/MMM/YYYY HH:mm')!.toLowerCase() : '') +
|
||||
(event.resolved_time ? this.datePipe.transform(new Date(event.resolved_time * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() : '') +
|
||||
(event.payment_hash ? event.payment_hash.toLowerCase() : '') +
|
||||
(event.in_channel ? event.in_channel.toLowerCase() : '') + (event.out_channel ? event.out_channel.toLowerCase() : '') +
|
||||
(event.in_channel_alias ? event.in_channel_alias.toLowerCase() : '') + (event.out_channel_alias ? event.out_channel_alias.toLowerCase() : '') +
|
||||
(event.in_msatoshi ? (event.in_msatoshi / 1000) : '') + (event.out_msatoshi ? (event.out_msatoshi / 1000) : '') + (event.fee ? event.fee : '');
|
||||
return newEvent?.includes(fltr) || false;
|
||||
this.failedForwardingEvents.filterPredicate = (rowData: ForwardingEvent, fltr: string) => {
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterBy) {
|
||||
case 'all':
|
||||
rowToFilter = (rowData.received_time ? this.datePipe.transform(new Date(rowData.received_time * 1000), 'dd/MMM/YYYY HH:mm')!.toLowerCase() : '') +
|
||||
(rowData.resolved_time ? this.datePipe.transform(new Date(rowData.resolved_time * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() : '') +
|
||||
(rowData.payment_hash ? rowData.payment_hash.toLowerCase() : '') +
|
||||
(rowData.in_channel ? rowData.in_channel.toLowerCase() : '') + (rowData.out_channel ? rowData.out_channel.toLowerCase() : '') +
|
||||
(rowData.in_channel_alias ? rowData.in_channel_alias.toLowerCase() : '') + (rowData.out_channel_alias ? rowData.out_channel_alias.toLowerCase() : '') +
|
||||
(rowData.in_msatoshi ? (rowData.in_msatoshi / 1000) : '') + (rowData.out_msatoshi ? (rowData.out_msatoshi / 1000) : '') + (rowData.fee ? rowData.fee : '');
|
||||
break;
|
||||
|
||||
case 'received_time':
|
||||
case 'resolved_time':
|
||||
rowToFilter = this.datePipe.transform(new Date((rowData[this.selFilterBy] || 0) * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() || '';
|
||||
break;
|
||||
|
||||
case 'in_msatoshi':
|
||||
case 'out_msatoshi':
|
||||
rowToFilter = ((+(rowData[this.selFilterBy] || 0)) / 1000)?.toString() || '';
|
||||
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();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
};
|
||||
// this.failedForwardingEvents.filterPredicate = (rowData: ForwardingEvent, 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 '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// break;
|
||||
// }
|
||||
// return rowToFilter.includes(fltr);
|
||||
// };
|
||||
}
|
||||
|
||||
loadFailedEventsTable(forwardingEvents: ForwardingEvent[]) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export class CLNForwardingHistoryComponent implements OnInit, OnChanges, AfterVi
|
|||
@Input() eventsData = [];
|
||||
@Input() selFilter = '';
|
||||
public nodePageDefs = CLN_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public tableSetting: TableSetting = { tableId: 'forwarding_history', recordsPerPage: PAGE_SIZE, sortBy: 'received_time', sortOrder: SortOrderEnum.DESCENDING };
|
||||
public successfulEvents: ForwardingEvent[] = [];
|
||||
|
|
@ -156,41 +156,37 @@ export class CLNForwardingHistoryComponent implements OnInit, OnChanges, AfterVi
|
|||
|
||||
getLabel(column: string) {
|
||||
const returnColumn: ColumnDefinition = this.nodePageDefs[this.pageId][this.tableSetting.tableId].allowedColumns.find((col) => col.column === column);
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.forwardingHistoryEvents.filterPredicate = (event: ForwardingEvent, fltr: string) => {
|
||||
const newEvent = (event.received_time ? this.datePipe.transform(new Date(event.received_time * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() + ' ' : '') +
|
||||
(event.resolved_time ? this.datePipe.transform(new Date(event.resolved_time * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() + ' ' : '') +
|
||||
(event.in_channel ? event.in_channel.toLowerCase() + ' ' : '') + (event.out_channel ? event.out_channel.toLowerCase() + ' ' : '') +
|
||||
(event.in_channel_alias ? event.in_channel_alias.toLowerCase() + ' ' : '') + (event.out_channel_alias ? event.out_channel_alias.toLowerCase() + ' ' : '') +
|
||||
(event.in_msatoshi ? (event.in_msatoshi / 1000) + ' ' : '') + (event.out_msatoshi ? (event.out_msatoshi / 1000) + ' ' : '') + (event.fee ? event.fee + ' ' : '');
|
||||
return newEvent.includes(fltr);
|
||||
this.forwardingHistoryEvents.filterPredicate = (rowData: ForwardingEvent, fltr: string) => {
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterBy) {
|
||||
case 'all':
|
||||
rowToFilter = (rowData.received_time ? this.datePipe.transform(new Date(rowData.received_time * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() + ' ' : '') +
|
||||
(rowData.resolved_time ? this.datePipe.transform(new Date(rowData.resolved_time * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() + ' ' : '') +
|
||||
(rowData.in_channel ? rowData.in_channel.toLowerCase() + ' ' : '') + (rowData.out_channel ? rowData.out_channel.toLowerCase() + ' ' : '') +
|
||||
(rowData.in_channel_alias ? rowData.in_channel_alias.toLowerCase() + ' ' : '') + (rowData.out_channel_alias ? rowData.out_channel_alias.toLowerCase() + ' ' : '') +
|
||||
(rowData.in_msatoshi ? (rowData.in_msatoshi / 1000) + ' ' : '') + (rowData.out_msatoshi ? (rowData.out_msatoshi / 1000) + ' ' : '') + (rowData.fee ? rowData.fee + ' ' : '');
|
||||
break;
|
||||
|
||||
case 'received_time':
|
||||
case 'resolved_time':
|
||||
rowToFilter = this.datePipe.transform(new Date((rowData[this.selFilterBy] || 0) * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() || '';
|
||||
break;
|
||||
|
||||
case 'in_msatoshi':
|
||||
case 'out_msatoshi':
|
||||
rowToFilter = ((+(rowData[this.selFilterBy] || 0)) / 1000)?.toString() || '';
|
||||
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();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
};
|
||||
// this.forwardingHistoryEvents.filterPredicate = (rowData: ForwardingEvent, 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 '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// break;
|
||||
// }
|
||||
// return rowToFilter.includes(fltr);
|
||||
// };
|
||||
}
|
||||
|
||||
loadForwardingEventsTable(forwardingEvents: ForwardingEvent[]) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ export class CLNLocalFailedTransactionsComponent implements OnInit, AfterViewIni
|
|||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public faExclamationTriangle = faExclamationTriangle;
|
||||
public nodePageDefs = CLN_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'routing';
|
||||
public tableSetting: TableSetting = { tableId: 'local_failed', recordsPerPage: PAGE_SIZE, sortBy: 'received_time', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -127,40 +127,38 @@ export class CLNLocalFailedTransactionsComponent implements OnInit, AfterViewIni
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.failedLocalForwardingEvents.filterPredicate = (event: LocalFailedEvent, fltr: string) => {
|
||||
const newEvent = (event.received_time ? this.datePipe.transform(new Date(event.received_time * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() : '') +
|
||||
(event.in_channel_alias ? event.in_channel_alias.toLowerCase() : '') +
|
||||
((event.failreason && this.CLNFailReason[event.failreason]) ? this.CLNFailReason[event.failreason].toLowerCase() : '') +
|
||||
(event.in_msatoshi ? (event.in_msatoshi / 1000) : '');
|
||||
return newEvent?.includes(fltr) || false;
|
||||
this.failedLocalForwardingEvents.filterPredicate = (rowData: LocalFailedEvent, fltr: string) => {
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterBy) {
|
||||
case 'all':
|
||||
rowToFilter = (rowData.received_time ? this.datePipe.transform(new Date(rowData.received_time * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() : '') +
|
||||
(rowData.in_channel_alias ? rowData.in_channel_alias.toLowerCase() : '') +
|
||||
((rowData.failreason && this.CLNFailReason[rowData.failreason]) ? this.CLNFailReason[rowData.failreason].toLowerCase() : '') +
|
||||
(rowData.in_msatoshi ? (rowData.in_msatoshi / 1000) : '');
|
||||
break;
|
||||
|
||||
case 'received_time':
|
||||
rowToFilter = this.datePipe.transform(new Date((rowData.received_time || 0) * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() || '';
|
||||
break;
|
||||
|
||||
case 'in_msatoshi':
|
||||
rowToFilter = ((+(rowData.in_msatoshi || 0)) / 1000)?.toString() || '';
|
||||
break;
|
||||
|
||||
case 'failreason':
|
||||
rowToFilter = rowData?.failreason ? this.CLNFailReason[rowData?.failreason] : '';
|
||||
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();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
};
|
||||
// this.failedLocalForwardingEvents.filterPredicate = (rowData: LocalFailedEvent, 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 '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// break;
|
||||
// }
|
||||
// return rowToFilter.includes(fltr);
|
||||
// };
|
||||
}
|
||||
|
||||
loadLocalfailedLocalEventsTable(forwardingEvents: LocalFailedEvent[]) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<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-option *ngFor="let column of ['all'].concat(displayedColumns)" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="49">
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
<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-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ export class CLNRoutingPeersComponent implements OnInit, OnChanges, AfterViewIni
|
|||
@Input() eventsData = [];
|
||||
@Input() selFilter = '';
|
||||
public nodePageDefs = CLN_PAGE_DEFS;
|
||||
public selFilterByIn = 'All';
|
||||
public selFilterByOut = 'All';
|
||||
public selFilterByIn = 'all';
|
||||
public selFilterByOut = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'routing';
|
||||
public tableSetting: TableSetting = { tableId: 'routing_peers', recordsPerPage: PAGE_SIZE, sortBy: 'total_fee', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -126,35 +126,47 @@ export class CLNRoutingPeersComponent implements OnInit, OnChanges, AfterViewIni
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
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;
|
||||
this.routingPeersIncoming.filterPredicate = (rowDataIn: RoutingPeer, fltr: string) => {
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterByIn) {
|
||||
case 'all':
|
||||
rowToFilter = JSON.stringify(rowDataIn).toLowerCase();
|
||||
break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// break;
|
||||
case 'total_amount':
|
||||
case 'total_fee':
|
||||
rowToFilter = ((+(rowDataIn[this.selFilterByIn] || 0)) / 1000)?.toString() || '';
|
||||
break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// break;
|
||||
// }
|
||||
// return rowToFilter.includes(fltr);
|
||||
// };
|
||||
default:
|
||||
rowToFilter = 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 rowToFilter.includes(fltr);
|
||||
};
|
||||
|
||||
this.routingPeersIncoming.filterPredicate = (rowDataOut: RoutingPeer, fltr: string) => {
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterByOut) {
|
||||
case 'all':
|
||||
rowToFilter = JSON.stringify(rowDataOut).toLowerCase();
|
||||
break;
|
||||
|
||||
case 'total_amount':
|
||||
case 'total_fee':
|
||||
rowToFilter = ((+(rowDataOut[this.selFilterByOut] || 0)) / 1000)?.toString() || '';
|
||||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = 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 rowToFilter.includes(fltr);
|
||||
};
|
||||
}
|
||||
|
||||
loadRoutingPeersTable(events: ForwardingEvent[]) {
|
||||
|
|
|
|||
|
|
@ -975,7 +975,7 @@ export class CLNEffects implements OnDestroy {
|
|||
};
|
||||
}),
|
||||
catchError((err: any) => {
|
||||
this.handleErrorWithoutAlert('SavePageSettings', UI_MESSAGES.UPDATE_PAGE_SETTINGS, 'Page Settings Update Failed.', err);
|
||||
this.handleErrorWithAlert('SavePageSettings', UI_MESSAGES.UPDATE_PAGE_SETTINGS, 'Page Settings Update Failed.', environment.PAGE_SETTINGS_API, err);
|
||||
return of({ type: RTLActions.VOID });
|
||||
})
|
||||
);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
</ng-container>
|
||||
<ng-container matColumnDef="type">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>Type</th>
|
||||
<td mat-cell *matCellDef="let invoice">{{ invoice?.bolt12 ? 'Bolt12' : (invoice?.bolt11 && !invoice.label.includes('keysend-')) ? 'Bolt11' : 'Keysend' }}</td>
|
||||
<td mat-cell *matCellDef="let invoice">{{ invoice?.bolt12 ? 'Bolt12' : (invoice?.bolt11 && invoice.label.includes('keysend-')) ? 'Keysend' : 'Bolt11' }}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="description">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>Description</th>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export class CLNLightningInvoicesTableComponent implements OnInit, AfterViewInit
|
|||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
faHistory = faHistory;
|
||||
public nodePageDefs = CLN_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'transactions';
|
||||
public tableSetting: TableSetting = { tableId: 'invoices', recordsPerPage: PAGE_SIZE, sortBy: 'expires_at', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -208,39 +208,43 @@ export class CLNLightningInvoicesTableComponent implements OnInit, AfterViewInit
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.invoices.filterPredicate = (rowData: Invoice, fltr: string) => {
|
||||
const newRowData = this.datePipe.transform(new Date((rowData.paid_at || 0) * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase()! +
|
||||
(this.datePipe.transform(new Date((rowData.expires_at || 0) * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase()) +
|
||||
((rowData.bolt12) ? 'bolt12' : (rowData.bolt11) ? 'bolt11' : 'keysend') + JSON.stringify(rowData).toLowerCase();
|
||||
return newRowData.includes(fltr);
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterBy) {
|
||||
case 'all':
|
||||
rowToFilter = this.datePipe.transform(new Date((rowData.paid_at || 0) * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase()! +
|
||||
(this.datePipe.transform(new Date((rowData.expires_at || 0) * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase()) +
|
||||
((rowData.bolt12) ? 'bolt12' : (rowData.bolt11) ? 'bolt11' : 'keysend') + JSON.stringify(rowData).toLowerCase();
|
||||
break;
|
||||
|
||||
case 'status':
|
||||
rowToFilter = rowData?.status === 'paid' ? 'paid' : rowData?.status === 'unpaid' ? 'unpaid' : 'expired';
|
||||
break;
|
||||
|
||||
case 'expires_at':
|
||||
case 'paid_at':
|
||||
rowToFilter = this.datePipe.transform(new Date((rowData[this.selFilterBy] || 0) * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() || '';
|
||||
break;
|
||||
|
||||
case 'type':
|
||||
rowToFilter = rowData?.bolt12 ? 'bolt12' : (rowData?.bolt11 && rowData?.label?.includes('keysend-')) ? 'keysend' : 'bolt11';
|
||||
break;
|
||||
|
||||
case 'msatoshi':
|
||||
case 'msatoshi_received':
|
||||
rowToFilter = ((+(rowData[this.selFilterBy] || 0)) / 1000)?.toString() || '';
|
||||
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();
|
||||
break;
|
||||
}
|
||||
return (this.selFilterBy === 'status' || this.selFilterBy === 'type') ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
};
|
||||
// this.invoices.filterPredicate = (rowData: Invoice, 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 '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// break;
|
||||
// }
|
||||
// return rowToFilter.includes(fltr);
|
||||
// };
|
||||
}
|
||||
|
||||
onInvoiceValueChange() {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import { CLNLightningSendPaymentsComponent } from '../../send-payment-modal/send
|
|||
import { deleteOfferBookmark, sendPayment } from '../../../store/cln.actions';
|
||||
import { ColumnDefinition, PageSettings, TableSetting } from '../../../../shared/models/pageSettings';
|
||||
import { CamelCaseWithReplacePipe } from '../../../../shared/pipes/app.pipe';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'rtl-cln-offer-bookmarks-table',
|
||||
|
|
@ -37,7 +38,7 @@ export class CLNOfferBookmarksTableComponent implements OnInit, AfterViewInit, O
|
|||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
faHistory = faHistory;
|
||||
public nodePageDefs = CLN_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'transactions';
|
||||
public tableSetting: TableSetting = { tableId: 'offer_bookmarks', recordsPerPage: PAGE_SIZE, sortBy: 'lastUpdatedAt', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -54,7 +55,7 @@ export class CLNOfferBookmarksTableComponent implements OnInit, AfterViewInit, O
|
|||
public apiCallStatusEnum = APICallStatusEnum;
|
||||
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()];
|
||||
|
||||
constructor(private logger: LoggerService, private store: Store<RTLState>, private commonService: CommonService, private rtlEffects: RTLEffects, private camelCaseWithReplace: CamelCaseWithReplacePipe) {
|
||||
constructor(private logger: LoggerService, private store: Store<RTLState>, private commonService: CommonService, private rtlEffects: RTLEffects, private datePipe: DatePipe, private camelCaseWithReplace: CamelCaseWithReplacePipe) {
|
||||
this.screenSize = this.commonService.getScreenSize();
|
||||
}
|
||||
|
||||
|
|
@ -148,34 +149,31 @@ export class CLNOfferBookmarksTableComponent implements OnInit, AfterViewInit, O
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.offersBookmarks.filterPredicate = (Ofrbm: OfferBookmark, fltr: string) => JSON.stringify(Ofrbm).toLowerCase().includes(fltr);
|
||||
// this.offersBookmarks.filterPredicate = (rowData: OfferBookmark, 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;
|
||||
this.offersBookmarks.filterPredicate = (rowData: OfferBookmark, fltr: string) => {
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterBy) {
|
||||
case 'all':
|
||||
rowToFilter = JSON.stringify(rowData).toLowerCase();
|
||||
break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// break;
|
||||
case 'lastUpdatedAt':
|
||||
rowToFilter = this.datePipe.transform(new Date(rowData.lastUpdatedAt || 0), 'dd/MMM/YYYY HH:mm')?.toLowerCase() || '';
|
||||
break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// break;
|
||||
// }
|
||||
// return rowToFilter.includes(fltr);
|
||||
// };
|
||||
case 'amountMSat':
|
||||
rowToFilter = ((!rowData.amountMSat || rowData.amountMSat === 0) ? 'Open' : (rowData.amountMSat / 1000).toString()) || '';
|
||||
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();
|
||||
break;
|
||||
}
|
||||
return rowToFilter.includes(fltr);
|
||||
};
|
||||
}
|
||||
|
||||
loadOffersTable(OffrBMs: OfferBookmark[]) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export class CLNOffersTableComponent implements OnInit, AfterViewInit, OnDestroy
|
|||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
faHistory = faHistory;
|
||||
public nodePageDefs = CLN_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'transactions';
|
||||
public tableSetting: TableSetting = { tableId: 'offers', recordsPerPage: PAGE_SIZE, sortBy: 'offer_id', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -231,40 +231,30 @@ export class CLNOffersTableComponent implements OnInit, AfterViewInit, OnDestroy
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.offers.filterPredicate = (rowData: Offer, fltr: string) => {
|
||||
const newRowData = ((rowData.active) ? ' active' : ' inactive') + ((rowData.used) ? ' used' : ' unused') + ((rowData.single_use) ? ' single' : ' multiple') + JSON.stringify(rowData).toLowerCase();
|
||||
if (fltr === 'active' || fltr === 'inactive' || fltr === 'used' || fltr === 'unused' || fltr === 'single' || fltr === 'multiple') {
|
||||
fltr = ' ' + fltr;
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterBy) {
|
||||
case 'all':
|
||||
rowToFilter = ((rowData.active) ? ' active' : ' inactive') + ((rowData.used) ? ' yes' : ' no') + ((rowData.single_use) ? ' single' : ' multiple') + JSON.stringify(rowData).toLowerCase();
|
||||
if (fltr === 'active' || fltr === 'inactive' || fltr === 'single' || fltr === 'multiple') {
|
||||
fltr = ' ' + fltr;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'active':
|
||||
rowToFilter = rowData?.active ? 'active' : 'inactive';
|
||||
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();
|
||||
break;
|
||||
}
|
||||
return newRowData.includes(fltr);
|
||||
return this.selFilterBy === 'active' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
};
|
||||
// this.offers.filterPredicate = (rowData: Offer, 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 '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// break;
|
||||
// }
|
||||
// return rowToFilter.includes(fltr);
|
||||
// };
|
||||
}
|
||||
|
||||
loadOffersTable(offrs: Offer[]) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before" matTooltip="Status"></th>
|
||||
<td mat-cell *matCellDef="let payment">
|
||||
<span *ngIf="payment.status === 'complete'" class="dot green" matTooltip="Completed" matTooltipPosition="right"></span>
|
||||
<span *ngIf="payment.status !== 'complete'" class="dot yellow" matTooltip="Failed" matTooltipPosition="right"></span>
|
||||
<span *ngIf="payment.status !== 'complete'" class="dot yellow" matTooltip="Incomplete/Failed" matTooltipPosition="right"></span>
|
||||
</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="created_at">
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export class CLNLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public nodePageDefs = CLN_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'transactions';
|
||||
public tableSetting: TableSetting = { tableId: 'payments', recordsPerPage: PAGE_SIZE, sortBy: 'created_at', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -315,37 +315,40 @@ export class CLNLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.payments.filterPredicate = (rowData: Payment, fltr: string) => {
|
||||
const newRowData = ((rowData.created_at) ? this.datePipe.transform(new Date(rowData.created_at * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() : '') + ((rowData.bolt12) ? 'bolt12' : (rowData.bolt11) ? 'bolt11' : 'keysend') + JSON.stringify(rowData).toLowerCase();
|
||||
return newRowData.includes(fltr);
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterBy) {
|
||||
case 'all':
|
||||
rowToFilter = ((rowData.created_at) ? this.datePipe.transform(new Date(rowData.created_at * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() : '') + ((rowData.bolt12) ? 'bolt12' : (rowData.bolt11) ? 'bolt11' : 'keysend') + JSON.stringify(rowData).toLowerCase();
|
||||
break;
|
||||
|
||||
case 'status':
|
||||
rowToFilter = rowData?.status === 'complete' ? 'completed' : 'incomplete/failed';
|
||||
break;
|
||||
|
||||
case 'created_at':
|
||||
rowToFilter = this.datePipe.transform(new Date((rowData[this.selFilterBy] || 0) * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() || '';
|
||||
break;
|
||||
|
||||
case 'msatoshi_sent':
|
||||
case 'msatoshi':
|
||||
rowToFilter = ((+(rowData[this.selFilterBy] || 0)) / 1000)?.toString() || '';
|
||||
break;
|
||||
|
||||
case 'type':
|
||||
rowToFilter = rowData?.bolt12 ? 'bolt12' : rowData?.bolt11 ? 'bolt11' : 'keysend';
|
||||
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();
|
||||
break;
|
||||
}
|
||||
return (this.selFilterBy === 'status' || this.selFilterBy === 'type') ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
};
|
||||
// this.payments.filterPredicate = (rowData: Payment, 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 '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// break;
|
||||
// }
|
||||
// return rowToFilter.includes(fltr);
|
||||
// };
|
||||
}
|
||||
|
||||
loadPaymentsTable(payments: Payment[]) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export class ECLOnChainTransactionHistoryComponent implements OnInit, OnDestroy
|
|||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public faHistory = faHistory;
|
||||
public nodePageDefs = ECL_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'on_chain';
|
||||
public tableSetting: TableSetting = { tableId: 'transaction', recordsPerPage: PAGE_SIZE, sortBy: 'timestamp', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -95,7 +95,7 @@ export class ECLOnChainTransactionHistoryComponent implements OnInit, OnDestroy
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
|
|
@ -106,7 +106,7 @@ export class ECLOnChainTransactionHistoryComponent implements OnInit, OnDestroy
|
|||
// this.listTransactions.filterPredicate = (rowData: Transaction, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -117,11 +117,11 @@ export class ECLOnChainTransactionHistoryComponent implements OnInit, OnDestroy
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
<mat-progress-bar *ngIf="apiCallStatus.status === apiCallStatusEnum.INITIATED" mode="indeterminate"></mat-progress-bar>
|
||||
<table mat-table #table fxFlex="100" [dataSource]="channels" matSort [ngClass]="{'overflow-auto error-border': errorMessage !== '','overflow-auto': true}">
|
||||
<ng-container matColumnDef="announceChannel">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header></th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header matTooltip="Private"></th>
|
||||
<td mat-cell *matCellDef="let channel">
|
||||
<span *ngIf="!channel.announceChannel" class="mr-1" matTooltip="Private" matTooltipPosition="right"><fa-icon [icon]="faEyeSlash"></fa-icon></span>
|
||||
<span *ngIf="channel.announceChannel" class="mr-1" matTooltip="Public" matTooltipPosition="right"><fa-icon [icon]="faEye"></fa-icon></span>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export class ECLChannelInactiveTableComponent implements OnInit, AfterViewInit,
|
|||
public faEye = faEye;
|
||||
public faEyeSlash = faEyeSlash;
|
||||
public nodePageDefs = ECL_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'peers_channels';
|
||||
public tableSetting: TableSetting = { tableId: 'inactive_channels', recordsPerPage: PAGE_SIZE, sortBy: 'alias', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -162,15 +162,15 @@ export class ECLChannelInactiveTableComponent implements OnInit, AfterViewInit,
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : column === 'announceChannel' ? 'Private' : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.channels.filterPredicate = (channel: Channel, fltr: string) => JSON.stringify(channel).toLowerCase().includes(fltr);
|
||||
this.channels.filterPredicate = (rowData: Channel, fltr: string) => JSON.stringify(rowData).toLowerCase().includes(fltr);
|
||||
// this.invoices.filterPredicate = (rowData: Invoice, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -180,12 +180,16 @@ export class ECLChannelInactiveTableComponent implements OnInit, AfterViewInit,
|
|||
// }
|
||||
// break;
|
||||
|
||||
// case 'announceChannel':
|
||||
// rowToFilter = rowData?.private ? 'private' : 'public';
|
||||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
<mat-progress-bar *ngIf="apiCallStatus.status === apiCallStatusEnum.INITIATED" mode="indeterminate"></mat-progress-bar>
|
||||
<table mat-table #table fxFlex="100" [dataSource]="channels" matSort [ngClass]="{'overflow-auto error-border': errorMessage !== '','overflow-auto': true}">
|
||||
<ng-container matColumnDef="announceChannel">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header></th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header matTooltip="Private"></th>
|
||||
<td mat-cell *matCellDef="let channel">
|
||||
<span *ngIf="!channel?.announceChannel" class="mr-1" matTooltip="Private" matTooltipPosition="right"><fa-icon [icon]="faEyeSlash"></fa-icon></span>
|
||||
<span *ngIf="channel?.announceChannel" class="mr-1" matTooltip="Public" matTooltipPosition="right"><fa-icon [icon]="faEye"></fa-icon></span>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
|
|||
public faEye = faEye;
|
||||
public faEyeSlash = faEyeSlash;
|
||||
public nodePageDefs = ECL_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'peers_channels';
|
||||
public tableSetting: TableSetting = { tableId: 'open_channels', recordsPerPage: PAGE_SIZE, sortBy: 'alias', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -232,15 +232,15 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : column === 'announceChannel' ? 'Private' : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.channels.filterPredicate = (channel: Channel, fltr: string) => JSON.stringify(channel).toLowerCase().includes(fltr);
|
||||
this.channels.filterPredicate = (rowData: Channel, fltr: string) => JSON.stringify(rowData).toLowerCase().includes(fltr);
|
||||
// this.invoices.filterPredicate = (rowData: Invoice, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -250,12 +250,16 @@ export class ECLChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
|
|||
// }
|
||||
// break;
|
||||
|
||||
// case 'announceChannel':
|
||||
// rowToFilter = rowData?.private ? 'private' : 'public';
|
||||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
<mat-progress-bar *ngIf="apiCallStatus.status === apiCallStatusEnum.INITIATED" mode="indeterminate"></mat-progress-bar>
|
||||
<table mat-table #table fxFlex="100" [dataSource]="channels" matSort [ngClass]="{'overflow-auto error-border': errorMessage !== '','overflow-auto': true}">
|
||||
<ng-container matColumnDef="announceChannel">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header></th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header matTooltip="Private"></th>
|
||||
<td mat-cell *matCellDef="let channel">
|
||||
<span *ngIf="!channel?.announceChannel" class="mr-1" matTooltip="Private" matTooltipPosition="right"><fa-icon [icon]="faEyeSlash"></fa-icon></span>
|
||||
<span *ngIf="channel?.announceChannel" class="mr-1" matTooltip="Public" matTooltipPosition="right"><fa-icon [icon]="faEye"></fa-icon></span>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export class ECLChannelPendingTableComponent implements OnInit, AfterViewInit, O
|
|||
public faEye = faEye;
|
||||
public faEyeSlash = faEyeSlash;
|
||||
public nodePageDefs = ECL_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'peers_channels';
|
||||
public tableSetting: TableSetting = { tableId: 'pending_channels', recordsPerPage: PAGE_SIZE, sortBy: 'alias', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -132,15 +132,15 @@ export class ECLChannelPendingTableComponent implements OnInit, AfterViewInit, O
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : column === 'announceChannel' ? 'Private' : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.channels.filterPredicate = (channel: Channel, fltr: string) => JSON.stringify(channel).toLowerCase().includes(fltr);
|
||||
this.channels.filterPredicate = (rowData: Channel, fltr: string) => JSON.stringify(rowData).toLowerCase().includes(fltr);
|
||||
// this.channels.filterPredicate = (rowData: Channel, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -150,12 +150,16 @@ export class ECLChannelPendingTableComponent implements OnInit, AfterViewInit, O
|
|||
// }
|
||||
// break;
|
||||
|
||||
// case 'announceChannel':
|
||||
// rowToFilter = rowData?.private ? 'private' : 'public';
|
||||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export class ECLPeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public nodePageDefs = ECL_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'peers_channels';
|
||||
public tableSetting: TableSetting = { tableId: 'peers', recordsPerPage: PAGE_SIZE, sortBy: 'alias', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -209,15 +209,15 @@ export class ECLPeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.peers.filterPredicate = (peer: Peer, fltr: string) => JSON.stringify(peer).toLowerCase().includes(fltr);
|
||||
this.peers.filterPredicate = (rowData: Peer, fltr: string) => JSON.stringify(rowData).toLowerCase().includes(fltr);
|
||||
// this.peers.filterPredicate = (rowData: Peer, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -228,11 +228,11 @@ export class ECLPeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ export class ECLForwardingHistoryComponent implements OnInit, OnChanges, AfterVi
|
|||
@Input() eventsData: PaymentRelayed[] = [];
|
||||
@Input() selFilter = '';
|
||||
public nodePageDefs = ECL_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public tableSetting: TableSetting = { tableId: 'forwarding_history', recordsPerPage: PAGE_SIZE, sortBy: 'timestamp', sortOrder: SortOrderEnum.DESCENDING };
|
||||
public displayedColumns: any[] = [];
|
||||
|
|
@ -147,7 +147,7 @@ export class ECLForwardingHistoryComponent implements OnInit, OnChanges, AfterVi
|
|||
|
||||
getLabel(column: string) {
|
||||
const returnColumn: ColumnDefinition = this.nodePageDefs[this.pageId][this.tableSetting.tableId].allowedColumns.find((col) => col.column === column);
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
|
|
@ -158,7 +158,7 @@ export class ECLForwardingHistoryComponent implements OnInit, OnChanges, AfterVi
|
|||
// this.forwardingHistoryEvents.filterPredicate = (rowData: PaymentRelayed, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -169,11 +169,11 @@ export class ECLForwardingHistoryComponent implements OnInit, OnChanges, AfterVi
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<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-option *ngFor="let column of ['all'].concat(displayedColumns)" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="49">
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
<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-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ export class ECLRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro
|
|||
@ViewChild('paginatorIn', { static: false }) paginatorIn: MatPaginator | undefined;
|
||||
@ViewChild('paginatorOut', { static: false }) paginatorOut: MatPaginator | undefined;
|
||||
public nodePageDefs = ECL_PAGE_DEFS;
|
||||
public selFilterByIn = 'All';
|
||||
public selFilterByOut = 'All';
|
||||
public selFilterByIn = 'all';
|
||||
public selFilterByOut = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'routing';
|
||||
public tableSetting: TableSetting = { tableId: 'routing_peers', recordsPerPage: PAGE_SIZE, sortBy: 'totalFee', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -105,16 +105,16 @@ export class ECLRoutingPeersComponent 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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.routingPeersIncoming.filterPredicate = (rpIn: RoutingPeers, fltr: string) => JSON.stringify(rpIn).toLowerCase().includes(fltr);
|
||||
this.routingPeersOutgoing.filterPredicate = (rpOut: RoutingPeers, fltr: string) => JSON.stringify(rpOut).toLowerCase().includes(fltr);
|
||||
this.routingPeersIncoming.filterPredicate = (rowDataIn: RoutingPeers, fltr: string) => JSON.stringify(rowDataIn).toLowerCase().includes(fltr);
|
||||
this.routingPeersOutgoing.filterPredicate = (rowDataOut: RoutingPeers, fltr: string) => JSON.stringify(rowDataOut).toLowerCase().includes(fltr);
|
||||
// this.routingPeersIncoming.filterPredicate = (rowData: RoutingPeer, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -125,11 +125,11 @@ export class ECLRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -691,7 +691,7 @@ export class ECLEffects implements OnDestroy {
|
|||
};
|
||||
}),
|
||||
catchError((err: any) => {
|
||||
this.handleErrorWithoutAlert('SavePageSettings', UI_MESSAGES.UPDATE_PAGE_SETTINGS, 'Page Settings Update Failed.', err);
|
||||
this.handleErrorWithAlert('SavePageSettings', UI_MESSAGES.UPDATE_PAGE_SETTINGS, 'Page Settings Update Failed.', environment.PAGE_SETTINGS_API, err);
|
||||
return of({ type: RTLActions.VOID });
|
||||
})
|
||||
);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ export class ECLLightningInvoicesComponent implements OnInit, AfterViewInit, OnD
|
|||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
faHistory = faHistory;
|
||||
public nodePageDefs = ECL_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'transactions';
|
||||
public tableSetting: TableSetting = { tableId: 'invoices', recordsPerPage: PAGE_SIZE, sortBy: 'expiresAt', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -183,7 +183,7 @@ export class ECLLightningInvoicesComponent implements OnInit, AfterViewInit, OnD
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
|
|
@ -194,7 +194,7 @@ export class ECLLightningInvoicesComponent implements OnInit, AfterViewInit, OnD
|
|||
// this.invoices.filterPredicate = (rowData: Invoice, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -205,11 +205,11 @@ export class ECLLightningInvoicesComponent implements OnInit, AfterViewInit, OnD
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export class ECLLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public nodePageDefs = ECL_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'transactions';
|
||||
public tableSetting: TableSetting = { tableId: 'payments', recordsPerPage: PAGE_SIZE, sortBy: 'firstPartTimestamp', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -127,7 +127,7 @@ export class ECLLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
|
|
@ -138,7 +138,7 @@ export class ECLLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
|
|||
// this.payments.filterPredicate = (rowData: PaymentSent, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -149,11 +149,11 @@ export class ECLLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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,7 +121,7 @@ export class ChannelBackupTableComponent implements OnInit, AfterViewInit, OnDes
|
|||
this.channels.sort = this.sort;
|
||||
this.channels.sortingDataAccessor = (data: any, sortHeaderId: string) => ((data[sortHeaderId] && isNaN(data[sortHeaderId])) ? data[sortHeaderId].toLocaleLowerCase() : data[sortHeaderId] ? +data[sortHeaderId] : null);
|
||||
this.channels.paginator = this.paginator;
|
||||
this.channels.filterPredicate = (channel: Channel, fltr: string) => (channel.channel_point ? channel.channel_point.toLowerCase() : '').includes(fltr);
|
||||
this.channels.filterPredicate = (rowData: Channel, fltr: string) => (rowData.channel_point ? rowData.channel_point.toLowerCase() : '').includes(fltr);
|
||||
this.applyFilter();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ export class ChannelRestoreTableComponent implements OnInit, AfterViewInit, OnDe
|
|||
this.channels.sort = this.sort;
|
||||
this.channels.sortingDataAccessor = (data: any, sortHeaderId: string) => ((data[sortHeaderId] && isNaN(data[sortHeaderId])) ? data[sortHeaderId].toLocaleLowerCase() : data[sortHeaderId] ? +data[sortHeaderId] : null);
|
||||
this.channels.paginator = this.paginator;
|
||||
this.channels.filterPredicate = (channel: Channel, fltr: string) => (channel.channel_point ? channel.channel_point.toLowerCase() : '').includes(fltr);
|
||||
this.channels.filterPredicate = (rowData: Channel, fltr: string) => (rowData.channel_point ? rowData.channel_point.toLowerCase() : '').includes(fltr);
|
||||
this.applyFilter();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export class OnChainTransactionHistoryComponent implements OnInit, OnChanges, On
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public nodePageDefs = LND_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'on_chain';
|
||||
public tableSetting: TableSetting = { tableId: 'transactions', recordsPerPage: PAGE_SIZE, sortBy: 'time_stamp', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -125,7 +125,7 @@ export class OnChainTransactionHistoryComponent implements OnInit, OnChanges, On
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
|
|
@ -136,7 +136,7 @@ export class OnChainTransactionHistoryComponent implements OnInit, OnChanges, On
|
|||
// this.listTransactions.filterPredicate = (rowData: Transaction, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -147,11 +147,11 @@ export class OnChainTransactionHistoryComponent implements OnInit, OnChanges, On
|
|||
// break;
|
||||
|
||||
// case 'time_stamp':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of (utxos && utxos.length > 0 && dustUtxos && dustUtxos.length > 0 && !isDustUTXO ? ['All'].concat(displayedColumns.slice(1).slice(0, -1)) : ['All'].concat(displayedColumns.slice(0, -1)))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<mat-option *ngFor="let column of (utxos && utxos.length > 0 && dustUtxos && dustUtxos.length > 0 && !isDustUTXO ? ['all'].concat(displayedColumns.slice(0, -1)) : ['all'].concat(displayedColumns.slice(0, -1)))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="49">
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
<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></th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header matTooltip="Dust/Non-dust"></th>
|
||||
<td mat-cell *matCellDef="let utxo">
|
||||
<span *ngIf="utxo.amount_sat < DUST_AMOUNT; else emptySpace" matTooltip="Risk of dust attack" matTooltipPosition="right">
|
||||
<mat-icon fxLayoutAlign="start center" color="warn" class="small-icon">warning</mat-icon>
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ export class OnChainUTXOsComponent implements OnInit, OnChanges, OnDestroy {
|
|||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
@Input() isDustUTXO = false;
|
||||
public faMoneyBillWave = faMoneyBillWave;
|
||||
public DUST_AMOUNT = 1000;
|
||||
public DUST_AMOUNT = 50000;
|
||||
public nodePageDefs = LND_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'on_chain';
|
||||
public tableSetting: TableSetting = { tableId: 'utxos', recordsPerPage: PAGE_SIZE, sortBy: 'tx_id', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -117,14 +117,14 @@ export class OnChainUTXOsComponent implements OnInit, OnChanges, OnDestroy {
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : column === 'is_dust' ? 'Dust' : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.listUTXOs.filterPredicate = (rowData: UTXO, fltr: string) => {
|
||||
let rowToFilter = '';
|
||||
switch (this.selFilterBy) {
|
||||
case 'All':
|
||||
case 'all':
|
||||
for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
rowToFilter = rowToFilter + (
|
||||
(this.displayedColumns[i] === 'tx_id') ?
|
||||
|
|
@ -138,6 +138,10 @@ export class OnChainUTXOsComponent implements OnInit, OnChanges, OnDestroy {
|
|||
}
|
||||
break;
|
||||
|
||||
case 'is_dust':
|
||||
rowToFilter = (rowData?.amount_sat || 0) < this.DUST_AMOUNT ? 'dust' : 'non-dust';
|
||||
break;
|
||||
|
||||
case 'tx_id':
|
||||
rowToFilter = (rowData.outpoint && rowData.outpoint.txid_str ? rowData.outpoint.txid_str.toLowerCase() : '');
|
||||
break;
|
||||
|
|
@ -151,10 +155,10 @@ export class OnChainUTXOsComponent implements OnInit, OnChanges, OnDestroy {
|
|||
break;
|
||||
|
||||
default:
|
||||
rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
rowToFilter = 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' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export class ChannelActiveHTLCsTableComponent implements OnInit, AfterViewInit,
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public nodePageDefs = LND_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'peers_channels';
|
||||
public tableSetting: TableSetting = { tableId: 'active_HTLCs', recordsPerPage: PAGE_SIZE, sortBy: 'expiration_height', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -127,19 +127,19 @@ export class ChannelActiveHTLCsTableComponent implements OnInit, AfterViewInit,
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.channels.filterPredicate = (channel: Channel, fltr: string) => {
|
||||
const newChannel = (channel.remote_alias ? channel.remote_alias.toLowerCase() : '') +
|
||||
channel.pending_htlcs?.map((htlc) => JSON.stringify(htlc) + (htlc.incoming ? 'yes' : 'no'));
|
||||
return newChannel.includes(fltr);
|
||||
this.channels.filterPredicate = (rowData: Channel, fltr: string) => {
|
||||
const rowToFilter = (rowData.remote_alias ? rowData.remote_alias.toLowerCase() : '') +
|
||||
rowData.pending_htlcs?.map((htlc) => JSON.stringify(htlc) + (htlc.incoming ? 'yes' : 'no'));
|
||||
return rowToFilter.includes(fltr);
|
||||
};
|
||||
// this.channels.filterPredicate = (rowData: Channel, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -150,11 +150,11 @@ export class ChannelActiveHTLCsTableComponent implements OnInit, AfterViewInit,
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export class ChannelClosedTableComponent implements OnInit, AfterViewInit, OnDes
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public nodePageDefs = LND_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'peers_channels';
|
||||
public tableSetting: TableSetting = { tableId: 'closed', recordsPerPage: PAGE_SIZE, sortBy: 'close_type', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -101,15 +101,15 @@ export class ChannelClosedTableComponent implements OnInit, AfterViewInit, OnDes
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.closedChannels.filterPredicate = (channel: ClosedChannel, fltr: string) => JSON.stringify(channel).toLowerCase().includes(fltr);
|
||||
this.closedChannels.filterPredicate = (rowData: ClosedChannel, fltr: string) => JSON.stringify(rowData).toLowerCase().includes(fltr);
|
||||
// this.closedChannels.filterPredicate = (rowData: ClosedChannel, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -120,11 +120,11 @@ export class ChannelClosedTableComponent implements OnInit, AfterViewInit, OnDes
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(2).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ export class ChannelOpenTableComponent implements OnInit, AfterViewInit, OnDestr
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public nodePageDefs = LND_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'peers_channels';
|
||||
public tableSetting: TableSetting = { tableId: 'open', recordsPerPage: PAGE_SIZE, sortBy: 'balancedness', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -313,23 +313,23 @@ export class ChannelOpenTableComponent implements OnInit, AfterViewInit, OnDestr
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.channels.filterPredicate = (channel: Channel, fltr: string) => {
|
||||
const newChannel = ((channel.active) ? 'active' : 'inactive') + (channel.chan_id ? channel.chan_id.toLowerCase() : '') +
|
||||
(channel.remote_pubkey ? channel.remote_pubkey.toLowerCase() : '') + (channel.remote_alias ? channel.remote_alias.toLowerCase() : '') +
|
||||
(channel.capacity ? channel.capacity : '') + (channel.local_balance ? channel.local_balance : '') +
|
||||
(channel.remote_balance ? channel.remote_balance : '') + (channel.total_satoshis_sent ? channel.total_satoshis_sent : '') +
|
||||
(channel.total_satoshis_received ? channel.total_satoshis_received : '') + (channel.commit_fee ? channel.commit_fee : '') +
|
||||
(channel.private ? 'private' : 'public');
|
||||
return newChannel.includes(fltr);
|
||||
this.channels.filterPredicate = (rowData: Channel, fltr: string) => {
|
||||
const rowToFilter = ((rowData.active) ? 'active' : 'inactive') + (rowData.chan_id ? rowData.chan_id.toLowerCase() : '') +
|
||||
(rowData.remote_pubkey ? rowData.remote_pubkey.toLowerCase() : '') + (rowData.remote_alias ? rowData.remote_alias.toLowerCase() : '') +
|
||||
(rowData.capacity ? rowData.capacity : '') + (rowData.local_balance ? rowData.local_balance : '') +
|
||||
(rowData.remote_balance ? rowData.remote_balance : '') + (rowData.total_satoshis_sent ? rowData.total_satoshis_sent : '') +
|
||||
(rowData.total_satoshis_received ? rowData.total_satoshis_received : '') + (rowData.commit_fee ? rowData.commit_fee : '') +
|
||||
(rowData.private ? 'private' : 'public');
|
||||
return rowToFilter.includes(fltr);
|
||||
};
|
||||
// this.channels.filterPredicate = (rowData: Channel, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -339,15 +339,23 @@ export class ChannelOpenTableComponent implements OnInit, AfterViewInit, OnDestr
|
|||
// }
|
||||
// break;
|
||||
|
||||
// case 'active':
|
||||
// rowToFilter = rowData?.active ? 'active' : 'inactive';
|
||||
// break;
|
||||
|
||||
// case 'private':
|
||||
// rowToFilter = rowData?.private ? 'private' : 'public';
|
||||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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 === 'active' ? rowToFilter.indexOf(fltr) === 0 : rowToFilter.includes(fltr);
|
||||
// };
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ export class PeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public nodePageDefs = LND_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'peers_channels';
|
||||
public tableSetting: TableSetting = { tableId: 'peers', recordsPerPage: PAGE_SIZE, sortBy: 'alias', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -182,15 +182,15 @@ export class PeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.peers.filterPredicate = (peer: Peer, fltr: string) => JSON.stringify(peer).toLowerCase().includes(fltr);
|
||||
this.peers.filterPredicate = (rowData: Peer, fltr: string) => JSON.stringify(rowData).toLowerCase().includes(fltr);
|
||||
// this.peers.filterPredicate = (rowData: Peer, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -201,11 +201,11 @@ export class PeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ export class ForwardingHistoryComponent implements OnInit, AfterViewInit, OnChan
|
|||
@Input() eventsData = [];
|
||||
@Input() selFilter = '';
|
||||
public nodePageDefs = LND_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'routing';
|
||||
public tableSetting: TableSetting = { tableId: 'forwarding_history', recordsPerPage: PAGE_SIZE, sortBy: 'timestamp', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -142,7 +142,7 @@ export class ForwardingHistoryComponent implements OnInit, AfterViewInit, OnChan
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
|
|
@ -153,7 +153,7 @@ export class ForwardingHistoryComponent implements OnInit, AfterViewInit, OnChan
|
|||
// this.forwardingHistoryEvents.filterPredicate = (rowData: ForwardingEvent, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -164,11 +164,11 @@ export class ForwardingHistoryComponent implements OnInit, AfterViewInit, OnChan
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ export class NonRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public nodePageDefs = LND_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'routing';
|
||||
public tableSetting: TableSetting = { tableId: 'non_routing_peers', recordsPerPage: PAGE_SIZE, sortBy: 'remote_alias', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -195,15 +195,15 @@ export class NonRoutingPeersComponent 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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.nonRoutingPeers.filterPredicate = (nrchnl: Channel, fltr: string) => JSON.stringify(nrchnl).toLowerCase().includes(fltr);
|
||||
this.nonRoutingPeers.filterPredicate = (rowData: Channel, fltr: string) => JSON.stringify(rowData).toLowerCase().includes(fltr);
|
||||
// this.peers.filterPredicate = (rowData: Peer, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -214,11 +214,11 @@ export class NonRoutingPeersComponent implements OnInit, AfterViewInit, OnDestro
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<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-option *ngFor="let column of ['all'].concat(displayedColumns)" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="49">
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
<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-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ export class RoutingPeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
@ViewChild('paginatorIn', { static: false }) paginatorIn: MatPaginator | undefined;
|
||||
@ViewChild('paginatorOut', { static: false }) paginatorOut: MatPaginator | undefined;
|
||||
public nodePageDefs = LND_PAGE_DEFS;
|
||||
public selFilterByIn = 'All';
|
||||
public selFilterByOut = 'All';
|
||||
public selFilterByIn = 'all';
|
||||
public selFilterByOut = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'routing';
|
||||
public tableSetting: TableSetting = { tableId: 'routing_peers', recordsPerPage: PAGE_SIZE, sortBy: 'total_amount', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -134,16 +134,16 @@ export class RoutingPeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.routingPeersIncoming.filterPredicate = (rpIn: RoutingPeers, fltr: string) => JSON.stringify(rpIn).toLowerCase().includes(fltr);
|
||||
this.routingPeersOutgoing.filterPredicate = (rpOut: RoutingPeers, fltr: string) => JSON.stringify(rpOut).toLowerCase().includes(fltr);
|
||||
this.routingPeersIncoming.filterPredicate = (rowDataIn: RoutingPeers, fltr: string) => JSON.stringify(rowDataIn).toLowerCase().includes(fltr);
|
||||
this.routingPeersOutgoing.filterPredicate = (rowDataOut: RoutingPeers, fltr: string) => JSON.stringify(rowDataOut).toLowerCase().includes(fltr);
|
||||
// this.routingPeersIncoming.filterPredicate = (rowData: RoutingPeer, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -154,11 +154,11 @@ export class RoutingPeersComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -1252,7 +1252,7 @@ export class LNDEffects implements OnDestroy {
|
|||
};
|
||||
}),
|
||||
catchError((err: any) => {
|
||||
this.handleErrorWithoutAlert('SavePageSettings', UI_MESSAGES.UPDATE_PAGE_SETTINGS, 'Page Settings Update Failed.', err);
|
||||
this.handleErrorWithAlert('SavePageSettings', UI_MESSAGES.UPDATE_PAGE_SETTINGS, 'Page Settings Update Failed.', environment.PAGE_SETTINGS_API, err);
|
||||
return of({ type: RTLActions.VOID });
|
||||
})
|
||||
);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ export class LightningInvoicesComponent implements OnInit, AfterViewInit, OnDest
|
|||
public faBurst = faBurst;
|
||||
public faMoneyBill1 = faMoneyBill1;
|
||||
public nodePageDefs = LND_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'transactions';
|
||||
public tableSetting: TableSetting = { tableId: 'invoices', recordsPerPage: PAGE_SIZE, sortBy: 'creation_date', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -179,19 +179,19 @@ export class LightningInvoicesComponent implements OnInit, AfterViewInit, OnDest
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.invoices.filterPredicate = (invoice: Invoice, fltr: string) => {
|
||||
const newInvoice = (invoice.creation_date ? this.datePipe.transform(new Date(invoice.creation_date * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() : '')! +
|
||||
(invoice.settle_date ? this.datePipe.transform(new Date(invoice.settle_date * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() : '') + JSON.stringify(invoice).toLowerCase();
|
||||
return newInvoice.includes(fltr);
|
||||
this.invoices.filterPredicate = (rowData: Invoice, fltr: string) => {
|
||||
const rowToFilter = (rowData.creation_date ? this.datePipe.transform(new Date(rowData.creation_date * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() : '')! +
|
||||
(rowData.settle_date ? this.datePipe.transform(new Date(rowData.settle_date * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() : '') + JSON.stringify(rowData).toLowerCase();
|
||||
return rowToFilter.includes(fltr);
|
||||
};
|
||||
// this.invoices.filterPredicate = (rowData: Invoice, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -202,11 +202,11 @@ export class LightningInvoicesComponent implements OnInit, AfterViewInit, OnDest
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(1).slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export class LightningPaymentsComponent implements OnInit, AfterViewInit, OnDest
|
|||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public faHistory = faHistory;
|
||||
public nodePageDefs = LND_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'transactions';
|
||||
public tableSetting: TableSetting = { tableId: 'payments', recordsPerPage: PAGE_SIZE, sortBy: 'creation_date', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -436,18 +436,18 @@ export class LightningPaymentsComponent implements OnInit, AfterViewInit, OnDest
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.payments.filterPredicate = (payment: Payment, fltr: string) => {
|
||||
const newPayment = ((payment.creation_date) ? this.datePipe.transform(new Date(payment.creation_date * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() : '') + JSON.stringify(payment).toLowerCase();
|
||||
return newPayment.includes(fltr);
|
||||
this.payments.filterPredicate = (rowData: Payment, fltr: string) => {
|
||||
const rowToFilter = ((rowData.creation_date) ? this.datePipe.transform(new Date(rowData.creation_date * 1000), 'dd/MMM/YYYY HH:mm')?.toLowerCase() : '') + JSON.stringify(rowData).toLowerCase();
|
||||
return rowToFilter.includes(fltr);
|
||||
};
|
||||
// this.channels.filterPredicate = (rowData: Channel, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -457,12 +457,16 @@ export class LightningPaymentsComponent implements OnInit, AfterViewInit, OnDest
|
|||
// }
|
||||
// break;
|
||||
|
||||
// case 'status':
|
||||
// rowToFilter = rowData?.status === 'SUCCEEDED' ? 'succeeded' : 'failed';
|
||||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export class BoltzSwapsComponent implements OnInit, AfterViewInit, OnChanges, On
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public nodePageDefs = LND_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'boltz';
|
||||
public tableSettingSwapOut: TableSetting = { tableId: 'swap_out', recordsPerPage: PAGE_SIZE, sortBy: 'status', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -117,15 +117,15 @@ export class BoltzSwapsComponent implements OnInit, AfterViewInit, OnChanges, On
|
|||
getLabel(column: string) {
|
||||
const tableId = (this.selectedSwapType === SwapTypeEnum.SWAP_IN) ? this.tableSettingSwapIn.tableId : this.tableSettingSwapOut.tableId;
|
||||
const returnColumn: ColumnDefinition = this.nodePageDefs[this.PAGE_ID][tableId].allowedColumns.find((col) => col.column === column);
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.listSwaps.filterPredicate = (swap: Swap, fltr: string) => JSON.stringify(swap).toLowerCase().includes(fltr);
|
||||
this.listSwaps.filterPredicate = (rowData: Swap, fltr: string) => JSON.stringify(rowData).toLowerCase().includes(fltr);
|
||||
// this.listSwaps.filterPredicate = (rowData: Swap, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -136,11 +136,11 @@ export class BoltzSwapsComponent implements OnInit, AfterViewInit, OnChanges, On
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export class SwapsComponent implements OnInit, AfterViewInit, OnChanges, OnDestr
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public nodePageDefs = LND_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public colWidth = '20rem';
|
||||
public PAGE_ID = 'loop';
|
||||
public tableSetting: TableSetting = { tableId: 'loop', recordsPerPage: PAGE_SIZE, sortBy: 'initiation_time', sortOrder: SortOrderEnum.DESCENDING };
|
||||
|
|
@ -93,15 +93,15 @@ export class SwapsComponent implements OnInit, AfterViewInit, OnChanges, OnDestr
|
|||
|
||||
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, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
this.listSwaps.filterPredicate = (swap: LoopSwapStatus, fltr: string) => JSON.stringify(swap).toLowerCase().includes(fltr);
|
||||
this.listSwaps.filterPredicate = (rowData: LoopSwapStatus, fltr: string) => JSON.stringify(rowData).toLowerCase().includes(fltr);
|
||||
// this.listSwaps.filterPredicate = (rowData: LoopSwapStatus, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -112,11 +112,11 @@ export class SwapsComponent implements OnInit, AfterViewInit, OnChanges, OnDestr
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<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)]="selFilterBy" (selectionChange)="selFilter=''; applyFilter()" name="filterBy">
|
||||
<mat-option *ngFor="let column of ['All'].concat(displayedColumns.slice(0, -1))" [value]="column">{{getLabel(column)}}</mat-option>
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export class TransactionsReportTableComponent implements OnInit, AfterViewInit,
|
|||
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
|
||||
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
|
||||
public nodePageDefs: any = LND_PAGE_DEFS;
|
||||
public selFilterBy = 'All';
|
||||
public selFilterBy = 'all';
|
||||
public timezoneOffset = new Date(Date.now()).getTimezoneOffset() * 60;
|
||||
public scrollRanges = SCROLL_RANGES;
|
||||
public transactions: any = new MatTableDataSource([]);
|
||||
|
|
@ -99,7 +99,7 @@ export class TransactionsReportTableComponent implements OnInit, AfterViewInit,
|
|||
|
||||
getLabel(column: string) {
|
||||
const returnColumn: ColumnDefinition = this.nodePageDefs['reports'][this.tableSetting.tableId].allowedColumns.find((col) => col.column === column);
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : 'All';
|
||||
return returnColumn ? returnColumn.label ? returnColumn.label : this.camelCaseWithReplace.transform(returnColumn.column, '_') : this.commonService.titleCase(column);
|
||||
}
|
||||
|
||||
setFilterPredicate() {
|
||||
|
|
@ -110,7 +110,7 @@ export class TransactionsReportTableComponent implements OnInit, AfterViewInit,
|
|||
// this.transactions.filterPredicate = (rowData: LoopSwapStatus, fltr: string) => {
|
||||
// let rowToFilter = '';
|
||||
// switch (this.selFilterBy) {
|
||||
// case 'All':
|
||||
// case 'all':
|
||||
// for (let i = 0; i < this.displayedColumns.length - 1; i++) {
|
||||
// rowToFilter = rowToFilter + (
|
||||
// (this.displayedColumns[i] === '') ?
|
||||
|
|
@ -121,11 +121,11 @@ export class TransactionsReportTableComponent implements OnInit, AfterViewInit,
|
|||
// break;
|
||||
|
||||
// case '':
|
||||
// rowToFilter = (rowData ? rowData..toLowerCase() : '');
|
||||
// rowToFilter = rowData?..toLowerCase() || '';
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// rowToFilter = (rowData[this.selFilterBy] ? rowData[this.selFilterBy].toLowerCase() : '');
|
||||
// rowToFilter = 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);
|
||||
|
|
|
|||
|
|
@ -395,8 +395,9 @@ export interface UTXO {
|
|||
value?: number;
|
||||
status?: string;
|
||||
blockheight?: string;
|
||||
scriptpubkey?: string;
|
||||
address?: string;
|
||||
amount_msat?: string;
|
||||
reserved?: boolean;
|
||||
}
|
||||
|
||||
export interface RoutingPeer {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue