Issue #140 Open channel on peers

Issue #140 Open channel on peers
pull/145/head
ShahanaFarooqui 5 years ago
parent 611d85971c
commit c7a41a0970

@ -5,7 +5,7 @@ MIT
MIT
The MIT License
Copyright (c) 2018 Google LLC.
Copyright (c) 2019 Google LLC.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -64,7 +64,7 @@ MIT
MIT
The MIT License
Copyright (c) 2018 Google LLC.
Copyright (c) 2019 Google LLC.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

@ -5,8 +5,8 @@
<title>RTL</title>
<base href="/rtl/"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="assets/images/favicon.ico">
<link rel="stylesheet" href="styles.a3085bbe47a50e69e628.css"></head>
<link rel="stylesheet" href="styles.4ea35a27750bb09e5436.css"></head>
<body>
<rtl-app></rtl-app>
<script type="text/javascript" src="runtime.26209474bfa8dc87a77c.js"></script><script type="text/javascript" src="polyfills.181b5a67c421a167a96a.js"></script><script type="text/javascript" src="main.e3e394019f151198dd70.js"></script></body>
<script type="text/javascript" src="runtime.26209474bfa8dc87a77c.js"></script><script type="text/javascript" src="polyfills.d68e8f4f73dfaef206f1.js"></script><script type="text/javascript" src="main.dd08f35ad522015a7bf3.js"></script></body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1083
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
{
"name": "rtl",
"version": "0.3.1-beta",
"version": "0.3.2-beta",
"license": "MIT",
"scripts": {
"ng": "ng",
@ -14,22 +14,22 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^7.0.0",
"@angular/cdk": "^7.2.0",
"@angular/common": "^7.0.0",
"@angular/compiler": "^7.0.0",
"@angular/core": "^7.0.0",
"@angular/animations": "^7.2.15",
"@angular/cdk": "^7.3.7",
"@angular/common": "^7.2.15",
"@angular/compiler": "^7.2.15",
"@angular/core": "^7.2.15",
"@angular/flex-layout": "^7.0.0-beta.19",
"@angular/forms": "^7.0.0",
"@angular/http": "^7.0.0",
"@angular/material": "^7.2.0",
"@angular/platform-browser": "^7.0.0",
"@angular/platform-browser-dynamic": "^7.0.0",
"@angular/router": "^7.0.0",
"@ngrx/effects": "^7.0.0",
"@ngrx/router-store": "^7.0.0",
"@ngrx/store": "^7.0.0",
"@ngrx/store-devtools": "^7.0.0",
"@angular/forms": "^7.2.15",
"@angular/http": "^7.2.15",
"@angular/material": "^7.3.7",
"@angular/platform-browser": "^7.2.15",
"@angular/platform-browser-dynamic": "^7.2.15",
"@angular/router": "^7.2.15",
"@ngrx/effects": "^7.4.0",
"@ngrx/router-store": "^7.4.0",
"@ngrx/store": "^7.4.0",
"@ngrx/store-devtools": "^7.4.0",
"@swimlane/ngx-charts": "^10.0.0",
"angular-user-idle": "^2.0.0",
"angularx-qrcode": "^1.5.3",
@ -44,18 +44,18 @@
"node-sass": "^4.12.0",
"optimist": "^0.6.1",
"request-promise": "^4.2.2",
"rxjs": "^6.3.3",
"rxjs": "^6.5.2",
"rxjs-compat": "^6.3.3",
"sha256": "^0.2.0",
"tslib": "^1.9.0",
"upper-case": "^1.1.3",
"zone.js": "~0.8.26"
"zone.js": "~0.8.29"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.13.8",
"@angular/cli": "^7.3.8",
"@angular/compiler-cli": "^7.2.9",
"@angular/language-service": "^7.0.0",
"@angular-devkit/build-angular": "^0.13.9",
"@angular/cli": "^7.3.9",
"@angular/compiler-cli": "^7.2.15",
"@angular/language-service": "^7.2.15",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^8.9.5",
@ -70,6 +70,6 @@
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.3"
"typescript": "~3.2.4"
}
}

@ -1,6 +1,8 @@
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Router, NavigationStart, ActivatedRoute } from '@angular/router';
import { Subject, Observable } from 'rxjs';
import { takeUntil, filter, map, subscribeOn } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
@ -38,9 +40,11 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
public isPrivate = false;
public moreOptions = false;
public flgSticky = false;
private state$: Observable<object>;
private unsub: 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, private activatedRoute: ActivatedRoute) {
switch (true) {
case (window.innerWidth <= 415):
this.displayedColumns = ['close', 'update', 'active', 'chan_id', 'remote_alias'];
@ -91,6 +95,9 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
this.logger.info(rtlStore);
});
this.activatedRoute.paramMap.subscribe(() => {
this.selectedPeer = window.history.state.peer;
});
}
onOpenChannel(form: any) {

@ -39,6 +39,10 @@
<th mat-header-cell *matHeaderCellDef>Detach</th>
<td mat-cell *matCellDef="let peer"><mat-icon color="accent" (click)="onPeerDetach(peer)">link_off</mat-icon></td>
</ng-container>
<ng-container matColumnDef="add_channel">
<th mat-header-cell *matHeaderCellDef>Add Channel</th>
<td mat-cell *matCellDef="let peer"><mat-icon color="accent" (click)="onAddChannel(peer)">playlist_add</mat-icon></td>
</ng-container>
<ng-container matColumnDef="pub_key">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Pub Key </th>
<td mat-cell *matCellDef="let peer">

@ -1,4 +1,6 @@
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter, take } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -31,7 +33,7 @@ export class PeersComponent implements OnInit, OnDestroy {
public flgSticky = false;
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) {
case (window.innerWidth <= 415):
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'];
break;
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;
case (window.innerWidth > 1024 && window.innerWidth <= 1280):
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;
default:
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;
}
}
@ -133,6 +135,10 @@ export class PeersComponent implements OnInit, OnDestroy {
this.peerAddress = '';
}
onAddChannel(peerToAddChannel: Peer) {
this.router.navigate(['chnlmanage'], { state: { peer: peerToAddChannel.pub_key }});
}
onPeerDetach(peerToDetach: Peer) {
const msg = 'Detach peer: ' + peerToDetach.pub_key;
const msg_type = 'CONFIRM';

Loading…
Cancel
Save