parent
160c6645df
commit
d256bf07a5
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
@ -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++)a=i[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&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:"dbfa80f5eb3d9dedcde5",6:"9c41e3d9871cc0947fad",7:"6d45208b54eb5a5e833b"}[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,d=[];p<i.length;p++)a=i[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&d.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);d.length;)d.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:"dbfa80f5eb3d9dedcde5",6:"d53f7986e7638a0b1f30",7:"d63addcff4d7597f87ec"}[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()}([]);
|
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,6 @@
|
||||
.mat-column-actions {
|
||||
flex: 0 0 6%;
|
||||
width: 6%;
|
||||
}
|
||||
|
||||
.mat-column-chan_id, .mat-column-alias {
|
||||
flex: 0 0 30%;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.mat-column-events, .mat-column-total_amount {
|
||||
flex: 0 0 17%;
|
||||
width: 17%;
|
||||
}
|
||||
|
||||
table.mat-table.incoming-table {
|
||||
border-bottom: none !important;
|
||||
border-bottom-left-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
}
|
||||
|
||||
table.mat-table.outgoing-table {
|
||||
border-top: none !important;
|
||||
border-top-left-radius: 0 !important;
|
||||
border-top-right-radius: 0 !important;
|
||||
flex: 1 1 25%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="padding-gap-x page-title-container">
|
||||
<fa-icon [icon]="faTools" class="page-title-img mr-1"></fa-icon>
|
||||
<span class="page-title">Application Settings</span>
|
||||
</div>
|
||||
<div fxLayout="column" class="padding-gap-x settings-container">
|
||||
<mat-card>
|
||||
<mat-card-content fxLayout="column" class="card-content-gap mt-1">
|
||||
<div fxLayout="column" fxLayout.gt-sm="row" fxFlex="100" fxLayoutAlign="space-between stretch">
|
||||
<mat-form-field fxFlex="32" fxLayoutAlign="start end">
|
||||
<mat-select [(ngModel)]="selNode.settings.userPersona" placeholder="User Persona" tabindex="1" required name="userPersona">
|
||||
<mat-option *ngFor="let userPersona of userPersonas" [value]="userPersona">
|
||||
{{userPersona | titlecase}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="32" fxLayoutAlign="start end" *ngIf="appConfig.nodes.length && appConfig.nodes.length > 1">
|
||||
<mat-select [(ngModel)]="appConfig.defaultNodeIndex" placeholder="Default Node" tabindex="1" required name="defaultNode">
|
||||
<mat-option *ngFor="let node of appConfig.nodes" [value]="node.index">
|
||||
{{node.lnNode}} ({{node.lnImplementation}})
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="32" fxLayoutAlign="start end">
|
||||
<mat-select [(ngModel)]="selNode.settings.currencyUnit" placeholder="Currency Unit" (selectionChange)="onCurrencyChange($event)" tabindex="1" required name="currencyUnit">
|
||||
<mat-option *ngFor="let currencyUnit of currencyUnits" [value]="currencyUnit.id">
|
||||
{{currencyUnit.id}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="column" fxLayout.gt-sm="row" fxFlex="100" fxLayoutAlign="start stretch" class="mt-1">
|
||||
<div fxLayout="column" fxFlex="25" fxLayoutAlign="start start" fxLayoutAlign.gt-sm="start space-between">
|
||||
<h4>Mode</h4>
|
||||
<mat-radio-group color="primary" [(ngModel)]="selectedThemeMode" (change)="chooseThemeMode()">
|
||||
<mat-radio-button *ngFor="let themeMode of themeModes" [value]="themeMode" [ngClass]="{'mr-4': screenSize === screenSizeEnum.XS || screenSize === screenSizeEnum.SM}">{{themeMode.name}}
|
||||
</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</div>
|
||||
<div fxLayout="column" fxFlex="9"></div>
|
||||
<div fxLayout="column" fxFlex="40">
|
||||
<h4>Skins</h4>
|
||||
<div fxLayout="row" fxFlex="100" fxLayoutAlign="space-between start">
|
||||
<span *ngFor="let themeColor of themeColors">
|
||||
<div [class]="themeColor" [ngClass]="{'skin': true, 'selected-color': selectedThemeColor === themeColor}" (click)="changeThemeColor(themeColor)"></div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxFlex="100" class="mt-4">
|
||||
<div fxLayout="row" fxFlex="100" fxFlex.gt-sm="50" fxLayoutAlign="space-between stretch">
|
||||
<button fxFlex="48" fxLayoutAlign="center center" mat-stroked-button color="primary" (click)="onResetSettings()" tabindex="12">Reset</button>
|
||||
<button fxFlex="48" fxLayoutAlign="center center" mat-raised-button color="primary" (click)="onUpdateSettings()" tabindex="13">Update</button>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
@ -1,42 +0,0 @@
|
||||
<div fxLayout="column" fxFlex="100">
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="padding-gap-x page-title-container">
|
||||
<fa-icon [icon]="faCog" class="page-title-img mr-1"></fa-icon>
|
||||
<span class="page-title">Show Configurations</span>
|
||||
</div>
|
||||
<div fxLayout="row" class="padding-gap-x" fxLayoutAlign="start start">
|
||||
<mat-card fxLayout="column" fxFlex="100" class="padding-gap-large">
|
||||
<mat-card-content class="card-content-gap">
|
||||
<form fxLayout="column" fxLayoutAlign="space-between stretch" fxLayout.gt-md="row wrap">
|
||||
<mat-radio-group color="primary" fxFlex="100" fxLayoutAlign="start" (change)="onSelectionChange($event)" class="mt-1 mb-1">
|
||||
<mat-radio-button tabindex="1" class="pr-5" value="rtl" [checked]="selectedNodeType=='rtl'">RTL</mat-radio-button>
|
||||
<mat-radio-button tabindex="2" class="pr-5" value="ln" *ngIf="showLnConfig" [checked]="selectedNodeType=='ln'">{{lnImplementationStr}}</mat-radio-button>
|
||||
<mat-radio-button tabindex="3" class="pr-5" value="bitcoind" *ngIf="showBitcoind" [checked]="selectedNodeType=='bitcoind'">BITCOIND</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
<div fxLayout="row" fxFlex="100" fxFlex.gt-sm="50" fxLayoutAlign="space-between stretch">
|
||||
<button fxFlex="48" fxLayoutAlign="center center" mat-stroked-button color="primary" tabindex="4" type="reset" (click)="resetData()">Clear</button>
|
||||
<button fxFlex="48" fxLayoutAlign="center center" mat-raised-button color="primary" (click)="onShowConfig()" tabindex="5">Show Config</button>
|
||||
</div>
|
||||
</form>
|
||||
<mat-divider *ngIf="configData !== ''" class="my-1"></mat-divider>
|
||||
<div *ngIf="configData !== '' && fileFormat === 'JSON'" class="mt-2 mb-6">
|
||||
<pre class="pre-wrap">{{configData | json}}</pre>
|
||||
<mat-divider *ngIf="configData !== ''" class="my-1"></mat-divider>
|
||||
</div>
|
||||
<div *ngIf="configData !== '' && fileFormat === 'INI'" class="mt-2">
|
||||
<mat-list>
|
||||
<mat-list-item *ngFor="let conf of configData; index as i;">
|
||||
<mat-card-subtitle class="my-1">
|
||||
<h2 *ngIf="conf.indexOf('[') >= 0">{{conf}}</h2>
|
||||
</mat-card-subtitle>
|
||||
<mat-card-subtitle class="m-0">
|
||||
<h4 *ngIf="conf.indexOf('[') < 0" class="ml-4">{{conf}}</h4>
|
||||
</mat-card-subtitle>
|
||||
<mat-divider [inset]="true" *ngIf="conf.indexOf('[') < 0"></mat-divider>
|
||||
</mat-list-item>
|
||||
</mat-list>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,93 +0,0 @@
|
||||
import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
import { LightningNode } from '../../models/RTLconfig';
|
||||
import { RTLEffects } from '../../../store/rtl.effects';
|
||||
import * as RTLActions from '../../../store/rtl.actions';
|
||||
import * as fromRTLReducer from '../../../store/rtl.reducers';
|
||||
import { faCog } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
@Component({
|
||||
selector: 'rtl-server-config',
|
||||
templateUrl: './server-config.component.html',
|
||||
styleUrls: ['./server-config.component.scss']
|
||||
})
|
||||
export class ServerConfigComponent implements OnInit, OnDestroy {
|
||||
public selNode: LightningNode;
|
||||
public selectedNodeType = 'rtl';
|
||||
public showLnConfig = false;
|
||||
public lnImplementationStr = '';
|
||||
public showBitcoind = false;
|
||||
public configData = '';
|
||||
public fileFormat = 'INI';
|
||||
public faCog = faCog;
|
||||
private unSubs: Array<Subject<void>> = [new Subject(), new Subject()];
|
||||
|
||||
constructor(private store: Store<fromRTLReducer.RTLState>, private rtlEffects: RTLEffects) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.store.select('root')
|
||||
.pipe(takeUntil(this.unSubs[0]))
|
||||
.subscribe((rtlStore) => {
|
||||
rtlStore.effectErrorsRoot.forEach(effectsErr => {
|
||||
if (effectsErr.action === 'fetchConfig') { this.resetData(); }
|
||||
});
|
||||
this.configData = '';
|
||||
this.showLnConfig = false;
|
||||
this.showBitcoind = false;
|
||||
this.selNode = rtlStore.selNode;
|
||||
this.lnImplementationStr = this.selNode.lnImplementation.toUpperCase() === 'CLT' ? 'CLT' : 'LND';
|
||||
if (undefined !== this.selNode.authentication && undefined !== this.selNode.authentication.configPath && this.selNode.authentication.configPath !== '') {
|
||||
this.showLnConfig = true;
|
||||
}
|
||||
if (undefined !== this.selNode.authentication && undefined !== this.selNode.authentication.bitcoindConfigPath && this.selNode.authentication.bitcoindConfigPath !== '') {
|
||||
this.showBitcoind = true;
|
||||
}
|
||||
if (this.selectedNodeType === 'ln' && !this.showLnConfig) {
|
||||
this.selectedNodeType = 'rtl';
|
||||
}
|
||||
if (this.selectedNodeType === 'bitcoind' && !this.showBitcoind) {
|
||||
this.selectedNodeType = 'rtl';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onSelectionChange(event) {
|
||||
this.selectedNodeType = event.value;
|
||||
this.configData = '';
|
||||
}
|
||||
|
||||
onShowConfig() {
|
||||
this.store.dispatch(new RTLActions.OpenSpinner('Opening Config File...'));
|
||||
this.store.dispatch(new RTLActions.FetchConfig(this.selectedNodeType));
|
||||
this.rtlEffects.showLnConfig
|
||||
.pipe(takeUntil(this.unSubs[1]))
|
||||
.subscribe((config: any) => {
|
||||
console.warn(config);
|
||||
const configFile = config.data;
|
||||
this.fileFormat = config.format;
|
||||
if (configFile !== '' && undefined !== configFile && this.fileFormat === 'INI') {
|
||||
this.configData = configFile.split('\n');
|
||||
} else if (configFile !== '' && undefined !== configFile && this.fileFormat === 'JSON') {
|
||||
this.configData = configFile;
|
||||
} else {
|
||||
this.configData = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
resetData() {
|
||||
this.configData = '';
|
||||
this.selectedNodeType = 'rtl';
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.unSubs.forEach(completeSub => {
|
||||
completeSub.next();
|
||||
completeSub.complete();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
<div fxLayout="column" fxFlex="100" class="overflow-x-hidden">
|
||||
<div fxLayout="column" class="settings-container mt-1">
|
||||
<div fxLayout="column" fxLayout.gt-sm="row" fxFlex="100" fxLayoutAlign="space-between stretch">
|
||||
<mat-form-field fxFlex="32" fxLayoutAlign="start end">
|
||||
<mat-select [(ngModel)]="selNode.settings.userPersona" placeholder="User Persona" tabindex="1" required name="userPersona">
|
||||
<mat-option *ngFor="let userPersona of userPersonas" [value]="userPersona">
|
||||
{{userPersona | titlecase}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="32" fxLayoutAlign="start end" *ngIf="appConfig.nodes.length && appConfig.nodes.length > 1">
|
||||
<mat-select [(ngModel)]="appConfig.defaultNodeIndex" placeholder="Default Node" tabindex="1" required name="defaultNode">
|
||||
<mat-option *ngFor="let node of appConfig.nodes" [value]="node.index">
|
||||
{{node.lnNode}} ({{node.lnImplementation}})
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="32" fxLayoutAlign="start end">
|
||||
<mat-select [(ngModel)]="selNode.settings.currencyUnit" placeholder="Currency Unit" (selectionChange)="onCurrencyChange($event)" tabindex="1" required name="currencyUnit">
|
||||
<mat-option *ngFor="let currencyUnit of currencyUnits" [value]="currencyUnit.id">
|
||||
{{currencyUnit.id}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="column" fxLayout.gt-sm="row" fxFlex="100" fxLayoutAlign="start stretch" class="mt-1">
|
||||
<div fxLayout="column" fxFlex="25" fxLayoutAlign="start start" fxLayoutAlign.gt-sm="start space-between">
|
||||
<h4>Mode</h4>
|
||||
<mat-radio-group color="primary" [(ngModel)]="selectedThemeMode" (change)="chooseThemeMode()">
|
||||
<mat-radio-button *ngFor="let themeMode of themeModes" [value]="themeMode" [ngClass]="{'mr-4': screenSize === screenSizeEnum.XS || screenSize === screenSizeEnum.SM}">{{themeMode.name}}
|
||||
</mat-radio-button>
|
||||
</mat-radio-group>
|
||||
</div>
|
||||
<div fxLayout="column" fxFlex="9"></div>
|
||||
<div fxLayout="column" fxFlex="40">
|
||||
<h4>Skins</h4>
|
||||
<div fxLayout="row" fxFlex="100" fxLayoutAlign="space-between start">
|
||||
<span *ngFor="let themeColor of themeColors">
|
||||
<div [class]="themeColor" [ngClass]="{'skin': true, 'selected-color': selectedThemeColor === themeColor}" (click)="changeThemeColor(themeColor)"></div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxFlex="100" class="mt-4">
|
||||
<div fxLayout="row" fxFlex="100" fxFlex.gt-sm="50" fxLayoutAlign="space-between stretch">
|
||||
<button fxFlex="48" fxLayoutAlign="center center" mat-stroked-button color="primary" (click)="onResetSettings()" tabindex="12">Reset</button>
|
||||
<button fxFlex="48" fxLayoutAlign="center center" mat-raised-button color="primary" (click)="onUpdateSettings()" tabindex="13">Update</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,22 @@
|
||||
<div fxLayout="column" fxFlex="100">
|
||||
<div fxLayout="row" fxFlex="100" fxLayoutAlign="start start">
|
||||
<div *ngIf="configData !== '' && fileFormat === 'JSON'" fxFlex="100" class="mb-6">
|
||||
<pre class="pre-wrap">{{configData | json}}</pre>
|
||||
<mat-divider *ngIf="configData !== ''" class="my-1"></mat-divider>
|
||||
</div>
|
||||
<div *ngIf="configData !== '' && fileFormat === 'INI'" fxFlex="100">
|
||||
<mat-list>
|
||||
<mat-list-item *ngFor="let conf of configData; index as i;">
|
||||
<mat-card-subtitle class="my-1">
|
||||
<h2 *ngIf="conf.indexOf('[') >= 0">{{conf}}</h2>
|
||||
</mat-card-subtitle>
|
||||
<mat-card-subtitle class="m-0">
|
||||
<h4 *ngIf="conf.indexOf('[') < 0" class="ml-4">{{conf}}</h4>
|
||||
</mat-card-subtitle>
|
||||
<mat-divider [inset]="true" *ngIf="conf.indexOf('[') < 0"></mat-divider>
|
||||
</mat-list-item>
|
||||
</mat-list>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -0,0 +1,43 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
import { RTLEffects } from '../../../../store/rtl.effects';
|
||||
import * as RTLActions from '../../../../store/rtl.actions';
|
||||
import * as fromRTLReducer from '../../../../store/rtl.reducers';
|
||||
import { faCog } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
@Component({
|
||||
selector: 'rtl-server-config',
|
||||
templateUrl: './server-config.component.html',
|
||||
styleUrls: ['./server-config.component.scss']
|
||||
})
|
||||
export class ServerConfigComponent implements OnInit {
|
||||
@Input() selectedNodeType = '';
|
||||
public configData = '';
|
||||
public fileFormat = 'INI';
|
||||
public faCog = faCog;
|
||||
private unSubs: Array<Subject<void>> = [new Subject(), new Subject()];
|
||||
|
||||
constructor(private store: Store<fromRTLReducer.RTLState>, private rtlEffects: RTLEffects) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.store.dispatch(new RTLActions.OpenSpinner('Opening Config File...'));
|
||||
this.store.dispatch(new RTLActions.FetchConfig(this.selectedNodeType));
|
||||
this.rtlEffects.showLnConfig
|
||||
.pipe(takeUntil(this.unSubs[1]))
|
||||
.subscribe((config: any) => {
|
||||
const configFile = config.data;
|
||||
this.fileFormat = config.format;
|
||||
if (configFile !== '' && undefined !== configFile && this.fileFormat === 'INI') {
|
||||
this.configData = configFile.split('\n');
|
||||
} else if (configFile !== '' && undefined !== configFile && this.fileFormat === 'JSON') {
|
||||
this.configData = configFile;
|
||||
} else {
|
||||
this.configData = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="padding-gap-x page-title-container">
|
||||
<fa-icon [icon]="faTools" class="page-title-img mr-1"></fa-icon>
|
||||
<span class="page-title">Settings</span>
|
||||
</div>
|
||||
<div fxLayout="column" class="padding-gap-x">
|
||||
<mat-card>
|
||||
<mat-card-content fxLayout="column">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Settings"><rtl-app-settings></rtl-app-settings></mat-tab>
|
||||
<mat-tab *ngIf="showLnConfig" [label]="lnImplementationStr">
|
||||
<ng-template matTabContent>
|
||||
<rtl-server-config [selectedNodeType]="'ln'"></rtl-server-config>
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
<mat-tab *ngIf="showBitcoind" label="BitcoinD Config">
|
||||
<ng-template matTabContent>
|
||||
<rtl-server-config [selectedNodeType]="'bitcoind'"></rtl-server-config>
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
|
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SettingsComponent } from './settings.component';
|
||||
|
||||
describe('SettingsComponent', () => {
|
||||
let component: SettingsComponent;
|
||||
let fixture: ComponentFixture<SettingsComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SettingsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SettingsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,49 @@
|
||||
import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { faTools } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
import { LightningNode } from '../../models/RTLconfig';
|
||||
import { RTLEffects } from '../../../store/rtl.effects';
|
||||
import * as fromRTLReducer from '../../../store/rtl.reducers';
|
||||
|
||||
@Component({
|
||||
selector: 'rtl-settings',
|
||||
templateUrl: './settings.component.html',
|
||||
styleUrls: ['./settings.component.scss']
|
||||
})
|
||||
export class SettingsComponent implements OnInit, OnDestroy{
|
||||
public faTools = faTools;
|
||||
public showLnConfig = false;
|
||||
public showBitcoind = false;
|
||||
public selNode: LightningNode;
|
||||
public lnImplementationStr = '';
|
||||
private unSubs: Array<Subject<void>> = [new Subject(), new Subject()];
|
||||
|
||||
constructor(private store: Store<fromRTLReducer.RTLState>) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.store.select('root')
|
||||
.pipe(takeUntil(this.unSubs[0]))
|
||||
.subscribe((rtlStore) => {
|
||||
this.showLnConfig = false;
|
||||
this.showBitcoind = false;
|
||||
this.selNode = rtlStore.selNode;
|
||||
this.lnImplementationStr = this.selNode.lnImplementation.toUpperCase() === 'CLT' ? 'CLT Config' : 'LND Config';
|
||||
if (undefined !== this.selNode.authentication && undefined !== this.selNode.authentication.configPath && this.selNode.authentication.configPath !== '') {
|
||||
this.showLnConfig = true;
|
||||
}
|
||||
if (undefined !== this.selNode.authentication && undefined !== this.selNode.authentication.bitcoindConfigPath && this.selNode.authentication.bitcoindConfigPath !== '') {
|
||||
this.showBitcoind = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.unSubs.forEach(completeSub => {
|
||||
completeSub.next();
|
||||
completeSub.complete();
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue