2
0
mirror of https://github.com/Ride-The-Lightning/RTL synced 2024-10-31 09:20:27 +00:00

Fix: Dark theme, lnd payment message, node lookup connect, Issues 1211, 1210, 1134

Fix: Dark theme, lnd payment message, node lookup connect, Issues 1211, 1210, 1134
This commit is contained in:
Shahana Farooqui 2023-04-18 12:37:23 -07:00
parent bd72be79bb
commit 1bd901feab
23 changed files with 226 additions and 53 deletions

View File

@ -123,5 +123,8 @@
}
}
}
},
"cli": {
"analytics": false
}
}

View File

@ -176,6 +176,7 @@ export const postTransactions = (req, res, next) => {
options.form = JSON.stringify(options.form);
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Send Payment Options', data: options.form });
request.post(options).then((body) => {
body = body.result ? body.result : body;
if (body.payment_error) {
const err = common.handleError(body.payment_error, 'Channels', 'Send Payment Error', req.session.selectedNode);
return res.status(err.statusCode).json({ message: err.message, error: err.error });

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

View File

@ -10,9 +10,9 @@
<link i18n-rel="" rel="mask-icon" href="assets/images/favicon-light/safari-pinned-tab.svg" color="#5bbad5">
<meta i18n-content="" name="msapplication-TileColor" content="#da532c">
<meta i18n-content="" name="theme-color" content="#ffffff">
<style>html{width:100%;height:99%;line-height:1.5;overflow-x:hidden;font-family:Roboto,sans-serif!important;font-size:100%}@media only screen and (max-width: 56.25em){html{font-size:90%}}@media only screen and (max-width: 37.5em){html{font-size:80%}}body{box-sizing:border-box;height:100%;margin:0;overflow:hidden}*{margin:0;padding:0}@font-face{font-family:Roboto;src:url(Roboto-Thin.f7a95c9c5999532c.woff2) format("woff2"),url(Roboto-Thin.c13c157cb81e8ebb.woff) format("woff");font-weight:100;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-ThinItalic.b0e084abf689f393.woff2) format("woff2"),url(Roboto-ThinItalic.1111028df6cea564.woff) format("woff");font-weight:100;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Light.0e01b6cd13b3857f.woff2) format("woff2"),url(Roboto-Light.603ca9a537b88428.woff) format("woff");font-weight:300;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-LightItalic.232ef4b20215f720.woff2) format("woff2"),url(Roboto-LightItalic.1b5e142f787151c8.woff) format("woff");font-weight:300;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Regular.475ba9e4e2d63456.woff2) format("woff2"),url(Roboto-Regular.bcefbfee882bc1cb.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-RegularItalic.e3a9ebdaac06bbc4.woff2) format("woff2"),url(Roboto-RegularItalic.0668fae6af0cf8c2.woff) format("woff");font-weight:400;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Medium.457532032ceb0168.woff2) format("woff2"),url(Roboto-Medium.6e1ae5f0b324a0aa.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-MediumItalic.872f7060602d55d2.woff2) format("woff2"),url(Roboto-MediumItalic.e06fb533801cbb08.woff) format("woff");font-weight:500;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Bold.447291a88c067396.woff2) format("woff2"),url(Roboto-Bold.fc482e6133cf5e26.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BoldItalic.1b15168ef6fa4e16.woff2) format("woff2"),url(Roboto-BoldItalic.e26ba339b06f09f7.woff) format("woff");font-weight:700;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Black.2eaa390d458c877d.woff2) format("woff2"),url(Roboto-Black.b25f67ad8583da68.woff) format("woff");font-weight:900;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BlackItalic.7dc03ee444552bc5.woff2) format("woff2"),url(Roboto-BlackItalic.c8dc642467cb3099.woff) format("woff");font-weight:900;font-style:italic}</style><link rel="stylesheet" href="styles.69f6c7558eabf011.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.69f6c7558eabf011.css"></noscript></head>
<style>html{width:100%;height:99%;line-height:1.5;overflow-x:hidden;font-family:Roboto,sans-serif!important;font-size:100%}@media only screen and (max-width: 56.25em){html{font-size:90%}}@media only screen and (max-width: 37.5em){html{font-size:80%}}body{box-sizing:border-box;height:100%;margin:0;overflow:hidden}*{margin:0;padding:0}@font-face{font-family:Roboto;src:url(Roboto-Thin.f7a95c9c5999532c.woff2) format("woff2"),url(Roboto-Thin.c13c157cb81e8ebb.woff) format("woff");font-weight:100;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-ThinItalic.b0e084abf689f393.woff2) format("woff2"),url(Roboto-ThinItalic.1111028df6cea564.woff) format("woff");font-weight:100;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Light.0e01b6cd13b3857f.woff2) format("woff2"),url(Roboto-Light.603ca9a537b88428.woff) format("woff");font-weight:300;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-LightItalic.232ef4b20215f720.woff2) format("woff2"),url(Roboto-LightItalic.1b5e142f787151c8.woff) format("woff");font-weight:300;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Regular.475ba9e4e2d63456.woff2) format("woff2"),url(Roboto-Regular.bcefbfee882bc1cb.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-RegularItalic.e3a9ebdaac06bbc4.woff2) format("woff2"),url(Roboto-RegularItalic.0668fae6af0cf8c2.woff) format("woff");font-weight:400;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Medium.457532032ceb0168.woff2) format("woff2"),url(Roboto-Medium.6e1ae5f0b324a0aa.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-MediumItalic.872f7060602d55d2.woff2) format("woff2"),url(Roboto-MediumItalic.e06fb533801cbb08.woff) format("woff");font-weight:500;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Bold.447291a88c067396.woff2) format("woff2"),url(Roboto-Bold.fc482e6133cf5e26.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BoldItalic.1b15168ef6fa4e16.woff2) format("woff2"),url(Roboto-BoldItalic.e26ba339b06f09f7.woff) format("woff");font-weight:700;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Black.2eaa390d458c877d.woff2) format("woff2"),url(Roboto-Black.b25f67ad8583da68.woff) format("woff");font-weight:900;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BlackItalic.7dc03ee444552bc5.woff2) format("woff2"),url(Roboto-BlackItalic.c8dc642467cb3099.woff) format("woff");font-weight:900;font-style:italic}</style><link rel="stylesheet" href="styles.8d413010787ae754.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.8d413010787ae754.css"></noscript></head>
<body>
<rtl-app></rtl-app>
<script src="runtime.4565d399c2c0ce89.js" type="module"></script><script src="polyfills.9720483e1820202a.js" type="module"></script><script src="main.c59da552765e97fc.js" type="module"></script>
<script src="runtime.f79e748a5fe814fc.js" type="module"></script><script src="polyfills.9720483e1820202a.js" type="module"></script><script src="main.c59da552765e97fc.js" type="module"></script>
</body></html>

