|
|
@ -1,4 +1,6 @@
|
|
|
|
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
|
|
|
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
|
|
|
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
|
|
|
|
|
|
|
import { Subject } from 'rxjs';
|
|
|
|
import { Subject } from 'rxjs';
|
|
|
|
import { takeUntil, filter, take } from 'rxjs/operators';
|
|
|
|
import { takeUntil, filter, take } from 'rxjs/operators';
|
|
|
|
import { Store } from '@ngrx/store';
|
|
|
|
import { Store } from '@ngrx/store';
|
|
|
@ -31,7 +33,7 @@ export class PeersComponent implements OnInit, OnDestroy {
|
|
|
|
public flgSticky = false;
|
|
|
|
public flgSticky = false;
|
|
|
|
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()];
|
|
|
|
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()];
|
|
|
|
|
|
|
|
|
|
|
|
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private rtlEffects: RTLEffects, private actions$: Actions) {
|
|
|
|
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.State>, private rtlEffects: RTLEffects, private actions$: Actions, private router: Router) {
|
|
|
|
switch (true) {
|
|
|
|
switch (true) {
|
|
|
|
case (window.innerWidth <= 415):
|
|
|
|
case (window.innerWidth <= 415):
|
|
|
|
this.displayedColumns = ['detach', 'pub_key', 'alias'];
|
|
|
|
this.displayedColumns = ['detach', 'pub_key', 'alias'];
|
|
|
@ -40,15 +42,15 @@ export class PeersComponent implements OnInit, OnDestroy {
|
|
|
|
this.displayedColumns = ['detach', 'pub_key', 'alias', 'address', 'sat_sent', 'sat_recv'];
|
|
|
|
this.displayedColumns = ['detach', 'pub_key', 'alias', 'address', 'sat_sent', 'sat_recv'];
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (window.innerWidth > 730 && window.innerWidth <= 1024):
|
|
|
|
case (window.innerWidth > 730 && window.innerWidth <= 1024):
|
|
|
|
this.displayedColumns = ['detach', 'pub_key', 'alias', 'address', 'sat_sent', 'sat_recv', 'inbound'];
|
|
|
|
this.displayedColumns = ['detach', 'add_channel', 'pub_key', 'alias', 'address', 'sat_sent', 'sat_recv', 'inbound'];
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (window.innerWidth > 1024 && window.innerWidth <= 1280):
|
|
|
|
case (window.innerWidth > 1024 && window.innerWidth <= 1280):
|
|
|
|
this.flgSticky = true;
|
|
|
|
this.flgSticky = true;
|
|
|
|
this.displayedColumns = ['detach', 'pub_key', 'alias', 'address', 'sat_sent', 'sat_recv', 'inbound', 'ping_time'];
|
|
|
|
this.displayedColumns = ['detach', 'add_channel', 'pub_key', 'alias', 'address', 'sat_sent', 'sat_recv', 'inbound', 'ping_time'];
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
this.flgSticky = true;
|
|
|
|
this.flgSticky = true;
|
|
|
|
this.displayedColumns = ['detach', 'pub_key', 'alias', 'address', 'bytes_sent', 'bytes_recv', 'sat_sent', 'sat_recv', 'inbound', 'ping_time'];
|
|
|
|
this.displayedColumns = ['detach', 'add_channel', 'pub_key', 'alias', 'address', 'bytes_sent', 'bytes_recv', 'sat_sent', 'sat_recv', 'inbound', 'ping_time'];
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -133,6 +135,10 @@ export class PeersComponent implements OnInit, OnDestroy {
|
|
|
|
this.peerAddress = '';
|
|
|
|
this.peerAddress = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onAddChannel(peerToAddChannel: Peer) {
|
|
|
|
|
|
|
|
this.router.navigate(['chnlmanage'], { state: { peer: peerToAddChannel.pub_key }});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onPeerDetach(peerToDetach: Peer) {
|
|
|
|
onPeerDetach(peerToDetach: Peer) {
|
|
|
|
const msg = 'Detach peer: ' + peerToDetach.pub_key;
|
|
|
|
const msg = 'Detach peer: ' + peerToDetach.pub_key;
|
|
|
|
const msg_type = 'CONFIRM';
|
|
|
|
const msg_type = 'CONFIRM';
|
|
|
|