Merge pull request #1222 from Ride-The-Lightning/connect-node-on-lookup
Fix: Dark theme, lnd payment message, node lookup connect, Issues 121…pull/1223/head
commit
fed5cd9d38
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
@ -0,0 +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],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
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue