Multinode bug fixes 3

Multinode bug fixes 3
pull/121/head
ShahanaFarooqui 5 years ago
parent d5e931205f
commit 8afb48cc52

@ -5,8 +5,8 @@
<title>RTL</title>
<base href="/rtl/"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="assets/images/favicon.ico">
<link rel="stylesheet" href="styles.bab7f62b489f0c86770d.css"></head>
<link rel="stylesheet" href="styles.c7b8be38c41a5a330ca0.css"></head>
<body>
<rtl-app></rtl-app>
<script type="text/javascript" src="runtime.26209474bfa8dc87a77c.js"></script><script type="text/javascript" src="polyfills.181b5a67c421a167a96a.js"></script><script type="text/javascript" src="main.a318f52fe363adad98c0.js"></script></body>
<script type="text/javascript" src="runtime.26209474bfa8dc87a77c.js"></script><script type="text/javascript" src="polyfills.181b5a67c421a167a96a.js"></script><script type="text/javascript" src="main.9fe6eac5e7d9aabe23bf.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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -138,11 +138,11 @@ exports.getConfig = (req, res, next) => {
switch (req.params.nodeType) {
case 'lnd':
JSONFormat = false;
confFile = common.nodes[0].lnd_config_path;
confFile = common.selectedNode.lnd_config_path;
break;
case 'bitcoind':
JSONFormat = false;
confFile = common.nodes[0].bitcoind_config_path;
confFile = common.selectedNode.bitcoind_config_path;
break;
case 'rtl':
JSONFormat = (common.multi_node_setup) ? true : false;

@ -15,15 +15,6 @@
<h2>Ride The Lightning <span class="font-60-percent">(Beta)</span></h2>
</div>
<div fxLayoutAlign="space-between center">
<div *ngIf="appConfig.nodes.length > 1" tabindex="1" fxLayoutAlign="start start" class="nodes-list">
<mat-form-field fxFlex="99">
<mat-select (selectionChange)="onSelectionChange($event.value)" [value]="selNode">
<mat-option *ngFor="let node of appConfig.nodes; index as idx" [value]="node">
{{node.index}}: {{node.lnNode}} ({{node.lnImplementation}})
</mat-option>
</mat-select>
</mat-form-field>
</div>
<rtl-top-menu></rtl-top-menu>
</div>
</mat-toolbar>

@ -2,7 +2,3 @@
display: inline-flex !important;
top: 0px !important;
}
.nodes-list {
font-size: 60%;
}