View File

@ -1 +1 @@
(()=>{"use strict";var e,v={},m={};function r(e){var f=m[e];if(void 0!==f)return f.exports;var t=m[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(f,t,i,o)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,i,o]=e[n],s=!0,d=0;d<t.length;d++)(!1&o||a>=o)&&Object.keys(r.O).every(b=>r.O[b](t[d]))?t.splice(d--,1):(s=!1,o<a&&(a=o));if(s){e.splice(n--,1);var u=i();void 0!==u&&(f=u)}}return f}o=o||0;for(var n=e.length;n>0&&e[n-1][2]>o;n--)e[n]=e[n-1];e[n]=[t,i,o]},r.d=(e,f)=>{for(var t in f)r.o(f,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:f[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((f,t)=>(r.f[t](e,f),f),[])),r.u=e=>e+"."+{258:"74bd2ac767e7a584",267:"8f996ec2b4b156e0",564:"34d502899be1574e",636:"0bd12e29e4623b7e"}[e]+".js",r.miniCssF=e=>{},r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),(()=>{var e={},f="RTLApp:";r.l=(t,i,o,n)=>{if(e[t])e[t].push(i);else{var a,s;if(void 0!==o)for(var d=document.getElementsByTagName("script"),u=0;u<d.length;u++){var l=d[u];if(l.getAttribute("src")==t||l.getAttribute("data-webpack")==f+o){a=l;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",f+o),a.src=r.tu(t)),e[t]=[i];var c=(g,b)=>{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(y=>y(b)),g)return g(b)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:f=>f},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={666:0};r.f.j=(i,o)=>{var n=r.o(e,i)?e[i]:void 0;if(0!==n)if(n)o.push(n[2]);else if(666!=i){var a=new Promise((l,c)=>n=e[i]=[l,c]);o.push(n[2]=a);var s=r.p+r.u(i),d=new Error;r.l(s,l=>{if(r.o(e,i)&&(0!==(n=e[i])&&(e[i]=void 0),n)){var c=l&&("load"===l.type?"missing":l.type),p=l&&l.target&&l.target.src;d.message="Loading chunk "+i+" failed.\n("+c+": "+p+")",d.name="ChunkLoadError",d.type=c,d.request=p,n[1](d)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var f=(i,o)=>{var d,u,[n,a,s]=o,l=0;if(n.some(p=>0!==e[p])){for(d in a)r.o(a,d)&&(r.m[d]=a[d]);if(s)var c=s(r)}for(i&&i(o);l<n.length;l++)r.o(e,u=n[l])&&e[u]&&e[u][0](),e[u]=0;return r.O(c)},t=self.webpackChunkRTLApp=self.webpackChunkRTLApp||[];t.forEach(f.bind(null,0)),t.push=f.bind(null,t.push.bind(t))})()})();
(()=>{"use strict";var e,v={},m={};function r(e){var f=m[e];if(void 0!==f)return f.exports;var t=m[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(f,t,i,o)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,i,o]=e[n],c=!0,l=0;l<t.length;l++)(!1&o||a>=o)&&Object.keys(r.O).every(b=>r.O[b](t[l]))?t.splice(l--,1):(c=!1,o<a&&(a=o));if(c){e.splice(n--,1);var d=i();void 0!==d&&(f=d)}}return f}o=o||0;for(var n=e.length;n>0&&e[n-1][2]>o;n--)e[n]=e[n-1];e[n]=[t,i,o]},r.d=(e,f)=>{for(var t in f)r.o(f,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:f[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((f,t)=>(r.f[t](e,f),f),[])),r.u=e=>e+"."+{258:"abee29007afd0458",267:"8f996ec2b4b156e0",564:"a9d04248f6c2fa3f",636:"ac7c25a3c29b0ebf"}[e]+".js",r.miniCssF=e=>{},r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),(()=>{var e={},f="RTLApp:";r.l=(t,i,o,n)=>{if(e[t])e[t].push(i);else{var a,c;if(void 0!==o)for(var l=document.getElementsByTagName("script"),d=0;d<l.length;d++){var u=l[d];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==f+o){a=u;break}}a||(c=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",f+o),a.src=r.tu(t)),e[t]=[i];var s=(g,b)=>{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(y=>y(b)),g)return g(b)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=s.bind(null,a.onerror),a.onload=s.bind(null,a.onload),c&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:f=>f},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={666:0};r.f.j=(i,o)=>{var n=r.o(e,i)?e[i]:void 0;if(0!==n)if(n)o.push(n[2]);else if(666!=i){var a=new Promise((u,s)=>n=e[i]=[u,s]);o.push(n[2]=a);var c=r.p+r.u(i),l=new Error;r.l(c,u=>{if(r.o(e,i)&&(0!==(n=e[i])&&(e[i]=void 0),n)){var s=u&&("load"===u.type?"missing":u.type),p=u&&u.target&&u.target.src;l.message="Loading chunk "+i+" failed.\n("+s+": "+p+")",l.name="ChunkLoadError",l.type=s,l.request=p,n[1](l)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var f=(i,o)=>{var l,d,[n,a,c]=o,u=0;if(n.some(p=>0!==e[p])){for(l in a)r.o(a,l)&&(r.m[l]=a[l]);if(c)var s=c(r)}for(i&&i(o);u<n.length;u++)r.o(e,d=n[u])&&e[d]&&e[d][0](),e[d]=0;return r.O(s)},t=self.webpackChunkRTLApp=self.webpackChunkRTLApp||[];t.forEach(f.bind(null,0)),t.push=f.bind(null,t.push.bind(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

@ -166,6 +166,7 @@ export const postTransactions = (req, res, next) => {
options.form = JSON.stringify(options.form);
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Send Payment Options', data: options.form });
request.post(options).then((body) => {
body = body.result ? body.result : body;
if (body.payment_error) {
const err = common.handleError(body.payment_error, 'Channels', 'Send Payment Error', req.session.selectedNode);
return res.status(err.statusCode).json({ message: err.message, error: err.error });

View File

@ -42,11 +42,15 @@
<th *matHeaderCellDef mat-header-cell>
<div class="bordered-box table-actions-select btn-action" fxLayoutAlign="center center">Actions</div>
</th>
<td *matCellDef="let address" mat-cell>
<span fxLayoutAlign="end center">
<button mat-stroked-button class="btn-action-copy" color="primary" type="button" tabindex="1" rtlClipboard [payload]="lookupResult?.nodeid + '@' + address.address + ':' + address.port" (copied)="onCopyNodeURI($event)">Copy Node URI</button>
</span>
</td>
<td *matCellDef="let address" mat-cell fxLayoutAlign="end center">
<div class="bordered-box table-actions-select" fxLayoutAlign="center center">
<mat-select placeholder="Actions" tabindex="1" class="mr-0">
<mat-select-trigger></mat-select-trigger>
<mat-option (click)="onConnectNode(address)">Connect</mat-option>
<mat-option rtlClipboard [payload]="lookupResult?.nodeid + '@' + address.address + ':' + address.port" (copied)="onCopyNodeURI($event)">Copy URI</mat-option>
</mat-select>
</div>
</td>
</ng-container>
<tr *matHeaderRowDef="displayedColumns;" mat-header-row></tr>
<tr *matRowDef="let row; columns: displayedColumns;" mat-row></tr>

View File

@ -1,26 +1,36 @@
import { Component, OnInit, Input, ViewChild } from '@angular/core';
import { Component, OnInit, Input, ViewChild, OnDestroy } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { LookupNode } from '../../../../shared/models/clnModels';
import { Address, Balance, GetInfo, LookupNode } from '../../../../shared/models/clnModels';
import { NODE_FEATURES_CLN } from '../../../../shared/services/consts-enums-functions';
import { LoggerService } from '../../../../shared/services/logger.service';
import { RTLState } from '../../../../store/rtl.state';
import { openAlert } from '../../../../store/rtl.actions';
import { CLNConnectPeerComponent } from '../../../peers-channels/connect-peer/connect-peer.component';
import { nodeInfoAndBalance } from '../../../store/cln.selector';
@Component({
selector: 'rtl-cln-node-lookup',
templateUrl: './node-lookup.component.html',
styleUrls: ['./node-lookup.component.scss']
})
export class CLNNodeLookupComponent implements OnInit {
export class CLNNodeLookupComponent implements OnInit, OnDestroy {
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
@Input() lookupResult: LookupNode;
public featureDescriptions: string[] = [];
public addresses: any = new MatTableDataSource([]);
public displayedColumns = ['type', 'address', 'port', 'actions'];
public information: GetInfo = {};
public availableBalance = 0;
private unSubs: Array<Subject<void>> = [new Subject()];
constructor(private logger: LoggerService, private snackBar: MatSnackBar) { }
constructor(private logger: LoggerService, private snackBar: MatSnackBar, private store: Store<RTLState>) { }
ngOnInit() {
this.addresses = this.lookupResult && this.lookupResult.addresses ? new MatTableDataSource<any>([...this.lookupResult.addresses]) : new MatTableDataSource([]);
@ -35,6 +45,22 @@ export class CLNNodeLookupComponent implements OnInit {
}
});
}
this.store.select(nodeInfoAndBalance).pipe(takeUntil(this.unSubs[0])).
subscribe((infoBalSelector: { information: GetInfo, balance: Balance }) => {
this.information = infoBalSelector.information;
this.availableBalance = infoBalSelector.balance.totalBalance || 0;
});
}
onConnectNode(address: Address) {
this.store.dispatch(openAlert({
payload: {
data: {
message: { peer: {id: this.lookupResult.nodeid + '@' + address.address + ':' + address.port}, information: this.information, balance: this.availableBalance },
component: CLNConnectPeerComponent
}
}
}));
}
onCopyNodeURI(payload: string) {
@ -42,4 +68,11 @@ export class CLNNodeLookupComponent implements OnInit {
this.logger.info('Copied Text: ' + payload);
}
ngOnDestroy() {
this.unSubs.forEach((completeSub) => {
completeSub.next(<any>null);
completeSub.complete();
});
}
}

View File

@ -41,11 +41,15 @@
<th *matHeaderCellDef mat-header-cell>
<div class="bordered-box table-actions-select btn-action" fxLayoutAlign="center center">Actions</div>
</th>
<td *matCellDef="let address" mat-cell>
<span fxLayoutAlign="end center">
<button mat-stroked-button class="btn-action-copy" color="primary" type="button" tabindex="1" rtlClipboard [payload]="lookupResult?.nodeId + '@' + address" (copied)="onCopyNodeURI($event)">Copy Node URI</button>
</span>
</td>
<td *matCellDef="let address" mat-cell fxLayoutAlign="end center">
<div class="bordered-box table-actions-select" fxLayoutAlign="center center">
<mat-select placeholder="Actions" tabindex="1" class="mr-0">
<mat-select-trigger></mat-select-trigger>
<mat-option (click)="onConnectNode(address)">Connect</mat-option>
<mat-option rtlClipboard [payload]="lookupResult?.nodeId + '@' + address" (copied)="onCopyNodeURI($event)">Copy URI</mat-option>
</mat-select>
</div>
</td>
</ng-container>
<tr *matHeaderRowDef="displayedColumns;" mat-header-row></tr>
<tr *matRowDef="let row; columns: displayedColumns;" mat-row></tr>

View File

@ -1,11 +1,20 @@
import { Component, OnInit, Input, ViewChild } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { LookupNode } from '../../../../shared/models/eclModels';
import { RTLState } from '../../../../store/rtl.state';
import { GetInfo, LookupNode, OnChainBalance } from '../../../../shared/models/eclModels';
import { NodeFeaturesECL } from '../../../../shared/services/consts-enums-functions';
import { LoggerService } from '../../../../shared/services/logger.service';
import { ECLConnectPeerComponent } from '../../../peers-channels/connect-peer/connect-peer.component';
import { eclNodeInformation, onchainBalance } from '../../../store/ecl.selector';
import { ApiCallStatusPayload } from '../../../../shared/models/apiCallsPayload';
import { openAlert } from '../../../../store/rtl.actions';
@Component({
selector: 'rtl-ecl-node-lookup',
@ -19,14 +28,42 @@ export class ECLNodeLookupComponent implements OnInit {
public addresses: any = new MatTableDataSource([]);
public displayedColumns = ['address', 'actions'];
public nodeFeaturesEnum = NodeFeaturesECL;
public information: GetInfo = {};
public availableBalance = 0;
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private snackBar: MatSnackBar) { }
constructor(private logger: LoggerService, private snackBar: MatSnackBar, private store: Store<RTLState>) { }
ngOnInit() {
this.addresses = this.lookupResult.addresses ? new MatTableDataSource<any>([...this.lookupResult.addresses]) : new MatTableDataSource([]);
this.addresses.data = 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);
this.store.select(eclNodeInformation).pipe(takeUntil(this.unSubs[0])).
subscribe((nodeInfo: any) => {
this.information = nodeInfo;
});
this.store.select(onchainBalance).pipe(takeUntil(this.unSubs[1])).
subscribe((oCBalanceSelector: { onchainBalance: OnChainBalance, apiCallStatus: ApiCallStatusPayload }) => {
this.availableBalance = oCBalanceSelector.onchainBalance.total || 0;
});
}
onConnectNode(address: string) {
this.store.dispatch(openAlert({
payload: {
data: {
message: {
peer: this.lookupResult.nodeId ? {nodeId: this.lookupResult.nodeId, address: address } : null,
information: this.information,
balance: this.availableBalance
},
component: ECLConnectPeerComponent
}
}
}));
}
onCopyNodeURI(payload: string) {
@ -34,4 +71,11 @@ export class ECLNodeLookupComponent implements OnInit {
this.logger.info('Copied Text: ' + payload);
}
ngOnDestroy() {
this.unSubs.forEach((completeSub) => {
completeSub.next(<any>null);
completeSub.complete();
});
}
}

View File

@ -49,11 +49,15 @@
<th *matHeaderCellDef mat-header-cell>
<div class="bordered-box table-actions-select btn-action" fxLayoutAlign="center center">Actions</div>
</th>
<td *matCellDef="let address" mat-cell>
<span fxLayoutAlign="end center">
<button mat-stroked-button class="btn-action-copy" color="primary" type="button" tabindex="1" rtlClipboard [payload]="lookupResult.node.pub_key + '@' + address.addr" (copied)="onCopyNodeURI($event)">Copy Node URI</button>
</span>
</td>
<td *matCellDef="let address" mat-cell fxLayoutAlign="end center">
<div class="bordered-box table-actions-select" fxLayoutAlign="center center">
<mat-select placeholder="Actions" tabindex="1" class="mr-0">
<mat-select-trigger></mat-select-trigger>
<mat-option (click)="onConnectNode(address)">Connect</mat-option>
<mat-option rtlClipboard [payload]="lookupResult.node.pub_key + '@' + address.addr" (copied)="onCopyNodeURI($event)">Copy URI</mat-option>
</mat-select>
</div>
</td>
</ng-container>
<tr *matHeaderRowDef="displayedColumns;" mat-header-row></tr>
<tr *matRowDef="let row; columns: displayedColumns;" mat-row></tr>

View File

@ -1,26 +1,64 @@
import { Component, Input } from '@angular/core';
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { MatSnackBar } from '@angular/material/snack-bar';
import { GraphNode } from '../../../../shared/models/lndModels';
import { RTLState } from '../../../../store/rtl.state';
import { BlockchainBalance, GetInfo, GraphNode, NodeAddress } from '../../../../shared/models/lndModels';
import { NodeFeaturesLND } from '../../../../shared/services/consts-enums-functions';
import { LoggerService } from '../../../../shared/services/logger.service';
import { openAlert } from '../../../../store/rtl.actions';
import { ConnectPeerComponent } from '../../../peers-channels/connect-peer/connect-peer.component';
import { blockchainBalance, lndNodeInformation } from '../../../store/lnd.selector';
import { ApiCallStatusPayload } from '../../../../shared/models/apiCallsPayload';
@Component({
selector: 'rtl-node-lookup',
templateUrl: './node-lookup.component.html',
styleUrls: ['./node-lookup.component.scss']
})
export class NodeLookupComponent {
export class NodeLookupComponent implements OnInit, OnDestroy {
@Input() lookupResult: GraphNode;
public nodeFeaturesEnum = NodeFeaturesLND;
public displayedColumns = ['network', 'addr', 'actions'];
public information: GetInfo = {};
public availableBalance = 0;
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private snackBar: MatSnackBar) { }
constructor(private logger: LoggerService, private snackBar: MatSnackBar, private store: Store<RTLState>) { }
ngOnInit() {
this.store.select(lndNodeInformation).pipe(takeUntil(this.unSubs[0])).subscribe((nodeInfo: GetInfo) => { this.information = nodeInfo; });
this.store.select(blockchainBalance).pipe(takeUntil(this.unSubs[1])).
subscribe((bcBalanceSelector: { blockchainBalance: BlockchainBalance, apiCallStatus: ApiCallStatusPayload }) => {
this.availableBalance = bcBalanceSelector.blockchainBalance.total_balance || 0;
});
}
onCopyNodeURI(payload: string) {
this.snackBar.open('Node URI copied.');
this.logger.info('Copied Text: ' + payload);
}
onConnectNode(address: NodeAddress) {
console.warn(address.addr);
this.store.dispatch(openAlert({
payload: {
data: {
message: { peer: { pub_key: this.lookupResult.node?.pub_key, address: address }, information: this.information, balance: this.availableBalance },
component: ConnectPeerComponent
}
}
}));
}
ngOnDestroy() {
this.unSubs.forEach((completeSub) => {
completeSub.next(<any>null);
completeSub.complete();
});
}
}

View File

@ -50,9 +50,10 @@ export class ConnectPeerComponent implements OnInit, OnDestroy {
ngOnInit() {
this.totalBalance = this.data.message?.balance || 0;
const pAddr = this.data.message?.peer?.pub_key ? (this.data.message?.peer?.pub_key + (this.data.message?.peer?.address ? ('@' + this.data.message?.peer?.address) : '')) : '';
this.peerFormGroup = this.formBuilder.group({
hiddenAddress: ['', [Validators.required]],
peerAddress: ['', [Validators.required]]
peerAddress: [pAddr, [Validators.required]]
});
this.channelFormGroup = this.formBuilder.group({
fundingAmount: ['', [Validators.required, Validators.min(1), Validators.max(this.totalBalance)]],

View File

@ -9,6 +9,8 @@ $red-background-color: #f8d7da;
$blue-color: #004085;
$blue-background-color: #cce5ff;
$grey-color: #CCCCCC;
$dark-background-color: #050505;
$dark-card-background-color: #121212;
$nodes-toolbar-height: 3.2rem;
$horizontal-toolbar-height: 4rem;
@ -27,4 +29,4 @@ $dot-size: 0.8rem;
$badge-size: 0.8rem;
$min-form-ctrl-height: 3rem;
$min-form-chbox-height: 4rem;
$table-actions-min-width: 7rem;
$table-actions-min-width: 8rem;

View File

@ -51,7 +51,7 @@ body {
width: $regular-sidenav-width;
height: 100%;
overflow: hidden !important;
}
}
span.page-text, .mat-mdc-slide-toggle, .material-icons.mat-icon.mat-mdc-tooltip-trigger {
min-height: $min-form-ctrl-height;

View File

@ -24,15 +24,16 @@
.mat-primary {
color: $primary-darker;
}
.mat-mdc-button-base.mat-mdc-unelevated-button.mat-primary {
color: $foreground-text;
}
.mat-mdc-option:hover:not(.mdc-list-item--disabled), .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple):not(.mdc-list-item--disabled) {
& .mdc-list-item__primary-text {
color: $primary-darker;
.mat-sidenav-container .mat-sidenav-content {
background-color: $dark-background-color;
& .mat-mdc-card.mdc-card {
background-color: $dark-card-background-color;
}
}
.sidenav.mat-drawer {
background-color: $dark-card-background-color;
}
.rtl-top-toolbar {
border-bottom: 1px solid $background-color;
padding: 0 ($gap*5) 0 ($gap*2);
@ -41,6 +42,14 @@
background-color: $primary-color;
color: $foreground-text;
}
.mat-mdc-button-base.mat-mdc-unelevated-button.mat-primary {
color: $foreground-text;
}
.mat-mdc-option:hover:not(.mdc-list-item--disabled), .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple):not(.mdc-list-item--disabled) {
& .mdc-list-item__primary-text {
color: $primary-darker;
}
}
.mdc-tab__text-label {
&.mdc-tab__text-label-active {
color: $primary-darker;
@ -49,7 +58,7 @@
}
}
& .tab-badge .mat-badge-content {
color: mat.get-color-from-palette($background, dialog);
color: $dark-card-background-color;
background: $foreground-secondary-text;
}
}
@ -120,10 +129,38 @@
& .mat-expansion-indicator::after, & .mat-expansion-panel-content, & .mat-expansion-panel-header-description {
color: $foreground-base;
}
}
.mdc-text-field:not(.mdc-text-field--disabled) .mdc-floating-label {
}
.mat-mdc-select-panel.mdc-menu-surface, .mat-mdc-menu-panel.mdc-menu-surface, .mat-expansion-panel, .mat-mdc-dialog-container.mdc-dialog,
.mat-mdc-dialog-container .mdc-dialog__container, .mat-mdc-dialog-surface.mdc-dialog__surface,
.mdc-data-table__header-cell, .mat-mdc-paginator, .mat-mdc-form-field-focus-overlay, .mdc-text-field--disabled.mdc-text-field--filled {
background-color: $dark-card-background-color;
}
.mdc-text-field:not(.mdc-text-field--disabled) .mdc-floating-label, .mdc-text-field--filled:not(.mdc-text-field--disabled) {
background-color: $dark-card-background-color;
color: $primary-darker;
}
.cdk-overlay-pane.spinner-dialog-panel .mat-mdc-dialog-surface.mdc-dialog__surface,
.cdk-overlay-pane.spinner-dialog-panel .mat-mdc-dialog-container .mdc-dialog__container,
.cdk-overlay-pane.spinner-dialog-panel .mat-mdc-dialog-container.mdc-dialog {
background-color: transparent;
}
.mat-mdc-option:hover:not(.mdc-list-item--disabled) .mdc-list-item__primary-text,
.mat-mdc-option:hover:not(.mdc-list-item--disabled) .fa-icon, .mat-mdc-option:hover:not(.mdc-list-item--disabled) .fa-icon-small,
.mat-mdc-option:focus:not(.mdc-list-item--disabled) .mdc-list-item__primary-text, .mat-mdc-option:focus:not(.mdc-list-item--disabled) .fa-icon,
.mat-mdc-option:focus:not(.mdc-list-item--disabled) .fa-icon-small, .mat-mdc-option.mat-mdc-option-active .mdc-list-item__primary-text,
.mat-mdc-option.mat-mdc-option-active .fa-icon, .mat-mdc-option.mat-mdc-option-active .fa-icon-small,
.mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple):not(.mdc-list-item--disabled) .mdc-list-item__primary-text,
.mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple):not(.mdc-list-item--disabled) .fa-icon,
.mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple):not(.mdc-list-item--disabled) .fa-icon-small,
.mat-mdc-menu-item:hover:not([disabled]) .mdc-list-item__primary-text,
.mat-mdc-menu-item:hover:not([disabled]) .fa-icon, .mat-mdc-menu-item:hover:not([disabled]) .fa-icon-small,
.mat-mdc-menu-item.cdk-program-focused:not([disabled]) .mdc-list-item__primary-text,
.mat-mdc-menu-item.cdk-program-focused:not([disabled]) .fa-icon, .mat-mdc-menu-item.cdk-program-focused:not([disabled]) .fa-icon-small,
.mat-mdc-menu-item.cdk-keyboard-focused:not([disabled]) .mdc-list-item__primary-text, .mat-mdc-menu-item.cdk-keyboard-focused:not([disabled]) .fa-icon,
.mat-mdc-menu-item.cdk-keyboard-focused:not([disabled]) .fa-icon-small, .mat-mdc-menu-item-highlighted:not([disabled]) .mdc-list-item__primary-text,
.mat-mdc-menu-item-highlighted:not([disabled]) .fa-icon, .mat-mdc-menu-item-highlighted:not([disabled]) .fa-icon-small {
color: $primary-darker !important;
}
.mdc-text-field--filled .mdc-line-ripple::after {
border-bottom-color: $primary-darker;
}
@ -185,20 +222,21 @@
background: rgba(0, 0, 0, 0.6);
}
& .cdk-global-overlay-wrapper .mat-dialog-container .spinner-container {
color: $foreground-secondary-text;
& .mat-progress-spinner circle, .mat-spinner circle {
stroke: $foreground-secondary-text;
}
color: $primary-darker;
}
& .mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,
& .mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic {
stroke: $primary-darker;
}
}
.mat-primary .mat-option.mat-selected:not(.mat-option-disabled) {
color: $primary-darker;
}
.mat-select-panel {
background-color: mat.get-color-from-palette($background, dialog);
background-color: $dark-card-background-color;
}
.mat-tree {
background: mat.get-color-from-palette($background, dialog);
background: $dark-card-background-color;
}
h4 {
color: $primary-darker;
@ -234,10 +272,10 @@
background-color: $primary-color !important;
}
.mat-stepper-vertical {
background-color: mat.get-color-from-palette($background, dialog);
background-color: $dark-card-background-color;
}
.spinner-container h2 {
color: $primary-color;
color: $primary-darker;
}
table.mat-mdc-table {
& thead tr th {