RTL/src/app/clightning/lookups/node-lookup/node-lookup.component.ts
ShahanaFarooqui 5a38585b71
Release 0.10.0 (#571)
Channel backup download file bug fix #536
Added macaroon authentication for Loop (#543)
Adding Label for Loop In & Loop Out #538
Fee Report & Routing Enhancements (#555)
Payments report #559
Transactions Report #357
Material table sorting bug fix #556
CL & ECL ng Routing #551 & Hocon Read Fix #560 (#561)
CLT & ECL Reports (#562)
UI Bug fixes for tables group sort, pagination, dialog and spinner close
Increased request body size #544 (#564)
App lock after 5 attempts #542 & DatePicker default adapter #532 (#566)
Upgade Angular 11 (#568)
Loop amount validation #569
Loop https document updates
2020-12-20 18:36:04 -05:00

34 lines
1.5 KiB
TypeScript

import { Component, OnInit, Input, ViewChild } from '@angular/core';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { LookupNode } from '../../../shared/models/clModels';
import { LoggerService } from '../../../shared/services/logger.service';
@Component({
selector: 'rtl-cl-node-lookup',
templateUrl: './node-lookup.component.html',
styleUrls: ['./node-lookup.component.scss']
})
export class CLNodeLookupComponent implements OnInit {
@ViewChild(MatSort, { static: false }) sort: MatSort|undefined;
@Input() lookupResult: LookupNode;
public addresses: any;
public displayedColumns = ['type', 'address', 'port', 'actions'];
constructor(private logger: LoggerService, private snackBar: MatSnackBar) { }
ngOnInit() {
this.addresses = this.lookupResult.addresses ? new MatTableDataSource<any>([...this.lookupResult.addresses]) : new MatTableDataSource([]);
this.addresses.data = this.lookupResult.addresses ? this.lookupResult.addresses : [];
this.addresses.sort = this.sort;
this.addresses.sortingDataAccessor = (data: any, sortHeaderId: string) => (data[sortHeaderId] && isNaN(data[sortHeaderId])) ? data[sortHeaderId].toLocaleLowerCase() : data[sortHeaderId] ? +data[sortHeaderId] : null;
}
onCopyNodeURI(payload: string) {
this.snackBar.open('Node URI copied.');
this.logger.info('Copied Text: ' + payload);
}
}