@ -161,12 +161,6 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
this.logger.info('Copied Text: ' + payload);
}
onSelectionChange(selNodeValue: Node) {
this.selNode = selNodeValue;
this.store.dispatch(new RTLActions.OpenSpinner('Updating Selected Node...'));
this.store.dispatch(new RTLActions.SetSelelectedNode(selNodeValue));
}
ngOnDestroy() {
this.unsubs.forEach(unsub => {
unsub.next();

@ -9,9 +9,9 @@
<mat-card-content>
<form fxLayout="column" fxLayoutAlign="space-between stretch" fxLayout.gt-md="row wrap" class="mb-2">
<mat-radio-group fxFlex="20" fxLayoutAlign="start" (change)="onSelectionChange($event)" class="mt-1 mb-1">
<mat-radio-button class="pr-5" value="rtl" [checked]="selectedNodeType=='rtl'">RTL</mat-radio-button>
<mat-radio-button class="pr-5" value="lnd" *ngIf="showLND" [checked]="selectedNodeType=='lnd'">LND</mat-radio-button>
<mat-radio-button class="pr-5" value="bitcoind" *ngIf="showBitcoind" [checked]="selectedNodeType=='bitcoind'">BITCOIND</mat-radio-button>
<mat-radio-button class="pr-5" value="rtl" [checked]="selectedNodeType=='rtl'">RTL</mat-radio-button>
</mat-radio-group>
<div fxFlex="30" fxLayoutAlign="space-between stretch">
<button fxFlex="50" fxLayoutAlign="center center" mat-raised-button color="primary" (click)="onShowConfig()" tabindex="2">Show Config</button>

@ -15,7 +15,7 @@ import * as fromRTLReducer from '../../shared/store/rtl.reducers';
})
export class ServerConfigComponent implements OnInit, OnDestroy {
public selNode: Node;
public selectedNodeType = 'lnd';
public selectedNodeType = 'rtl';
public showLND = false;
public showBitcoind = false;
public configData = '';
@ -33,13 +33,22 @@ export class ServerConfigComponent implements OnInit, OnDestroy {
this.resetData();
}
});
this.configData = '';
this.showLND = false;
this.showBitcoind = false;
this.selNode = rtlStore.selNode;
if (undefined !== this.selNode.authentication && this.selNode.authentication.lndConfigPath !== '') {
if (undefined !== this.selNode.authentication && undefined !== this.selNode.authentication.lndConfigPath && this.selNode.authentication.lndConfigPath !== '') {
this.showLND = true;
}
if (undefined !== this.selNode.authentication && undefined !== this.selNode.authentication.bitcoindConfigPath && this.selNode.authentication.bitcoindConfigPath !== '') {
this.showBitcoind = true;
}
if (this.selectedNodeType === 'lnd' && !this.showLND) {
this.selectedNodeType = 'rtl';
}
if (this.selectedNodeType === 'bitcoind' && !this.showBitcoind) {
this.selectedNodeType = 'rtl';
}
});
}
@ -68,7 +77,7 @@ export class ServerConfigComponent implements OnInit, OnDestroy {
resetData() {
this.configData = '';
this.selectedNodeType = 'lnd';
this.selectedNodeType = 'rtl';
}
ngOnDestroy() {

@ -4,6 +4,21 @@
<div fxLayout="column" class="container">
<button fxLayoutAlign="center center" mat-raised-button color="accent" class="mt-2" type="reset" (click)="onClose()">Close</button>
<div fxLayout="column">
<div *ngIf="appConfig.nodes.length > 1">
<h4>Switch Node</h4>
<div fxLayout="row" fxLayoutAlign="space-between center">
<div tabindex="1" fxFlex="100">
<mat-form-field fxFlex="100">
<mat-select (selectionChange)="onSelectionChange($event.value)" [value]="selNode">
<mat-option *ngFor="let node of appConfig.nodes" [value]="node">
{{node.lnNode}} ({{node.lnImplementation}})
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
<mat-divider class="mt-2"></mat-divider>
</div>
<h4>Currency Unit</h4>
<div fxLayout="row" fxLayoutAlign="space-between center">
<span>{{currencyUnit}}</span>

@ -3,7 +3,7 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Node } from '../../models/RTLconfig';
import { Node, RTLConfiguration } from '../../models/RTLconfig';
import { GetInfo } from '../../models/lndModels';
import { LoggerService } from '../../services/logger.service';
@ -24,6 +24,7 @@ export class SettingsNavComponent implements OnInit, OnDestroy {
public selectedMenuType: string;
public currencyUnit = 'BTC';
public showSettingOption = true;
public appConfig: RTLConfiguration;
unsubs: Array<Subject<void>> = [new Subject(), new Subject()];
@Output('done') done: EventEmitter<void> = new EventEmitter();
@ -34,6 +35,7 @@ export class SettingsNavComponent implements OnInit, OnDestroy {
this.store.select('rtlRoot')
.pipe(takeUntil(this.unsubs[0]))
.subscribe((rtlStore: fromRTLReducer.State) => {
this.appConfig = rtlStore.appConfig;
this.selNode = rtlStore.selNode;
this.selectedMenu = this.selNode.settings.menu;
this.selectedMenuType = this.selNode.settings.menuType;
@ -71,6 +73,12 @@ export class SettingsNavComponent implements OnInit, OnDestroy {
this.done.emit();
}
onSelectionChange(selNodeValue: Node) {
this.selNode = selNodeValue;
this.store.dispatch(new RTLActions.OpenSpinner('Updating Selected Node...'));
this.store.dispatch(new RTLActions.SetSelelectedNode(selNodeValue));
}
ngOnDestroy() {
this.unsubs.forEach(unsub => {
unsub.next();

@ -758,7 +758,6 @@ export class RTLEffects implements OnDestroy {
showLNDConfig = this.actions$.pipe(
ofType(RTLActions.SHOW_CONFIG),
map((action: RTLActions.ShowConfig) => {
this.logger.info(action.payload);
return action.payload;
})
);

@ -56,5 +56,17 @@
fill: mat-color($primary) !important;
cursor: default;
}
}
}
.mat-primary .mat-select, .mat-primary .mat-select-trigger, .mat-primary .mat-select-value, .mat-primary .mat-select-arrow {
// color: white !important;
}
.mat-primary .mat-select-panel .mat-option.mat-selected:not(.mat-option-multiple),
.mat-primary .mat-option.mat-selected:not(.mat-option-multiple):not(.mat-option-disabled) {
background: none;
font-weight: 900;
font-size: 110%;
}
}

Loading…
Cancel
Save