CLightning Final

CLightning Final
This commit is contained in:
Shahana Farooqui 2019-09-14 19:34:11 -04:00
parent b6b0263ae2
commit d464f048e4
20 changed files with 61 additions and 50 deletions

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

View File

@ -6,8 +6,8 @@
<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.a123d5293afd8ff6e937.css"></head>
<link rel="stylesheet" href="styles.57e2ca8febc1e490a78e.css"></head>
<body>
<rtl-app></rtl-app>
<script src="runtime.869c239f2a34f0ac33b4.js"></script><script src="polyfills-es5.763f4f23e8aee5ec234d.js" nomodule></script><script src="polyfills.e59b6f9dc696bd89cf7f.js"></script><script src="main.d6a4b7309c1169a470c3.js"></script></body>
<script src="runtime.2c0e6d079b6a153c14a6.js"></script><script src="polyfills-es5.763f4f23e8aee5ec234d.js" nomodule></script><script src="polyfills.e59b6f9dc696bd89cf7f.js"></script><script src="main.47538d335176cbfd935d.js"></script></body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
!function(e){function r(r){for(var n,i,a=r[0],c=r[1],f=r[2],p=0,s=[];p<a.length;p++)o[i=a[p]]&&s.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++)0!==o[t[a]]&&(n=!1);n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={0:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+""+({}[e]||e)+"."+{1:"5d20dbfb50eaa379bb80",6:"41193b34c546c4d31094",7:"e3fc04f04ff1b847504d"}[e]+".js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout(function(){u({type:"timeout",target:a})},12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,(function(r){return e[r]}).bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var l=c;t()}([]);
!function(e){function r(r){for(var n,i,a=r[0],c=r[1],f=r[2],p=0,s=[];p<a.length;p++)o[i=a[p]]&&s.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++)0!==o[t[a]]&&(n=!1);n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={0:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+""+({}[e]||e)+"."+{1:"5d20dbfb50eaa379bb80",6:"c06c1424ecef60f24713",7:"72fc15f98ed87cd51e99"}[e]+".js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout(function(){u({type:"timeout",target:a})},12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,(function(r){return e[r]}).bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var l=c;t()}([]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -12,8 +12,8 @@ export const routes: Routes = [
{ path: 'lnd', loadChildren: () => import('./lnd/lnd.module').then(childModule => childModule.LNDModule), canActivate: [AuthGuard] },
{ path: 'cl', loadChildren: () => import('./clightning/cl.module').then(childModule => childModule.CLModule), canActivate: [AuthGuard] },
{ path: 'sconfig', component: ServerConfigComponent, canActivate: [AuthGuard] },
{ path: 'login', component: SigninComponent },
{ path: 'help', component: HelpComponent },
{ path: 'login', component: SigninComponent },
{ path: 'ssoerror', component: SsoFailedComponent },
{ path: '**', component: NotFoundComponent }
];

View File

@ -20,7 +20,6 @@ export class CLRootComponent implements OnInit, OnDestroy {
ngOnInit() {
this.store.dispatch(new RTLActions.FetchInfoCL());
this.router.navigate(['./home'], {relativeTo: this.activatedRoute});
this.actions$.pipe(takeUntil(this.unsubs[0]), filter((action) => action.type === RTLActions.SET_INFO_CL))
.subscribe((infoData: RTLActions.SetInfoCL) => {
if(infoData.type === RTLActions.SET_INFO_CL && undefined !== infoData.payload.id) {

View File

@ -27,6 +27,14 @@ export const ClRoutes: Routes = [
{ path: 'invoices', component: CLInvoicesComponent, canActivate: [CLUnlockedGuard] },
{ path: 'forwardinghistory', component: CLForwardingHistoryComponent, canActivate: [CLUnlockedGuard] },
{ path: 'lookups', component: CLLookupsComponent, canActivate: [CLUnlockedGuard] },
{ path: 'unlocklnd', redirectTo: 'home' },
{ path: 'chnlclosed', redirectTo: 'chnlmanage' },
{ path: 'chnlpending', redirectTo: 'chnlmanage' },
{ path: 'chnlbackup', redirectTo: 'chnlmanage' },
{ path: 'transsendreceive', redirectTo: 'onchain' },
{ path: 'translist', redirectTo: 'onchain' },
{ path: 'switch', redirectTo: 'forwardinghistory' },
{ path: 'routingpeers', redirectTo: 'home' },
{ path: '**', component: NotFoundComponent }
]}
];

View File

@ -1,5 +1,6 @@
import { Component, OnInit, Input } from '@angular/core';
import { formatDate } from '@angular/common';
import { LoggerService } from '../../../shared/services/logger.service';
import { LookupNodeCL } from '../../../shared/models/clModels';
@ -12,10 +13,10 @@ export class CLNodeLookupComponent implements OnInit {
@Input() lookupResult: LookupNodeCL;
public displayedColumns = ['type', 'address', 'port'];
constructor() { }
constructor(private logger: LoggerService) { }
ngOnInit() {
console.warn(this.lookupResult);
this.logger.info(this.lookupResult);
if (undefined !== this.lookupResult && undefined !== this.lookupResult.last_timestamp_str) {
this.lookupResult.last_timestamp_str = (this.lookupResult.last_timestamp_str === '') ?
'' : formatDate(this.lookupResult.last_timestamp_str, 'MMM/dd/yy HH:mm:ss', 'en-US');

View File

@ -20,7 +20,6 @@ export class LNDRootComponent implements OnInit, OnDestroy {
ngOnInit() {
this.store.dispatch(new RTLActions.FetchInfo());
this.router.navigate(['./home'], {relativeTo: this.activatedRoute});
this.actions$.pipe(takeUntil(this.unsubs[0]), filter((action) => action.type === RTLActions.SET_INFO))
.subscribe((infoData: RTLActions.SetInfo) => {
if(infoData.type === RTLActions.SET_INFO && undefined !== infoData.payload.identity_pubkey) {

View File

@ -39,6 +39,8 @@ export const LndRoutes: Routes = [
{ path: 'switch', component: ForwardingHistoryComponent, canActivate: [LNDUnlockedGuard] },
{ path: 'routingpeers', component: RoutingPeersComponent, canActivate: [LNDUnlockedGuard] },
{ path: 'lookups', component: LookupsComponent, canActivate: [LNDUnlockedGuard] },
{ path: 'onchain', redirectTo: 'transsendreceive' },
{ path: 'forwardinghistory', redirectTo: 'switch' },
{ path: '**', component: NotFoundComponent }
]}
];

View File

@ -1,6 +1,6 @@
<mat-toolbar color="primary" [fxLayoutAlign] = "settings.menuType === 'Mini' ? 'center center' : 'space-between center'">
<a *ngIf="settings.menuType === 'Mini'" [routerLink]="[navMenus.data[0].link]" class="logo padding-gap-x mat-elevation-z6">R</a>
<a *ngIf="settings.menuType !== 'Mini'" [routerLink]="[navMenus.data[0].link]" class="logo">RTL</a>
<a *ngIf="settings.menuType === 'Mini'" routerLink="{{navMenus.data[0].link}}" class="logo padding-gap-x mat-elevation-z6">R</a>
<a *ngIf="settings.menuType !== 'Mini'" routerLink="{{navMenus.data[0].link}}" class="logo">RTL</a>
<svg *ngIf="settings.menuType !== 'Mini' && !smallScreen" style="width:24px;height:24px;cursor:pointer;" viewBox="0 0 24 24"
(click)="settings.flgSidenavPinned = !settings.flgSidenavPinned">
<path fill="currentColor" *ngIf="!settings.flgSidenavPinned" d="M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z" />
@ -16,7 +16,7 @@
</div>
<mat-tree [dataSource]="navMenus" [treeControl]="treeControl" *ngIf="settings.menuType !== 'Compact'">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle (click)="onChildNavClicked(node)" matTreeNodePadding [matTreeNodePaddingIndent]="settings.menuType === 'Mini' ? 28 : 40" routerLinkActive="active-link" [routerLink]="[node.link]">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle (click)="onChildNavClicked(node)" matTreeNodePadding [matTreeNodePaddingIndent]="settings.menuType === 'Mini' ? 28 : 40" routerLinkActive="active-link" routerLink="{{node.link}}">
<mat-icon class="mr-1" matTooltip="{{node.name}}" matTooltipPosition="right" [matTooltipDisabled]="settings.menuType !== 'Mini'">{{node.icon}}<span *ngIf="node.name === 'Pending' && settings.menuType === 'Mini'" [matBadgeHidden]="numPendingChannels<1" matBadge="{{numPendingChannels}}" matBadgeOverlap="false" matBadgeColor="accent"></span></mat-icon>
<span *ngIf="settings.menuType !== 'Mini'">{{node.name}}<span *ngIf="node.name === 'Pending'" [matBadgeHidden]="numPendingChannels<1" matBadge="{{numPendingChannels}}" matBadgeOverlap="false" matBadgeColor="accent"></span></span>
</mat-tree-node>
@ -40,7 +40,7 @@
</mat-tree>
<mat-tree [dataSource]="navMenus" [treeControl]="treeControl" *ngIf="settings.menuType === 'Compact'">
<mat-tree-node fxLayout="column" fxLayoutAlign="center center" *matTreeNodeDef="let node" matTreeNodeToggle (click)="onChildNavClicked(node)" matTreeNodePadding matTreeNodePaddingIndent="60" routerLinkActive="active-link" [routerLink]="[node.link]">
<mat-tree-node fxLayout="column" fxLayoutAlign="center center" *matTreeNodeDef="let node" matTreeNodeToggle (click)="onChildNavClicked(node)" matTreeNodePadding matTreeNodePaddingIndent="60" routerLinkActive="active-link" routerLink="{{node.link}}">
<mat-icon class="mat-icon-36">{{node.icon}}</mat-icon>
<span>{{node.name}}<span *ngIf="node.name === 'Pending'" [matBadgeHidden]="numPendingChannels<1" matBadge="{{numPendingChannels}}" matBadgeOverlap="false" matBadgeColor="accent"></span></span>
</mat-tree-node>

View File

@ -17,14 +17,16 @@
</mat-form-field>
</div>
</div>
<mat-divider></mat-divider>
</div>
<div *ngIf="selNode.lnImplementation !== 'CLT'">
<h4>Currency Unit</h4>
<div fxLayout="row" fxLayoutAlign="space-between center">
<span>{{currencyUnit}}</span>
<mat-slide-toggle [checked]="selNode?.settings?.satsToBTC" (change)="toggleSettings('satsToBTC')" labelPosition="before"></mat-slide-toggle>
</div>
<mat-divider class="mt-2"></mat-divider>
</div>
<h4>Currency Unit</h4>
<div fxLayout="row" fxLayoutAlign="space-between center">
<span>{{currencyUnit}}</span>
<mat-slide-toggle [checked]="selNode?.settings?.satsToBTC" (change)="toggleSettings('satsToBTC')" labelPosition="before"></mat-slide-toggle>
</div>
<mat-divider class="mt-2"></mat-divider>
<div *ngIf="showSettingOption">
<h4>Menu</h4>
<mat-radio-group [(ngModel)]="selectedMenu" (change)="chooseMenu()">
@ -64,26 +66,5 @@
<div class="skin light-teal m-1px" (click)="changeTheme('light-teal')"></div>
<div class="skin light-blue-gray m-1px" (click)="changeTheme('light-blue-gray')"></div>
</div>
<!-- <div fxLayout="row" fxLayoutAlign="start start" class="p-0">
<div class="skin bluegray-amber m-1px" (click)="changeTheme('bluegray-amber')"></div>
<div class="skin bluegray-deeppurple m-1px" (click)="changeTheme('bluegray-deeppurple')"></div>
<div class="skin bluegray-lightgreen m-1px" (click)="changeTheme('bluegray-lightgreen')"></div>
</div>
<div fxLayout="row" fxLayoutAlign="start start" class="p-0">
<div class="skin gray-blue m-1px" (click)="changeTheme('gray-blue')"></div>
<div class="skin gray-lime m-1px" (click)="changeTheme('gray-lime')"></div>
<div class="skin gray-purple m-1px" (click)="changeTheme('gray-purple')"></div>
</div>
<div fxLayout="row" fxLayoutAlign="start start" class="p-0">
<div class="skin self-gray m-1px" (click)="changeTheme('self-gray')"></div>
<div class="skin self-blue m-1px" (click)="changeTheme('self-blue')"></div>
<div class="skin self-brown m-1px" (click)="changeTheme('self-brown')"></div>
</div>
<div fxLayout="row" fxLayoutAlign="start start" class="p-0">
<div class="skin self-yellow m-1px" (click)="changeTheme('self-yellow')"></div>
<div class="skin self-green m-1px" (click)="changeTheme('self-green')"></div>
<div class="skin self-pink m-1px" (click)="changeTheme('self-pink')"></div>
</div> -->
<mat-divider class="mt-2"></mat-divider>
</div>
</div>

View File

@ -20,8 +20,8 @@ export const MENU_DATA: MenuRootNode = {
{id: 7, parentId: 0, name: 'Forwarding History', icon: 'timeline', link: '/lnd/switch'},
{id: 8, parentId: 0, name: 'Routing Peers', icon: 'group_work', link: '/lnd/routingpeers'},
{id: 9, parentId: 0, name: 'Lookups', icon: 'search', link: '/lnd/lookups'},
{id: 10, parentId: 0, name: 'Node Config', icon: 'perm_data_setting', link: '../sconfig'},
{id: 11, parentId: 0, name: 'Help', icon: 'help', link: '../help'}
{id: 10, parentId: 0, name: 'Node Config', icon: 'perm_data_setting', link: '/sconfig'},
{id: 11, parentId: 0, name: 'Help', icon: 'help', link: '/help'}
],
CLChildren: [
{id: 1, parentId: 0, name: 'Home', icon: 'home', link: '/cl/home'},
@ -35,8 +35,8 @@ export const MENU_DATA: MenuRootNode = {
{id: 6, parentId: 0, name: 'Invoices', icon: 'receipt', link: '/cl/invoices'},
{id: 7, parentId: 0, name: 'Forwarding History', icon: 'timeline', link: '/cl/forwardinghistory'},
{id: 9, parentId: 0, name: 'Lookups', icon: 'search', link: '/cl/lookups'},
{id: 10, parentId: 0, name: 'Node Config', icon: 'perm_data_setting', link: '../sconfig'},
{id: 11, parentId: 0, name: 'Help', icon: 'help', link: '../help'}
{id: 10, parentId: 0, name: 'Node Config', icon: 'perm_data_setting', link: '/sconfig'},
{id: 11, parentId: 0, name: 'Help', icon: 'help', link: '/help'}
]
};

View File

@ -775,3 +775,7 @@ tr.mat-row:hover, .mat-tree-node:hover {
box-shadow: inset 0.1em 0.1em 0.1em 0 rgba(0,0,0,0.5), inset -0.1em -0.1em 0.1em 0 rgba(255,255,255,0.5);
cursor: pointer;
}
.settings.mat-sidenav .mat-drawer-inner-container {
overflow: hidden;
}

View File

@ -5,6 +5,7 @@ import { Store } from '@ngrx/store';
import { Actions, Effect, ofType } from '@ngrx/effects';
import { of, Subject } from 'rxjs';
import { map, mergeMap, catchError, take, withLatestFrom } from 'rxjs/operators';
import { Location } from '@angular/common';
import { MatDialog } from '@angular/material';
@ -31,7 +32,8 @@ export class RTLEffects implements OnDestroy {
private store: Store<fromRTLReducer.RTLState>,
private logger: LoggerService,
public dialog: MatDialog,
private router: Router) { }
private router: Router,
private location: Location) { }
@Effect({ dispatch: false })
openSpinner = this.actions$.pipe(
@ -254,12 +256,27 @@ export class RTLEffects implements OnDestroy {
this.store.dispatch(new RTLActions.ResetRootStore(action.payload.lnNode));
this.store.dispatch(new RTLActions.ResetLNDStore(selNode));
this.store.dispatch(new RTLActions.ResetCLStore(selNode));
let newRoute = this.location.path();
if(action.payload.lnNode.lnImplementation.toUpperCase() === 'CLT') {
this.router.navigate(['/cl/home']);
if(newRoute.includes('/lnd/')) {
newRoute = newRoute.replace('/lnd/', '/cl/');
} else if(newRoute === '/') {
newRoute = '/cl/home';
}
this.router.routeReuseStrategy.shouldReuseRoute = () => false;
this.router.onSameUrlNavigation = 'reload';
this.router.navigate([newRoute]);
this.CHILD_API_URL = API_URL + '/cl';
return { type: RTLActions.VOID };
} else {
this.router.navigate(['/lnd/home']);
if(newRoute.includes('/cl/')) {
newRoute = newRoute.replace('/cl/', '/lnd/');
} else if(newRoute === '/') {
newRoute = '/lnd/home';
}
this.router.routeReuseStrategy.shouldReuseRoute = () => false;
this.router.onSameUrlNavigation = 'reload';
this.router.navigate([newRoute]);
this.CHILD_API_URL = API_URL + '/lnd';
return { type: RTLActions.VOID };
}