Alert and confirmation incomplete

Alert and confirmation incomplete
pull/260/head
Shahana Farooqui 5 years ago
parent 70c113f161
commit ad35c44e12

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

@ -12,5 +12,5 @@
<link rel="stylesheet" href="styles.aef37d250eb6fe1fc81f.css"></head>
<body>
<rtl-app></rtl-app>
<script src="runtime.6de72bb8034866ce176f.js"></script><script src="polyfills-es5.92f4069201c83f4833ef.js" nomodule></script><script src="polyfills.5ddcccdb990eb395f306.js"></script><script src="main.c8e54865e9aba2fa4476.js"></script></body>
<script src="runtime.c3f23fdc26a5e4a150f7.js"></script><script src="polyfills-es5.92f4069201c83f4833ef.js" nomodule></script><script src="polyfills.5ddcccdb990eb395f306.js"></script><script src="main.f26385c501ba6a776271.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

@ -1 +1 @@
!function(e){function r(r){for(var n,a,i=r[0],c=r[1],f=r[2],p=0,s=[];p<i.length;p++)o[a=i[p]]&&s.push(o[a][0]),o[a]=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,i=1;i<t.length;i++)0!==o[t[i]]&&(n=!1);n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={0:0},u=[];function a(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,a),t.l=!0,t.exports}a.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,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({}[e]||e)+"."+{1:"50859d501eab13ab41b8",6:"2c4a41212dd765eb8550",7:"bbafcefc9d52c1d4e8df"}[e]+".js"}(e);var c=new Error;u=function(r){i.onerror=i.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:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,(function(r){return e[r]}).bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var f=0;f<i.length;f++)r(i[f]);var l=c;t()}([]);
!function(e){function r(r){for(var n,a,i=r[0],c=r[1],f=r[2],p=0,s=[];p<i.length;p++)o[a=i[p]]&&s.push(o[a][0]),o[a]=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,i=1;i<t.length;i++)0!==o[t[i]]&&(n=!1);n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={0:0},u=[];function a(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,a),t.l=!0,t.exports}a.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,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({}[e]||e)+"."+{1:"50859d501eab13ab41b8",6:"94d16dc6ed641f0bae08",7:"adcdf40dea4654bb36af"}[e]+".js"}(e);var c=new Error;u=function(r){i.onerror=i.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:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,(function(r){return e[r]}).bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var f=0;f<i.length;f++)r(i[f]);var l=c;t()}([]);

@ -15,6 +15,7 @@ import { RTLConfiguration, Settings, LightningNode, GetInfoRoot } from './shared
import * as RTLActions from './store/rtl.actions';
import * as fromRTLReducer from './store/rtl.reducers';
import { AlertTypeEnum } from './shared/services/consts-enums-functions';
@Component({
selector: 'rtl-app',
@ -81,11 +82,12 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
this.userIdle.onTimerStart().pipe(takeUntil(this.unsubs[2])).subscribe(count => {});
this.userIdle.onTimeout().pipe(takeUntil(this.unsubs[3])).subscribe(() => {
if (this.sessionService.getItem('token')) {
this.logger.warn('Time limit exceeded for session inactivity! Logging out!');
this.store.dispatch(new RTLActions.OpenAlert({config: { width: '75%', data: {
type: 'WARN',
titleMessage: 'Time limit exceeded for session inactivity! Logging out!'
}}}));
this.logger.warn('Time limit exceeded for session inactivity.');
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.WARNING,
alertTitle: 'Logging out',
titleMessage: 'Time limit exceeded for session inactivity.'
}}));
this.store.dispatch(new RTLActions.Signout());
this.userIdle.resetTimer();
}

@ -13,6 +13,7 @@ import { CLEffects } from '../store/cl.effects';
import { RTLEffects } from '../../store/rtl.effects';
import * as RTLActions from '../../store/rtl.actions';
import * as fromRTLReducer from '../../store/rtl.reducers';
import { AlertTypeEnum } from '../../shared/services/consts-enums-functions';
@Component({
selector: 'rtl-cl-channels',
@ -119,7 +120,7 @@ export class CLChannelsComponent implements OnInit, OnDestroy {
const titleMsg = 'Updated Values for ALL Channels';
const confirmationMsg = {};
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data: {
type: 'CONFIRM', titleMessage: titleMsg, noBtnText: 'Cancel', yesBtnText: 'Update', message: JSON.stringify(confirmationMsg), flgShowInput: true, getInputs: [
type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Channels Update', titleMessage: titleMsg, noBtnText: 'Cancel', yesBtnText: 'Update', message: JSON.stringify(confirmationMsg), flgShowInput: true, getInputs: [
{placeholder: 'Base Fee msat', inputType: 'number', inputValue: 1000},
{placeholder: 'Fee Rate mili msat', inputType: 'number', inputValue: 1, min: 1}
]
@ -154,7 +155,7 @@ export class CLChannelsComponent implements OnInit, OnDestroy {
const titleMsg = 'Updated Values for Channel: ' + channelToUpdate.channel_id;
const confirmationMsg = {};
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data: {
type: 'CONFIRM', titleMessage: titleMsg, noBtnText: 'Cancel', yesBtnText: 'Update', message: JSON.stringify(confirmationMsg), flgShowInput: true, getInputs: [
type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Channel Update', titleMessage: titleMsg, noBtnText: 'Cancel', yesBtnText: 'Update', message: JSON.stringify(confirmationMsg), flgShowInput: true, getInputs: [
{placeholder: 'Base Fee msat', inputType: 'number', inputValue: (this.myChanPolicy.fee_base_msat === '') ? 0 : this.myChanPolicy.fee_base_msat},
{placeholder: 'Fee Rate mili msat', inputType: 'number', inputValue: this.myChanPolicy.fee_rate_milli_msat, min: 1}
]
@ -179,13 +180,14 @@ export class CLChannelsComponent implements OnInit, OnDestroy {
return;
}
if (channelToClose.state === 'AWAITING_UNILATERAL') {
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '75%', data: {
type: 'WARN',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.WARNING,
alertTitle: 'Unable to Close Channel',
titleMessage: 'Channel can not be closed when it is in AWAITING UNILATERAL state.'
}}}));
}}));
} else {
this.store.dispatch(new RTLActions.OpenConfirmation({
width: '70%', data: { type: 'CONFIRM', titleMessage: 'Closing channel: ' + channelToClose.channel_id, noBtnText: 'Cancel', yesBtnText: 'Close Channel'
width: '70%', data: { type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Channel Closing', titleMessage: 'Closing channel: ' + channelToClose.channel_id, noBtnText: 'Cancel', yesBtnText: 'Close Channel'
}}));
this.rtlEffects.closeConfirm
.pipe(takeUntil(this.unsub[1]))
@ -217,10 +219,11 @@ export class CLChannelsComponent implements OnInit, OnDestroy {
const reorderedChannel = JSON.parse(JSON.stringify(selChannel, [
'channel_id', 'short_channel_id', 'id', 'alias', 'connected', 'private', 'state', 'funding_txid', 'msatoshi_to_us', 'msatoshi_total', 'their_channel_reserve_satoshis', 'our_channel_reserve_satoshis', 'spendable_msatoshi'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Channel Information',
message: JSON.stringify(reorderedChannel)
}}}));
}}));
}
loadChannelsTable(channels) {

@ -10,6 +10,7 @@ import { LoggerService } from '../../shared/services/logger.service';
import * as RTLActions from '../../store/rtl.actions';
import * as fromRTLReducer from '../../store/rtl.reducers';
import { AlertTypeEnum } from '../../shared/services/consts-enums-functions';
@Component({
selector: 'rtl-cl-forwarding-history',
@ -84,10 +85,7 @@ export class CLForwardingHistoryComponent implements OnInit, OnDestroy {
const reorderedFHEvent = JSON.parse(JSON.stringify(selFEvent, [
'status', 'received_time_str', 'resolved_time_str', 'in_channel', 'out_channel', 'in_msatoshi', 'in_msat', 'out_msatoshi', 'out_msat', 'fee', 'fee_msat', 'payment_hash'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '75%', data: {
type: 'INFO',
message: JSON.stringify(reorderedFHEvent)
}}}));
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: { type: AlertTypeEnum.INFORMATION, alertTitle: 'Forwarding History', message: JSON.stringify(reorderedFHEvent)}}));
}
loadForwardingEventsTable(forwardingEvents: ForwardingEventCL[]) {

@ -6,7 +6,7 @@ import { Store } from '@ngrx/store';
import { MatTableDataSource, MatSort } from '@angular/material';
import { SelNodeChild } from '../../shared/models/RTLconfig';
import { GetInfoCL, InvoiceCL } from '../../shared/models/clModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '../../shared/services/consts-enums-functions';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, AlertTypeEnum } from '../../shared/services/consts-enums-functions';
import { LoggerService } from '../../shared/services/logger.service';
import { newlyAddedRowAnimation } from '../../shared/animation/row-animation';
@ -103,7 +103,7 @@ export class CLInvoicesComponent implements OnInit, OnDestroy {
onDeleteExpiredInvoices() {
this.store.dispatch(new RTLActions.OpenConfirmation({
width: '70%', data: { type: 'CONFIRM', titleMessage: 'Delete Expired Invoices', noBtnText: 'Cancel', yesBtnText: 'Delete Invoices'
width: '70%', data: { type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Delete Invoices', titleMessage: 'Delete Expired Invoices', noBtnText: 'Cancel', yesBtnText: 'Delete Invoices'
}}));
this.rtlEffects.closeConfirm
.pipe(takeUntil(this.unSubs[1]))
@ -122,10 +122,11 @@ export class CLInvoicesComponent implements OnInit, OnDestroy {
const reorderedInvoice = JSON.parse(JSON.stringify(selInvoice, [
'status', 'expires_at_str', 'paid_at_str', 'pay_index', 'label', 'bolt11', 'payment_hash', 'msatoshi', 'msatoshi_received', 'description'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Invoice Information',
message: JSON.stringify(reorderedInvoice)
}}}));
}}));
}
loadInvoicesTable(invoices) {

@ -13,6 +13,7 @@ import { CLEffects } from '../store/cl.effects';
import { RTLEffects } from '../../store/rtl.effects';
import * as RTLActions from '../../store/rtl.actions';
import * as fromRTLReducer from '../../store/rtl.reducers';
import { AlertTypeEnum } from '../../shared/services/consts-enums-functions';
@Component({
selector: 'rtl-cl-on-chain',
@ -87,7 +88,7 @@ export class CLOnChainComponent implements OnInit, OnDestroy {
onSendFunds() {
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data:
{type: 'CONFIRM', message: JSON.stringify(this.transaction), noBtnText: 'Cancel', yesBtnText: 'Send'}
{type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Send Funds', message: JSON.stringify(this.transaction), noBtnText: 'Cancel', yesBtnText: 'Send'}
}));
this.rtlEffects.closeConfirm
.pipe(takeUntil(this.unsub[3]))

@ -12,6 +12,7 @@ import { LoggerService } from '../../../shared/services/logger.service';
import { CLEffects } from '../../store/cl.effects';
import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers';
import { AlertTypeEnum } from '../../../shared/services/consts-enums-functions';
@Component({
selector: 'rtl-cl-query-routes',
@ -85,7 +86,7 @@ export class CLQueryRoutesComponent implements OnInit, OnDestroy {
const reorderedRoute = JSON.parse(JSON.stringify(selRoute, [
'id', 'alias', 'channel', 'direction', 'msatoshi', 'amount_msat', 'delay'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '75%', data: { type: 'INFO', message: JSON.stringify(reorderedRoute)}}}));
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: { type: AlertTypeEnum.INFORMATION, alertTitle: 'Route Information', message: JSON.stringify(reorderedRoute)}}));
}
ngOnDestroy() {

@ -12,6 +12,7 @@ import { CLEffects } from '../../store/cl.effects';
import { RTLEffects } from '../../../store/rtl.effects';
import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers';
import { AlertTypeEnum } from '../../../shared/services/consts-enums-functions';
@Component({
selector: 'rtl-cl-payments',
@ -102,9 +103,9 @@ export class CLPaymentsComponent implements OnInit, OnDestroy {
this.flgAnimate = true;
this.newlyAddedPayment = this.paymentDecoded.payment_hash;
if (undefined === this.paymentDecoded.msatoshi || this.paymentDecoded.msatoshi === 0) {
const titleMsg = 'This is an empty invoice. Enter the amount (Sats) to pay.';
const titleMsg = 'It is an open amount invoice. Enter the amount (Sats) to pay.';
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data: {
type: 'CONFIRM', titleMessage: titleMsg, message: JSON.stringify(this.paymentDecoded), noBtnText: 'Cancel', yesBtnText: 'Send', flgShowInput: true, getInputs: [
type: AlertTypeEnum.CONFIRM, alertTitle: 'Enter Amount and Confirm Send Payment', titleMessage: titleMsg, message: JSON.stringify(this.paymentDecoded), noBtnText: 'Cancel', yesBtnText: 'Send', flgShowInput: true, getInputs: [
{placeholder: 'Amount (mSats)', inputType: 'number', inputValue: ''}
]
}}));
@ -120,7 +121,7 @@ export class CLPaymentsComponent implements OnInit, OnDestroy {
});
} else {
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data: {
type: 'CONFIRM', titleMessage: 'Send Payment', noBtnText: 'Cancel', yesBtnText: 'Send', message: JSON.stringify(this.paymentDecoded)
type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Send Payment', titleMessage: 'Send Payment', noBtnText: 'Cancel', yesBtnText: 'Send', message: JSON.stringify(this.paymentDecoded)
}}));
this.rtlEffects.closeConfirm
.pipe(take(1))
@ -160,10 +161,7 @@ export class CLPaymentsComponent implements OnInit, OnDestroy {
const reorderedPayment = JSON.parse(JSON.stringify(selPayment, [
'id', 'bolt11', 'created_at_str', 'created_at', 'destination', 'status', 'msatoshi', 'msatoshi_sent', 'payment_hash', 'payment_preimage','amount_msat', 'amount_sent_msat'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '75%', data: {
type: 'INFO',
message: JSON.stringify(reorderedPayment)
}}}));
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: { type: AlertTypeEnum.INFORMATION, alertTitle: 'Payment Information', message: JSON.stringify(reorderedPayment)}}));
}
applyFilter(selFilter: string) {

@ -2,12 +2,14 @@ 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 { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
import { MatTableDataSource, MatSort } from '@angular/material';
import { PeerCL, GetInfoCL } from '../../shared/models/clModels';
import { DialogConfig } from '../../shared/models/alertData';
import { AlertTypeEnum } from '../../shared/services/consts-enums-functions';
import { LoggerService } from '../../shared/services/logger.service';
import { newlyAddedRowAnimation } from '../../shared/animation/row-animation';
@ -106,7 +108,7 @@ export class CLPeersComponent implements OnInit, OnDestroy {
const reorderedPeer = JSON.parse(JSON.stringify(selPeer, [
'id', 'alias', 'connected', 'netaddr', 'globalfeatures', 'localfeatures'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '75%', data: { type: 'INFO', message: JSON.stringify(reorderedPeer)}}}));
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: { type: AlertTypeEnum.INFORMATION, alertTitle: 'Peer Information', message: JSON.stringify(reorderedPeer)}}));
}
resetData() {
@ -119,8 +121,7 @@ export class CLPeersComponent implements OnInit, OnDestroy {
onPeerDetach(peerToDetach: PeerCL) {
const msg = 'Detach peer: ' + peerToDetach.id;
const msg_type = 'CONFIRM';
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data: { type: msg_type, titleMessage: msg, noBtnText: 'Cancel', yesBtnText: 'Detach'}}));
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data: { type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Disconnect Peer', titleMessage: msg, noBtnText: 'Cancel', yesBtnText: 'Detach'}}));
this.rtlEffects.closeConfirm
.pipe(takeUntil(this.unSubs[3]))
.subscribe(confirmRes => {

@ -14,6 +14,7 @@ import { GetInfoCL, FeesCL, BalanceCL, LocalRemoteBalanceCL, PaymentCL, FeeRates
import * as fromRTLReducer from '../../store/rtl.reducers';
import * as RTLActions from '../../store/rtl.actions';
import { AlertTypeEnum } from '../../shared/services/consts-enums-functions';
@Injectable()
export class CLEffects implements OnDestroy {
@ -210,7 +211,7 @@ export class CLEffects implements OnDestroy {
map((postRes: any) => {
this.logger.info(postRes);
this.store.dispatch(new RTLActions.CloseSpinner());
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '70%', data: { type: 'SUCCESS', titleMessage: 'Peer Added Successfully!' }}}));
this.store.dispatch(new RTLActions.OpenAlert({ width: '70%', data: { type: AlertTypeEnum.SUCCESS, alertTitle: 'Peer Connected', titleMessage: 'Peer Added Successfully!' }}));
return {
type: RTLActions.SET_PEERS_CL,
payload: (postRes && postRes.length > 0) ? postRes : []
@ -233,7 +234,7 @@ export class CLEffects implements OnDestroy {
map((postRes: any) => {
this.logger.info(postRes);
this.store.dispatch(new RTLActions.CloseSpinner());
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '70%', data: { type: 'SUCCESS', titleMessage: 'Peer Detached Successfully!' }}}));
this.store.dispatch(new RTLActions.OpenAlert({ width: '70%', data: { type: AlertTypeEnum.SUCCESS, alertTitle: 'Peer Disconnected', titleMessage: 'Peer Disconnected Successfully!' }}));
return {
type: RTLActions.REMOVE_PEER_CL,
payload: { id: action.payload.id }
@ -302,7 +303,7 @@ export class CLEffects implements OnDestroy {
map((postRes: any) => {
this.logger.info(postRes);
this.store.dispatch(new RTLActions.CloseSpinner());
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '70%', data: { type: 'SUCCESS', titleMessage: 'Channel Updated Successfully!' }}}));
this.store.dispatch(new RTLActions.OpenAlert({ width: '70%', data: { type: AlertTypeEnum.SUCCESS, alertTitle: 'Channel Updated', titleMessage: 'Channel Updated Successfully!' }}));
return {
type: RTLActions.FETCH_CHANNELS_CL
};
@ -403,10 +404,10 @@ export class CLEffects implements OnDestroy {
if (sendRes.error) {
this.handleErrorWithAlert('ERROR', 'Send Payment Failed', this.CHILD_API_URL + environment.PAYMENTS_API, { status: sendRes.status, error: sendRes.error.message });
} else {
this.store.dispatch(new RTLActions.OpenAlert({ config: {
this.store.dispatch(new RTLActions.OpenAlert({
width: '70%',
data: { type: 'SUCCESS', titleMessage: 'Payment Sent Successfully!', message: JSON.stringify(sendRes) }
}}));
data: { type: AlertTypeEnum.SUCCESS, alertTitle: 'Payment Sent', titleMessage: 'Payment Sent Successfully!', message: JSON.stringify(sendRes) }
}));
this.store.dispatch(new RTLActions.FetchChannelsCL());
this.store.dispatch(new RTLActions.FetchBalanceCL());
this.store.dispatch(new RTLActions.FetchPaymentsCL());
@ -572,10 +573,10 @@ export class CLEffects implements OnDestroy {
map((postRes: any) => {
this.logger.info(postRes);
this.store.dispatch(new RTLActions.CloseSpinner());
this.store.dispatch(new RTLActions.OpenAlert({ config: {
this.store.dispatch(new RTLActions.OpenAlert({
width: '70%',
data: { type: 'SUCCESS', titleMessage: 'Invoices Deleted Successfully!' }
}}));
data: { type: AlertTypeEnum.SUCCESS, alertTitle: 'Invoice Deleted', titleMessage: 'Invoices Deleted Successfully!' }
}));
return {
type: RTLActions.FETCH_INVOICES_CL,
payload: { num_max_invoices: 100, reversed: true }
@ -605,10 +606,10 @@ export class CLEffects implements OnDestroy {
postRes.expires_at_str = new Date(+postRes.expires_at * 1000).toUTCString();
this.logger.info(postRes);
this.store.dispatch(new RTLActions.CloseSpinner());
this.store.dispatch(new RTLActions.OpenAlert({ config: {
this.store.dispatch(new RTLActions.OpenAlert({
width: '70%',
data: { type: 'SUCCESS', titleMessage: 'Invoice Added Successfully!', message: JSON.stringify(postRes) }
}}));
data: { type: AlertTypeEnum.SUCCESS, alertTitle: 'Invoice Created', titleMessage: 'Invoice Added Successfully!', message: JSON.stringify(postRes) }
}));
return {
type: RTLActions.FETCH_INVOICES_CL,
payload: { num_max_invoices: 100, reversed: true }
@ -659,7 +660,7 @@ export class CLEffects implements OnDestroy {
this.store.dispatch(new RTLActions.FetchBalanceCL());
return {
type: RTLActions.OPEN_ALERT,
payload: { data: { type: 'SUCCESS', titleMessage: 'Fund Sent Successfully!' } }
payload: { data: { type: AlertTypeEnum.SUCCESS, titleMessage: 'Fund Sent Successfully!' } }
};
}),
catchError((err: any) => {
@ -730,12 +731,14 @@ export class CLEffects implements OnDestroy {
this.store.dispatch(new RTLActions.Signout());
} else {
this.store.dispatch(new RTLActions.CloseSpinner());
this.store.dispatch(new RTLActions.OpenAlert({ config: {
this.store.dispatch(new RTLActions.OpenAlert({
width: '70%', data: {
type: alerType, titleMessage: alertTitle,
type: alerType,
alertTitle: alertTitle,
titleMessage: alertTitle,
message: JSON.stringify({ code: err.status, Message: err.error.error, URL: errURL })
}
}}));
}));
}
}

@ -4,7 +4,7 @@ import { takeUntil } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { AddressType } from '../../../shared/models/lndModels';
import { ADDRESS_TYPES } from '../../../shared/services/consts-enums-functions';
import { ADDRESS_TYPES, AlertTypeEnum } from '../../../shared/services/consts-enums-functions';
import { OnChainGeneratedAddressComponent } from '../../../shared/components/data-modal/on-chain-generated-address/on-chain-generated-address.component';
import { LNDEffects } from '../../store/lnd.effects';
@ -34,8 +34,13 @@ export class OnChainReceiveComponent implements OnInit, OnDestroy {
.subscribe(newAddress => {
this.newAddress = newAddress;
this.store.dispatch(new RTLActions.OpenAlert({
config: { width: '58%', data: { type: 'INFO', message: JSON.stringify({address: this.newAddress, addressType: this.selectedAddressType.addressTp})}},
component: OnChainGeneratedAddressComponent
width: '58%',
data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Generated Address',
message: JSON.stringify({address: this.newAddress, addressType: this.selectedAddressType.addressTp}),
component: OnChainGeneratedAddressComponent
}
}));
});
}

@ -7,7 +7,7 @@ import { MatSnackBar } from '@angular/material/snack-bar';
import { SelNodeChild, GetInfoRoot } from '../../../shared/models/RTLconfig';
import { GetInfo, Balance, ChannelsTransaction, AddressType } from '../../../shared/models/lndModels';
import { CURRENCY_UNITS, CurrencyUnitEnum, CURRENCY_UNIT_FORMATS } from '../../../shared/services/consts-enums-functions';
import { CURRENCY_UNITS, CurrencyUnitEnum, CURRENCY_UNIT_FORMATS, AlertTypeEnum } from '../../../shared/services/consts-enums-functions';
import { RTLConfiguration } from '../../../shared/models/RTLconfig';
import { CommonService } from '../../../shared/services/common.service';
import { LoggerService } from '../../../shared/services/logger.service';
@ -118,14 +118,14 @@ export class OnChainSendComponent implements OnInit, OnDestroy {
}
if (this.sweepAll && !+this.appConfig.sso.rtlSSO) {
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data:
{type: 'CONFIRM', titleMessage: 'Please authorize to sweep all funds with login password.',
{type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Payment', titleMessage: 'Please authorize to sweep all funds with login password.',
message: JSON.stringify(confirmationMsg), noBtnText: 'Cancel', yesBtnText: 'Authorize And Sweep All Funds',
flgShowInput: true, getInputs: [{placeholder: 'Enter Login Password', inputType: 'password', inputValue: ''}
]}
}));
} else {
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data:
{type: 'CONFIRM', message: JSON.stringify(confirmationMsg), noBtnText: 'Cancel', yesBtnText: 'Send'}
{type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Payment', message: JSON.stringify(confirmationMsg), noBtnText: 'Cancel', yesBtnText: 'Send'}
}));
}
}

@ -7,7 +7,7 @@ import { faHistory } from '@fortawesome/free-solid-svg-icons';
import { MatTableDataSource, MatSort, MatPaginator, MatPaginatorIntl } from '@angular/material';
import { Transaction } from '../../../shared/models/lndModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel } from '../../../shared/services/consts-enums-functions';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum } from '../../../shared/services/consts-enums-functions';
import { LoggerService } from '../../../shared/services/logger.service';
import { RTLEffects } from '../../../store/rtl.effects';
@ -96,10 +96,11 @@ export class OnChainTransactionHistoryComponent implements OnInit, OnDestroy {
const reorderedTransactions = JSON.parse(JSON.stringify(selTransaction, [
'dest_addresses', 'time_stamp_str', 'num_confirmations', 'total_fees', 'block_hash', 'block_height', 'tx_hash', 'amount'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Transaction Information',
message: JSON.stringify(reorderedTransactions)
}}}));
}}));
}
loadTransactionsTable(transactions) {

@ -12,6 +12,7 @@ import { LoggerService } from '../../../shared/services/logger.service';
import { LNDEffects } from '../../store/lnd.effects';
import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers';
import { AlertTypeEnum } from '../../../shared/services/consts-enums-functions';
@Component({
selector: 'rtl-query-routes',
@ -85,7 +86,7 @@ export class QueryRoutesComponent implements OnInit, OnDestroy {
const reorderedHop = JSON.parse(JSON.stringify(selHop, [
'hop_sequence', 'pubkey_alias', 'pub_key', 'chan_id', 'chan_capacity', 'expiry', 'amt_to_forward', 'amt_to_forward_msat', 'fee_msat'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '75%', data: { type: 'INFO', message: JSON.stringify(reorderedHop)}}}));
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: { type: AlertTypeEnum.INFORMATION, alertTitle: 'Route Information', message: JSON.stringify(reorderedHop)}}));
}
ngOnDestroy() {

@ -6,7 +6,7 @@ import { Store } from '@ngrx/store';
import { MatTableDataSource, MatSort } from '@angular/material';
import { Channel, Peer, GetInfo } from '../../../../shared/models/lndModels';
import { TRANS_TYPES } from '../../../../shared/services/consts-enums-functions';
import { TRANS_TYPES, AlertTypeEnum } from '../../../../shared/services/consts-enums-functions';
import { LoggerService } from '../../../../shared/services/logger.service';
import { LNDEffects } from '../../../store/lnd.effects';
@ -117,7 +117,7 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
const titleMsg = 'Updated Values for ALL Channels';
const confirmationMsg = {};
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data: {
type: 'CONFIRM', titleMessage: titleMsg, noBtnText: 'Cancel', yesBtnText: 'Update', message: JSON.stringify(confirmationMsg), flgShowInput: true, getInputs: [
type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Channels Update', titleMessage: titleMsg, noBtnText: 'Cancel', yesBtnText: 'Update', message: JSON.stringify(confirmationMsg), flgShowInput: true, getInputs: [
{placeholder: 'Base Fee msat', inputType: 'number', inputValue: 1000},
{placeholder: 'Fee Rate mili msat', inputType: 'number', inputValue: 1, min: 1},
{placeholder: 'Time Lock Delta', inputType: 'number', inputValue: 144}
@ -154,7 +154,7 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
const titleMsg = 'Updated Values for Channel Point: ' + channelToUpdate.channel_point;
const confirmationMsg = {};
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data: {
type: 'CONFIRM', titleMessage: titleMsg, noBtnText: 'Cancel', yesBtnText: 'Update', message: JSON.stringify(confirmationMsg), flgShowInput: true, getInputs: [
type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Channel Update', titleMessage: titleMsg, noBtnText: 'Cancel', yesBtnText: 'Update', message: JSON.stringify(confirmationMsg), flgShowInput: true, getInputs: [
{placeholder: 'Base Fee msat', inputType: 'number', inputValue: (this.myChanPolicy.fee_base_msat === '') ? 0 : this.myChanPolicy.fee_base_msat},
{placeholder: 'Fee Rate mili msat', inputType: 'number', inputValue: this.myChanPolicy.fee_rate_milli_msat, min: 1},
{placeholder: 'Time Lock Delta', inputType: 'number', inputValue: this.myChanPolicy.time_lock_delta}
@ -178,7 +178,7 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
onChannelClose(channelToClose: Channel) {
this.store.dispatch(new RTLActions.OpenConfirmation({
width: '70%', data: { type: 'CONFIRM', titleMessage: 'Closing channel: ' + channelToClose.chan_id, noBtnText: 'Cancel', yesBtnText: 'Close Channel'
width: '70%', data: { type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Channel Closing', titleMessage: 'Closing channel: ' + channelToClose.chan_id, noBtnText: 'Cancel', yesBtnText: 'Close Channel'
}}));
this.rtlEffects.closeConfirm
.pipe(takeUntil(this.unsub[1]))
@ -210,10 +210,11 @@ export class ChannelManageComponent implements OnInit, OnDestroy {
'active', 'remote_pubkey', 'remote_alias', 'channel_point', 'chan_id', 'capacity', 'local_balance', 'remote_balance', 'commit_fee', 'commit_weight',
'fee_per_kw', 'unsettled_balance', 'total_satoshis_sent', 'total_satoshis_received', 'num_updates', 'pending_htlcs', 'csv_delay', 'private'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Channel Information',
message: JSON.stringify(reorderedChannel)
}}}));
}}));
}
loadChannelsTable(channels) {

@ -7,7 +7,7 @@ import { Actions } from '@ngrx/effects';
import { MatTableDataSource, MatSort, MatPaginator, MatPaginatorIntl } from '@angular/material';
import { SelNodeChild } from '../../../../../shared/models/RTLconfig';
import { Channel } from '../../../../../shared/models/lndModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel } from '../../../../../shared/services/consts-enums-functions';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum } from '../../../../../shared/services/consts-enums-functions';
import { LoggerService } from '../../../../../shared/services/logger.service';
import * as RTLActions from '../../../../../store/rtl.actions';
@ -99,10 +99,11 @@ export class ChannelBackupTableComponent implements OnInit, OnDestroy {
'active', 'remote_pubkey', 'remote_alias', 'channel_point', 'chan_id', 'capacity', 'local_balance', 'remote_balance', 'commit_fee', 'commit_weight',
'fee_per_kw', 'unsettled_balance', 'total_satoshis_sent', 'total_satoshis_received', 'num_updates', 'pending_htlcs', 'csv_delay', 'private'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'channel Information',
message: JSON.stringify(reorderedChannel)
}}}));
}}));
}
applyFilter(selFilter: string) {

@ -7,7 +7,7 @@ import { faHistory } from '@fortawesome/free-solid-svg-icons';
import { MatTableDataSource, MatSort, MatPaginator, MatPaginatorIntl } from '@angular/material';
import { ClosedChannel } from '../../../../../shared/models/lndModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel } from '../../../../../shared/services/consts-enums-functions';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum } from '../../../../../shared/services/consts-enums-functions';
import { LoggerService } from '../../../../../shared/services/logger.service';
import { RTLEffects } from '../../../../../store/rtl.effects';
@ -92,10 +92,11 @@ export class ChannelClosedTableComponent implements OnInit, OnDestroy {
})[0];
const reorderedChannel = JSON.parse(JSON.stringify(selChannel, ['close_type', 'channel_point', 'chan_id', 'closing_tx_hash', 'remote_pubkey', 'capacity',
'close_height', 'settled_balance', 'time_locked_balance'] , 2));
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Closed Channel Information',
message: JSON.stringify(reorderedChannel)
}}}));
}}));
}
loadClosedChannelsTable(closedChannels) {

@ -5,7 +5,7 @@ import { Store } from '@ngrx/store';
import { MatTableDataSource, MatSort, MatPaginator, MatPaginatorIntl } from '@angular/material';
import { Channel, GetInfo } from '../../../../../shared/models/lndModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel } from '../../../../../shared/services/consts-enums-functions';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum } from '../../../../../shared/services/consts-enums-functions';
import { LoggerService } from '../../../../../shared/services/logger.service';
import { LNDEffects } from '../../../../store/lnd.effects';
@ -87,7 +87,7 @@ export class ChannelOpenTableComponent implements OnInit, OnDestroy {
const titleMsg = 'Updated Values for ALL Channels';
const confirmationMsg = {};
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data: {
type: 'CONFIRM', titleMessage: titleMsg, noBtnText: 'Cancel', yesBtnText: 'Update', message: JSON.stringify(confirmationMsg), flgShowInput: true, getInputs: [
type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Channel Update', titleMessage: titleMsg, noBtnText: 'Cancel', yesBtnText: 'Update', message: JSON.stringify(confirmationMsg), flgShowInput: true, getInputs: [
{placeholder: 'Base Fee msat', inputType: 'number', inputValue: 1000},
{placeholder: 'Fee Rate mili msat', inputType: 'number', inputValue: 1, min: 1},
{placeholder: 'Time Lock Delta', inputType: 'number', inputValue: 144}
@ -124,7 +124,7 @@ export class ChannelOpenTableComponent implements OnInit, OnDestroy {
const titleMsg = 'Updated Values for Channel Point: ' + channelToUpdate.channel_point;
const confirmationMsg = {};
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data: {
type: 'CONFIRM', titleMessage: titleMsg, noBtnText: 'Cancel', yesBtnText: 'Update', message: JSON.stringify(confirmationMsg), flgShowInput: true, getInputs: [
type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Channel Update', titleMessage: titleMsg, noBtnText: 'Cancel', yesBtnText: 'Update', message: JSON.stringify(confirmationMsg), flgShowInput: true, getInputs: [
{placeholder: 'Base Fee msat', inputType: 'number', inputValue: (this.myChanPolicy.fee_base_msat === '') ? 0 : this.myChanPolicy.fee_base_msat},
{placeholder: 'Fee Rate mili msat', inputType: 'number', inputValue: this.myChanPolicy.fee_rate_milli_msat, min: 1},
{placeholder: 'Time Lock Delta', inputType: 'number', inputValue: this.myChanPolicy.time_lock_delta}
@ -148,7 +148,7 @@ export class ChannelOpenTableComponent implements OnInit, OnDestroy {
onChannelClose(channelToClose: Channel) {
this.store.dispatch(new RTLActions.OpenConfirmation({
width: '70%', data: { type: 'CONFIRM', titleMessage: 'Closing channel: ' + channelToClose.chan_id, noBtnText: 'Cancel', yesBtnText: 'Close Channel'
width: '70%', data: { type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Channel Closing', titleMessage: 'Closing channel: ' + channelToClose.chan_id, noBtnText: 'Cancel', yesBtnText: 'Close Channel'
}}));
this.rtlEffects.closeConfirm
.pipe(takeUntil(this.unSubs[4]))
@ -175,10 +175,11 @@ export class ChannelOpenTableComponent implements OnInit, OnDestroy {
'active', 'remote_pubkey', 'remote_alias', 'channel_point', 'chan_id', 'capacity', 'local_balance', 'remote_balance', 'commit_fee', 'commit_weight',
'fee_per_kw', 'unsettled_balance', 'total_satoshis_sent', 'total_satoshis_received', 'num_updates', 'pending_htlcs', 'csv_delay', 'private'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Channel Information',
message: JSON.stringify(reorderedChannel)
}}}));
}}));
}
loadChannelsTable(mychannels) {

@ -11,6 +11,7 @@ import { LoggerService } from '../../../../../shared/services/logger.service';
import { RTLEffects } from '../../../../../store/rtl.effects';
import * as RTLActions from '../../../../../store/rtl.actions';
import * as fromRTLReducer from '../../../../../store/rtl.reducers';
import { AlertTypeEnum } from '../../../../../shared/services/consts-enums-functions';
@Component({
selector: 'rtl-channel-pending-table',
@ -116,10 +117,11 @@ export class ChannelPendingTableComponent implements OnInit, OnDestroy {
const fcChannelObj2 = JSON.parse(JSON.stringify(selChannel.channel, ['channel_point', 'remote_balance', 'local_balance', 'remote_node_pub', 'capacity'], 2));
const reorderedChannel = {};
Object.assign(reorderedChannel, fcChannelObj1, fcChannelObj2);
this.store.dispatch(new RTLActions.OpenAlert({config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Opening Channel Information',
message: JSON.stringify(reorderedChannel)
}}}));
}}));
}
onForceClosingClick(selRow: any) {
@ -130,10 +132,11 @@ export class ChannelPendingTableComponent implements OnInit, OnDestroy {
const fcChannelObj2 = JSON.parse(JSON.stringify(selChannel.channel, ['channel_point', 'remote_balance', 'local_balance', 'remote_node_pub', 'capacity'], 2));
const reorderedChannel = {};
Object.assign(reorderedChannel, fcChannelObj1, fcChannelObj2);
this.store.dispatch(new RTLActions.OpenAlert({config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Force Closing Channel Information',
message: JSON.stringify(reorderedChannel)
}}}));
}}));
}
onClosingClick(selRow: any) {
@ -144,10 +147,11 @@ export class ChannelPendingTableComponent implements OnInit, OnDestroy {
const fcChannelObj2 = JSON.parse(JSON.stringify(selChannel.channel, ['channel_point', 'remote_balance', 'local_balance', 'remote_node_pub', 'capacity'], 2));
const reorderedChannel = {};
Object.assign(reorderedChannel, fcChannelObj1, fcChannelObj2);
this.store.dispatch(new RTLActions.OpenAlert({config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Closing Channel Information',
message: JSON.stringify(reorderedChannel)
}}}));
}}));
}
onWaitClosingClick(selRow: any) {
@ -158,10 +162,11 @@ export class ChannelPendingTableComponent implements OnInit, OnDestroy {
const fcChannelObj2 = JSON.parse(JSON.stringify(selChannel.channel, ['channel_point', 'remote_balance', 'local_balance', 'remote_node_pub', 'capacity'], 2));
const reorderedChannel = {};
Object.assign(reorderedChannel, fcChannelObj1, fcChannelObj2);
this.store.dispatch(new RTLActions.OpenAlert({config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Wait Closing Channel Information',
message: JSON.stringify(reorderedChannel)
}}}));
}}));
}
loadOpenChannelsTable(channels) {

@ -6,7 +6,7 @@ import { Store } from '@ngrx/store';
import { MatTableDataSource, MatSort, MatPaginator, MatPaginatorIntl } from '@angular/material';
import { SelNodeChild } from '../../../../../shared/models/RTLconfig';
import { Channel } from '../../../../../shared/models/lndModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel } from '../../../../../shared/services/consts-enums-functions';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum } from '../../../../../shared/services/consts-enums-functions';
import { LoggerService } from '../../../../../shared/services/logger.service';
import { LNDEffects } from '../../../../store/lnd.effects';
@ -81,10 +81,11 @@ export class ChannelRestoreTableComponent implements OnInit {
'active', 'remote_pubkey', 'remote_alias', 'channel_point', 'chan_id', 'capacity', 'local_balance', 'remote_balance', 'commit_fee', 'commit_weight',
'fee_per_kw', 'unsettled_balance', 'total_satoshis_sent', 'total_satoshis_received', 'num_updates', 'pending_htlcs', 'csv_delay', 'private'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Restored Channel Information',
message: JSON.stringify(reorderedChannel)
}}}));
}}));
}
ngOnDestroy() {

@ -9,7 +9,7 @@ import { faUsers } from '@fortawesome/free-solid-svg-icons';
import { MatTableDataSource, MatSort, MatPaginator, MatPaginatorIntl } from '@angular/material';
import { Peer, GetInfo } from '../../../shared/models/lndModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel } from '../../../shared/services/consts-enums-functions';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum } from '../../../shared/services/consts-enums-functions';
import { LoggerService } from '../../../shared/services/logger.service';
import { OpenChannelComponent } from '../../../shared/components/data-modal/open-channel/open-channel.component';
import { newlyAddedRowAnimation } from '../../../shared/animation/row-animation';
@ -140,7 +140,7 @@ export class PeersComponent implements OnInit, OnDestroy {
const reorderedPeer = JSON.parse(JSON.stringify(selPeer, [
'alias', 'pub_key', 'address', 'bytes_sent', 'bytes_recv', 'sat_sent', 'sat_recv', 'inbound', 'ping_time'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({config: { width: '75%', data: { type: 'INFO', message: JSON.stringify(reorderedPeer)}}}));
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: { type: AlertTypeEnum.INFORMATION, alertTitle: 'Peer Information', message: JSON.stringify(reorderedPeer)}}));
}
resetData() {
@ -148,13 +148,12 @@ export class PeersComponent implements OnInit, OnDestroy {
}
onOpenChannel(peerToAddChannel: Peer) {
this.store.dispatch(new RTLActions.OpenAlert({config: { width: '50%', data: { type: 'INFO', message: JSON.stringify({peer: peerToAddChannel, information: this.information, balance: this.availableBalance}), newlyAdded: false}}, component: OpenChannelComponent}));
this.store.dispatch(new RTLActions.OpenAlert({ width: '50%', data: { type: AlertTypeEnum.INFORMATION, alertTitle: 'Open Channel', message: JSON.stringify({peer: peerToAddChannel, information: this.information, balance: this.availableBalance}), newlyAdded: false, component: OpenChannelComponent}}));
}
onPeerDetach(peerToDetach: Peer) {
const msg = 'Detach peer: ' + peerToDetach.pub_key;
const msg_type = 'CONFIRM';
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data: { type: msg_type, titleMessage: msg, noBtnText: 'Cancel', yesBtnText: 'Detach'}}));
const msg = 'Disconnect peer: ' + peerToDetach.pub_key;
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data: { type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Peer Disconnect', titleMessage: msg, noBtnText: 'Cancel', yesBtnText: 'Detach'}}));
this.rtlEffects.closeConfirm
.pipe(takeUntil(this.unSubs[3]))
.subscribe(confirmRes => {

@ -11,6 +11,7 @@ import { CommonService } from '../../shared/services/common.service';
import * as RTLActions from '../../store/rtl.actions';
import * as fromRTLReducer from '../../store/rtl.reducers';
import { AlertTypeEnum } from '../../shared/services/consts-enums-functions';
@Component({
selector: 'rtl-routing-peers',
@ -96,10 +97,11 @@ export class RoutingPeersComponent implements OnInit, OnDestroy {
});
}
const reorderedRoutingPeer = JSON.parse(JSON.stringify(selRPeer, ['chan_id', 'alias', 'events', 'total_amount'] , 2));
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Route Information',
message: JSON.stringify(reorderedRoutingPeer)
}}}));
}}));
}
loadRoutingPeersTable(forwardingEvents: ForwardingEvent[]) {

@ -15,7 +15,7 @@ import { SessionService } from '../../shared/services/session.service';
import { GetInfo, GetInfoChain, Fees, Balance, NetworkInfo, Payment, GraphNode, Transaction, SwitchReq, ListInvoices } from '../../shared/models/lndModels';
import { InvoiceInformationComponent } from '../../shared/components/data-modal/invoice-information/invoice-information.component';
import { OpenChannelComponent } from '../../shared/components/data-modal/open-channel/open-channel.component';
import { CurrencyUnitEnum } from '../../shared/services/consts-enums-functions';
import { CurrencyUnitEnum, AlertTypeEnum } from '../../shared/services/consts-enums-functions';
import * as RTLActions from '../../store/rtl.actions';
import * as fromRTLReducer from '../../store/rtl.reducers';
@ -131,9 +131,9 @@ export class LNDEffects implements OnDestroy {
this.store.dispatch(new RTLActions.SetPeers((postRes && postRes.length > 0) ? postRes : []));
return {
type: RTLActions.OPEN_ALERT,
payload: {config: { width: '50%', data: { type: 'INFO', message: JSON.stringify({peer: postRes[0], information: lndData.information, balance: lndData.blockchainBalance.total_balance || 0}), newlyAdded: true}},
payload: { width: '50%', data: { type: AlertTypeEnum.INFORMATION, alertTitle: 'Peer Connected', message: JSON.stringify({peer: postRes[0], information: lndData.information, balance: lndData.blockchainBalance.total_balance || 0}), newlyAdded: true}},
component: OpenChannelComponent
}};
};
}),
catchError((err: any) => {
this.handleErrorWithAlert('ERROR', 'Add Peer Failed', this.CHILD_API_URL + environment.PEERS_API, err);
@ -152,7 +152,7 @@ export class LNDEffects implements OnDestroy {
map((postRes: any) => {
this.logger.info(postRes);
this.store.dispatch(new RTLActions.CloseSpinner());
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '70%', data: { type: 'SUCCESS', titleMessage: 'Peer Detached Successfully!' }}}));
this.store.dispatch(new RTLActions.OpenAlert({ width: '70%', data: { type: AlertTypeEnum.SUCCESS, alertTitle: 'Peer Disconnected', titleMessage: 'Peer Disconnected Successfully!' }}));
return {
type: RTLActions.REMOVE_PEER,
payload: { pubkey: action.payload.pubkey }
@ -185,9 +185,8 @@ export class LNDEffects implements OnDestroy {
this.logger.info(postRes);
this.store.dispatch(new RTLActions.CloseSpinner());
this.store.dispatch(new RTLActions.OpenAlert({
config: { width: '58%', data: { type: 'INFO', message: JSON.stringify(postRes), newlyAdded: true}},
component: InvoiceInformationComponent
}));
width: '58%', data: { type: AlertTypeEnum.INFORMATION, alertTitle: 'Invoice Created', message: JSON.stringify(postRes), newlyAdded: true, component: InvoiceInformationComponent
}}));
return {
type: RTLActions.FETCH_INVOICES,
payload: { num_max_invoices: action.payload.pageSize, reversed: true }
@ -239,7 +238,7 @@ export class LNDEffects implements OnDestroy {
map((postRes: any) => {
this.logger.info(postRes);
this.store.dispatch(new RTLActions.CloseSpinner());
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '70%', data: { type: 'SUCCESS', titleMessage: 'Channel Updated Successfully!' }}}));
this.store.dispatch(new RTLActions.OpenAlert({ width: '70%', data: { type: AlertTypeEnum.SUCCESS, alertTitle: 'Channel Updated', titleMessage: 'Channel Updated Successfully!' }}));
return {
type: RTLActions.FETCH_CHANNELS,
payload: { routeParam: 'all', channelStatus: '' }
@ -611,10 +610,10 @@ export class LNDEffects implements OnDestroy {
msg['Total Fee (' + ((undefined === store.nodeData.smaller_currency_unit) ? CurrencyUnitEnum.SATS : store.nodeData.smaller_currency_unit) + ')'] =
(sendRes.payment_route.total_fees_msat / 1000);
Object.assign(msg, confirmationMsg);
this.store.dispatch(new RTLActions.OpenAlert({ config: {
this.store.dispatch(new RTLActions.OpenAlert({
width: '70%',
data: { type: 'SUCCESS', titleMessage: 'Payment Sent Successfully!', message: JSON.stringify(msg) }
}}));
data: { type: AlertTypeEnum.SUCCESS, alertTitle: 'Payment Sent', titleMessage: 'Payment Sent Successfully!', message: JSON.stringify(msg) }
}));
this.store.dispatch(new RTLActions.FetchChannels({ routeParam: 'all' }));
this.store.dispatch(new RTLActions.FetchBalance('channels'));
this.store.dispatch(new RTLActions.FetchPayments());
@ -705,7 +704,7 @@ export class LNDEffects implements OnDestroy {
this.store.dispatch(new RTLActions.FetchBalance('blockchain'));
return {
type: RTLActions.OPEN_ALERT,
payload: { data: { type: 'SUCCESS', titleMessage: 'Fund Sent Successfully!' } }
payload: { data: { type: AlertTypeEnum.SUCCESS, titleMessage: 'Fund Sent Successfully!' } }
};
}),
catchError((err: any) => {
@ -1066,12 +1065,12 @@ export class LNDEffects implements OnDestroy {
this.store.dispatch(new RTLActions.Signout());
} else {
this.store.dispatch(new RTLActions.CloseSpinner());
this.store.dispatch(new RTLActions.OpenAlert({config: {
this.store.dispatch(new RTLActions.OpenAlert({
width: '70%', data: {
type: alertType, titleMessage: alertTitle,
type: alertType, alertTitle: alertType, titleMessage: alertTitle,
message: JSON.stringify({ code: err.status, Message: err.error.error, URL: errURL })
}
}}));
}));
}
}

@ -10,6 +10,7 @@ import { LoggerService } from '../../shared/services/logger.service';
import * as RTLActions from '../../store/rtl.actions';
import * as fromRTLReducer from '../../store/rtl.reducers';
import { AlertTypeEnum } from '../../shared/services/consts-enums-functions';
@Component({
selector: 'rtl-forwarding-history',
@ -82,10 +83,11 @@ export class ForwardingHistoryComponent implements OnInit, OnDestroy {
return (fhEvent.chan_id_in === selRow.chan_id_in && fhEvent.timestamp === selRow.timestamp);
})[0];
const reorderedFHEvent = JSON.parse(JSON.stringify(selFEvent, ['timestamp_str', 'chan_id_in', 'alias_in', 'chan_id_out', 'alias_out', 'amt_out', 'amt_in', 'fee'] , 2));
this.store.dispatch(new RTLActions.OpenAlert({ config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Event Information',
message: JSON.stringify(reorderedFHEvent)
}}}));
}}));
}
loadForwardingEventsTable(forwardingEvents: ForwardingEvent[]) {

@ -6,7 +6,7 @@ import { Store } from '@ngrx/store';
import { faHistory } from '@fortawesome/free-solid-svg-icons';
import { MatTableDataSource, MatSort, MatPaginatorIntl } from '@angular/material';
import { TimeUnitEnum, CurrencyUnitEnum, TIME_UNITS, CURRENCY_UNIT_FORMATS, PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel } from '../../../shared/services/consts-enums-functions';
import { TimeUnitEnum, CurrencyUnitEnum, TIME_UNITS, CURRENCY_UNIT_FORMATS, PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum } from '../../../shared/services/consts-enums-functions';
import { SelNodeChild } from '../../../shared/models/RTLconfig';
import { GetInfo, Invoice } from '../../../shared/models/lndModels';
import { LoggerService } from '../../../shared/services/logger.service';
@ -124,10 +124,14 @@ export class LightningInvoicesComponent implements OnInit, OnDestroy {
'description_hash', 'expiry', 'fallback_addr', 'cltv_expiry', 'route_hints', 'private', 'add_index', 'settle_index',
'amt_paid', 'amt_paid_sat', 'amt_paid_msat'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({
config: { width: '58%', data: { type: 'INFO', message: JSON.stringify(reorderedInvoice), newlyAdded: false}},
component: InvoiceInformationComponent
}));
this.store.dispatch(new RTLActions.OpenAlert({ width: '58%',
data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Invoice Information',
message: JSON.stringify(reorderedInvoice),
newlyAdded: false,
component: InvoiceInformationComponent
}}));
}
loadInvoicesTable(invoices) {

@ -6,7 +6,7 @@ import { faHistory } from '@fortawesome/free-solid-svg-icons';
import { MatTableDataSource, MatSort, MatPaginator, MatPaginatorIntl } from '@angular/material';
import { GetInfo, Payment, PayRequest } from '../../../shared/models/lndModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel } from '../../../shared/services/consts-enums-functions';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum } from '../../../shared/services/consts-enums-functions';
import { LoggerService } from '../../../shared/services/logger.service';
import { newlyAddedRowAnimation } from '../../../shared/animation/row-animation';
@ -116,9 +116,9 @@ export class LightningPaymentsComponent implements OnInit, OnDestroy {
this.flgAnimate = true;
this.newlyAddedPayment = this.paymentDecoded.payment_hash;
if (undefined === this.paymentDecoded.num_satoshis || this.paymentDecoded.num_satoshis === '' || this.paymentDecoded.num_satoshis === '0') {
const titleMsg = 'This is an empty invoice. Enter the amount (Sats) to pay.';
const titleMsg = 'It is an open amount invoice. Enter the amount (Sats) to pay.';
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data: {
type: 'CONFIRM', titleMessage: titleMsg, message: JSON.stringify(this.paymentDecoded), noBtnText: 'Cancel', yesBtnText: 'Send', flgShowInput: true, getInputs: [
type: AlertTypeEnum.CONFIRM, alertTitle: 'Enter Amount and Confirm Send Payment', titleMessage: titleMsg, message: JSON.stringify(this.paymentDecoded), noBtnText: 'Cancel', yesBtnText: 'Send', flgShowInput: true, getInputs: [
{placeholder: 'Amount (Sats)', inputType: 'number', inputValue: ''}
]
}}));
@ -134,7 +134,7 @@ export class LightningPaymentsComponent implements OnInit, OnDestroy {
});
} else {
this.store.dispatch(new RTLActions.OpenConfirmation({ width: '70%', data: {
type: 'CONFIRM', titleMessage: 'Send Payment', noBtnText: 'Cancel', yesBtnText: 'Send', message: JSON.stringify(this.paymentDecoded)
type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Send Payment', titleMessage: 'Send Payment', noBtnText: 'Cancel', yesBtnText: 'Send', message: JSON.stringify(this.paymentDecoded)
}}));
this.rtlEffects.closeConfirm
.pipe(take(1))
@ -173,10 +173,11 @@ export class LightningPaymentsComponent implements OnInit, OnDestroy {
const reorderedPayment = JSON.parse(JSON.stringify(selPayment, [
'creation_date_str', 'payment_hash', 'fee', 'value_msat', 'value_sat', 'value', 'payment_preimage', 'path'
] , 2));
this.store.dispatch(new RTLActions.OpenAlert({config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: 'Payment Information',
message: JSON.stringify(reorderedPayment)
}}}));
}}));
}
applyFilter(selFilter: string) {

@ -5,7 +5,7 @@ import { Store } from '@ngrx/store';
import { faTools } from '@fortawesome/free-solid-svg-icons';
import { CURRENCY_UNITS } from '../../services/consts-enums-functions';
import { CURRENCY_UNITS, AlertTypeEnum } from '../../services/consts-enums-functions';
import { LightningNode, Settings, RTLConfiguration, GetInfoRoot } from '../../models/RTLconfig';
import { LoggerService } from '../../services/logger.service';
import { CommonService } from '../../services/common.service';
@ -118,10 +118,11 @@ export class AppSettingsComponent implements OnInit, OnDestroy {
let defaultNodeIndex = (this.previousDefaultNode !== this.appConfig.defaultNodeIndex) ? this.appConfig.defaultNodeIndex : null;
this.logger.info(this.selNode.settings);
if (!updatedSettings && !defaultNodeIndex) {
this.store.dispatch(new RTLActions.OpenAlert({config: { width: '75%', data: {
type: 'INFO',
this.store.dispatch(new RTLActions.OpenAlert({ width: '75%', data: {
type: AlertTypeEnum.WARNING,
alertTitle: 'Configuration Not Updated',
titleMessage: 'Nothing has been updated to save!'
}}}));
}}));
} else {
this.store.dispatch(new RTLActions.OpenSpinner('Updating Settings...'));
this.store.dispatch(new RTLActions.SaveSettings({settings: updatedSettings, defaultNodeIndex: defaultNodeIndex}));

@ -2,12 +2,13 @@
<div fxFlex="100" class="padding-gap-large">
<mat-card-header fxLayout="row" fxLayoutAlign="space-between center" class="modal-info-header">
<div fxFlex="95" fxLayoutAlign="start start">
<span class="page-title">{{(data.titleMessage | titlecase) || alertTypeEnum[data.type]}}</span>
<span class="page-title">{{data.alertTitle || alertTypeEnum[data.type]}}</span>
</div>
<button tabindex="8" fxFlex="5" fxLayoutAlign="center" class="btn-close-x p-0" (click)="onClose()" mat-button>X</button>
</mat-card-header>
<mat-card-content class="mt-5px">
<div fxLayout="column">
<p *ngIf="data.titleMessage" fxLayoutAlign="start center" class="title-message pb-1 pl-1">{{data.titleMessage | titlecase}}</p>
<div *ngIf="messageObj?.length>0">
<div *ngFor="let obj of messageObj">
<div fxLayout="column" fxFlex="100" fxFlex.gt-md="50">

@ -1,12 +1,14 @@
<div fxLayout="row">
<div class="w-100">
<mat-card-header [ngClass]="msgTypeBackground" fxLayoutAlign="end">
<h2 fxFlex="91">{{data.type}}</h2>
<mat-icon autoFocus fxFlex="3" fxLayoutAlign="end" type="button" (click)="onClose(false)" class="cursor-pointer" tabindex="1">close</mat-icon>
</mat-card-header>
<mat-card-content>
<div class="pb-2 p-2 wrap-text new-line">
<h4 *ngIf="data.titleMessage" fxLayoutAlign="start center" class="title-message pb-1 pl-1">{{data.titleMessage | titlecase}}</h4>
<div fxFlex="100" class="padding-gap-large">
<mat-card-header fxLayout="row" fxLayoutAlign="space-between center" class="modal-info-header">
<div fxFlex="95" fxLayoutAlign="start start">
<span class="page-title">{{data.alertTitle || alertTypeEnum[data.type]}}</span>
</div>
<button tabindex="8" fxFlex="5" fxLayoutAlign="center" class="btn-close-x p-0" (click)="onClose(false)" mat-button>X</button>
</mat-card-header>
<mat-card-content class="mt-5px">
<div fxLayout="column">
<p *ngIf="data.titleMessage" fxLayoutAlign="start center" class="title-message pb-1 pl-1">{{data.titleMessage | titlecase}}</p>
<div *ngIf="flgShowInput" fxLayoutAlign="start center">
<mat-form-field class="pl-2" *ngFor="let getInput of getInputs; index as i">
<input matInput [placeholder]="getInput.placeholder" name="input{{i}}" [min]="getInput.min" [type]="getInput.inputType" [(ngModel)]="getInput.inputValue" [tabindex]="i+1" required>

@ -5,6 +5,7 @@ import { faCopy } from '@fortawesome/free-solid-svg-icons';
import { LoggerService } from '../../../services/logger.service';
import { AlertData, InputData } from '../../../models/alertData';
import { AlertTypeEnum } from '../../../services/consts-enums-functions';
import * as RTLActions from '../../../../store/rtl.actions';
import * as fromRTLReducer from '../../../../store/rtl.reducers';
@ -22,7 +23,8 @@ export class ConfirmationMessageComponent implements OnInit {
public messageObj = [];
public flgCopied = false;
public flgShowInput = false;
faCopy = faCopy;
public faCopy = faCopy;
public alertTypeEnum = AlertTypeEnum;
public getInputs: Array<InputData> = [{placeholder: '', inputType: 'text', inputValue: ''}];
constructor(public dialogRef: MatDialogRef<ConfirmationMessageComponent>, @Inject(MAT_DIALOG_DATA) public data: AlertData, private logger: LoggerService,
@ -33,11 +35,7 @@ export class ConfirmationMessageComponent implements OnInit {
this.getInputs = this.data.getInputs;
this.noBtnText = (undefined !== this.data.noBtnText) ? this.data.noBtnText : 'No';
this.yesBtnText = (undefined !== this.data.yesBtnText) ? this.data.yesBtnText : 'Yes';
// INFO/WARN/ERROR/SUCCESS/CONFIRM
if (this.data.type === 'WARN') {
this.msgTypeBackground = 'bg-primary p-1';
}
// INFORMATION/WARNING/ERROR/SUCCESS/CONFIRM
if (this.data.type === 'ERROR') {
this.msgTypeBackground = 'bg-warn p-1';
this.msgTypeForeground = 'warn';

@ -6,7 +6,7 @@
<mat-card-header fxLayout="row" fxLayoutAlign="space-between center" class="modal-info-header mb-2">
<div fxFlex="95" fxLayoutAlign="start start">
<fa-icon [icon]="faReceipt" class="page-title-img mr-1"></fa-icon>
<span class="page-title">Generated Address</span>
<span class="page-title">{{data.alertTitle}}</span>
</div>
<button tabindex="2" fxFlex="5" fxLayoutAlign="center" class="btn-close-x p-0" (click)="onClose()" mat-button>X</button>
</mat-card-header>

@ -2,7 +2,7 @@
<div fxFlex="100" class="padding-gap-large">
<mat-card-header fxLayout="row" fxLayoutAlign="space-between center" class="modal-info-header">
<div fxFlex="95" fxLayoutAlign="start start">
<span class="page-title">{{newlyAdded ? 'Peer Connected' : 'Open Channel'}}</span>
<span class="page-title">{{alertTitle}}</span>
</div>
<button tabindex="8" fxFlex="5" fxLayoutAlign="center" class="btn-close-x p-0" (click)="onClose()" mat-button>X</button>
</mat-card-header>

@ -15,6 +15,7 @@ import * as fromRTLReducer from '../../../../store/rtl.reducers';
styleUrls: ['./open-channel.component.scss']
})
export class OpenChannelComponent implements OnInit {
public alertTitle: string;
public peer: Peer;
public information: GetInfo;
public totalBalance = 0;
@ -34,6 +35,7 @@ export class OpenChannelComponent implements OnInit {
this.information = JSONdata.information;
this.totalBalance = JSONdata.balance;
this.newlyAdded = this.data.newlyAdded;
this.alertTitle = this.data.alertTitle;
}
onClose() {

@ -12,6 +12,7 @@ import { RTLEffects } from '../../../../store/rtl.effects';
import * as RTLActions from '../../../../store/rtl.actions';
import * as fromRTLReducer from '../../../../store/rtl.reducers';
import { GetInfoRoot } from '../../../models/RTLconfig';
import { AlertTypeEnum } from '../../../services/consts-enums-functions';
@Component({
selector: 'rtl-horizontal-navigation',
@ -68,7 +69,7 @@ export class HorizontalNavigationComponent implements OnInit, OnDestroy {
onClick(node) {
if (node.name === 'Logout') {
this.store.dispatch(new RTLActions.OpenConfirmation({
width: '70%', data: { type: 'CONFIRM', titleMessage: 'Logout from this device?', noBtnText: 'Cancel', yesBtnText: 'Logout'
width: '70%', data: { type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Logout', titleMessage: 'Logout from this device?', noBtnText: 'Cancel', yesBtnText: 'Logout'
}}));
this.rtlEffects.closeConfirm
.pipe(takeUntil(this.unSubs[2]))

@ -20,6 +20,7 @@ import { MenuChildNode, MENU_DATA } from '../../../models/navMenu';
import { RTLEffects } from '../../../../store/rtl.effects';
import * as RTLActions from '../../../../store/rtl.actions';
import * as fromRTLReducer from '../../../../store/rtl.reducers';
import { AlertTypeEnum } from '../../../services/consts-enums-functions';
@Component({
selector: 'rtl-side-navigation',
@ -117,7 +118,7 @@ export class SideNavigationComponent implements OnInit, OnDestroy {
onClick(node: MenuChildNode) {
if (node.name === 'Logout') {
this.store.dispatch(new RTLActions.OpenConfirmation({
width: '70%', data: { type: 'CONFIRM', titleMessage: 'Logout from this device?', noBtnText: 'Cancel', yesBtnText: 'Logout'
width: '70%', data: { type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Logout', titleMessage: 'Logout from this device?', noBtnText: 'Cancel', yesBtnText: 'Logout'
}}));
this.rtlEffects.closeConfirm
.pipe(takeUntil(this.unSubs[3]))

@ -14,6 +14,7 @@ import { RTLEffects } from '../../../../store/rtl.effects';
import * as fromRTLReducer from '../../../../store/rtl.reducers';
import * as RTLActions from '../../../../store/rtl.actions';
import { faCodeBranch, faCog, faLifeRing, faEject } from '@fortawesome/free-solid-svg-icons';
import { AlertTypeEnum } from '../../../services/consts-enums-functions';
@Component({
selector: 'rtl-top-menu',
@ -78,7 +79,7 @@ export class TopMenuComponent implements OnInit, OnDestroy {
onClick() {
this.store.dispatch(new RTLActions.OpenConfirmation({
width: '70%', data: { type: 'CONFIRM', titleMessage: 'Logout from this device?', noBtnText: 'Cancel', yesBtnText: 'Logout'
width: '70%', data: { type: AlertTypeEnum.CONFIRM, alertTitle: 'Confirm Logout', titleMessage: 'Logout from this device?', noBtnText: 'Cancel', yesBtnText: 'Logout'
}}));
this.rtlEffects.closeConfirm
.pipe(takeUntil(this.unSubs[3]))

@ -1,16 +1,26 @@
export interface InputData {
placeholder: string;
inputValue?: string;
inputValue?: string | number | boolean;
inputType?: string;
min?: number;
max?: number;
step?: number;
}
export interface AlertData {
type: string; // INFO/WARN/ERROR/SUCCESS/CONFIRM
type: string; // INFORMATION/WARNING/ERROR/SUCCESS/CONFIRM
alertTitle?: string;
titleMessage?: string;
message?: string;
newlyAdded?: boolean;
noBtnText?: string;
yesBtnText?: string;
flgShowInput?: boolean;
getInputs?: Array<InputData>;
newlyAdded?: boolean;
component?: any;
}
export interface DialogConfig {
width: string;
data: AlertData;
}

@ -26,8 +26,8 @@ export const TRANS_TYPES = [
];
export enum AlertTypeEnum {
INFO = 'Information',
WARN = 'Warning',
INFORMATION = 'Information',
WARNING = 'Warning',
ERROR = 'Error',
SUCCESS = 'Success',
CONFIRM = 'Confirm'

@ -1,7 +1,7 @@
import { MatDialogConfig } from '@angular/material';
import { Action } from '@ngrx/store';
import { ErrorPayload } from '../shared/models/errorPayload';
import { DialogConfig } from '../shared/models/alertData';
import { RTLConfiguration, Settings, LightningNode, GetInfoRoot, SelNodeChild } from '../shared/models/RTLconfig';
import { GetInfoCL, FeesCL, AddressTypeCL, PeerCL, PaymentCL, PayRequestCL, QueryRoutesCL, ChannelCL, FeeRatesCL, ForwardingHistoryResCL, InvoiceCL, ListInvoicesCL, OnChainCL } from '../shared/models/clModels';
import {
@ -195,7 +195,7 @@ export class CloseSpinner implements Action {
export class OpenAlert implements Action {
readonly type = OPEN_ALERT;
constructor(public payload: {config: MatDialogConfig, component?: any}) {}
constructor(public payload: DialogConfig) {}
}
export class CloseAlert implements Action {
@ -204,7 +204,7 @@ export class CloseAlert implements Action {
export class OpenConfirmation implements Action {
readonly type = OPEN_CONFIRMATION;
constructor(public payload: MatDialogConfig) {}
constructor(public payload: DialogConfig) {}
}
export class CloseConfirmation implements Action {

@ -13,7 +13,7 @@ import { environment, API_URL } from '../../environments/environment';
import { LoggerService } from '../shared/services/logger.service';
import { SessionService } from '../shared/services/session.service';
import { Settings, RTLConfiguration } from '../shared/models/RTLconfig';
import { AuthenticateWith, CURRENCY_UNITS } from '../shared/services/consts-enums-functions';
import { AuthenticateWith, CURRENCY_UNITS, AlertTypeEnum } from '../shared/services/consts-enums-functions';
import { SpinnerDialogComponent } from '../shared/components/data-modal/spinner-dialog/spinner-dialog.component';
import { AlertMessageComponent } from '../shared/components/data-modal/alert-message/alert-message.component';
@ -59,10 +59,10 @@ export class RTLEffects implements OnDestroy {
openAlert = this.actions$.pipe(
ofType(RTLActions.OPEN_ALERT),
map((action: RTLActions.OpenAlert) => {
if(action.payload.component) {
this.dialogRef = this.dialog.open(action.payload.component, action.payload.config);
if(action.payload.data.component) {
this.dialogRef = this.dialog.open(action.payload.data.component, action.payload);
} else {
this.dialogRef = this.dialog.open(AlertMessageComponent, action.payload.config);
this.dialogRef = this.dialog.open(AlertMessageComponent, action.payload);
}
}
));
@ -102,10 +102,13 @@ export class RTLEffects implements OnDestroy {
if (!this.sessionService.getItem('token') || !rootData.nodeData.identity_pubkey) {
this.snackBar.open('Node Pubkey does not exist.');
} else {
this.store.dispatch(new RTLActions.OpenAlert({
config: { width: '70%', data: { type: 'INFO', message: JSON.stringify(rootData.nodeData)}},
this.store.dispatch(new RTLActions.OpenAlert({width: '70%',
data: {
type: AlertTypeEnum.INFORMATION,
alertTitle: '',
message: JSON.stringify(rootData.nodeData),
component: ShowPubkeyComponent
}));
}}));
}
return of({type: RTLActions.VOID});
}));
@ -153,7 +156,7 @@ export class RTLEffects implements OnDestroy {
this.logger.info(updateStatus);
return {
type: RTLActions.OPEN_ALERT,
payload: { config : { width: '70%', data: { type: 'SUCCESS', titleMessage: (!updateStatus.length) ? updateStatus.message : updateStatus[0].message + '. ' + updateStatus[1].message }}}
payload: { config : { width: '70%', data: { type: AlertTypeEnum.SUCCESS, titleMessage: (!updateStatus.length) ? updateStatus.message : updateStatus[0].message + '. ' + updateStatus[1].message }}}
};
},
catchError((err) => {
@ -348,12 +351,14 @@ export class RTLEffects implements OnDestroy {
this.store.dispatch(new RTLActions.Signout());
} else {
this.store.dispatch(new RTLActions.CloseSpinner());
this.store.dispatch(new RTLActions.OpenAlert({ config: {
this.store.dispatch(new RTLActions.OpenAlert({
width: '70%', data: {
type: alertType, titleMessage: alertTitle,
type: alertType,
alertTitle: alertTitle,
titleMessage: alertTitle,
message: JSON.stringify({ code: err.status, Message: err.error.error, URL: errURL })
}
}}));
}));
}
}

Loading…
Cancel
Save