mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2024-11-19 09:50:36 +01:00
MultiNode Frontend Incomplete
MultiNode Frontend Incomplete
This commit is contained in:
parent
8ac2f39f91
commit
08a609ef85
@ -8,5 +8,5 @@
|
||||
<link rel="stylesheet" href="styles.bab7f62b489f0c86770d.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.44d71616582faa38697e.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.303f236883907eaa2a3b.js"></script></body>
|
||||
</html>
|
||||
|
1
angular/main.303f236883907eaa2a3b.js
Normal file
1
angular/main.303f236883907eaa2a3b.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -28,7 +28,12 @@ exports.getRTLConfig = (req, res, next) => {
|
||||
lndConfigPath: common.nodes[0].lnd_config_path,
|
||||
bitcoindConfigPath: common.nodes[0].bitcoind_config_path
|
||||
};
|
||||
res.status(200).json({ sso: sso, nodes: [{settings: jsonConfig.Settings, authentication: authentication}] });
|
||||
res.status(200).json({ sso: sso, nodes: [{
|
||||
index: common.nodes[0].index,
|
||||
lnNode: 'SingleNode',
|
||||
lnImplementation: '',
|
||||
settings: jsonConfig.Settings,
|
||||
authentication: authentication}] });
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -38,7 +43,7 @@ exports.getRTLConfig = (req, res, next) => {
|
||||
if (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
logger.error('\r\nRTLConf.js: 36: ' + JSON.stringify(Date.now()) + ': INFO: Multi Node Config does not exist!');
|
||||
res.status(200).json({ nodes: [] });
|
||||
res.status(200).json({ sso: {}, nodes: [] });
|
||||
} else {
|
||||
logger.error('\r\nRTLConf.js: 39: ' + JSON.stringify(Date.now()) + ': ERROR: Getting Multi Node Config Failed!');
|
||||
res.status(500).json({
|
||||
@ -59,7 +64,12 @@ exports.getRTLConfig = (req, res, next) => {
|
||||
if(node.Settings.bitcoindConfigPath) {
|
||||
authentication.bitcoindConfigPath = node.Settings.bitcoindConfigPath;
|
||||
}
|
||||
nodesArr.push({settings: node.Settings, authentication: authentication})
|
||||
nodesArr.push({
|
||||
index: node.index,
|
||||
lnNode: node.lnNode,
|
||||
lnImplementation: node.lnImplementation,
|
||||
settings: node.Settings,
|
||||
authentication: authentication})
|
||||
});
|
||||
res.status(200).json({ sso: sso, nodes: nodesArr });
|
||||
}
|
||||
@ -83,7 +93,7 @@ exports.updateUISettings = (req, res, next) => {
|
||||
}
|
||||
});
|
||||
try {
|
||||
fs.writeFileSync(RTLConfFile, JSON.stringify(config));
|
||||
fs.writeFileSync(RTLConfFile, JSON.stringify(config, null, 2), 'utf-8');
|
||||
logger.info('\r\nConf: 77: ' + JSON.stringify(Date.now()) + ': INFO: Updating UI Settings Succesful!');
|
||||
res.status(201).json({message: 'UI Settings Updated Successfully'});
|
||||
}
|
||||
|
@ -1,20 +1,29 @@
|
||||
<div fxLayout="column" id="rtl-container" class="rtl-container" [ngClass]="appConfig.nodes[0].settings.theme" [class.horizontal]="appConfig.nodes[0].settings.menu === 'Horizontal'" [class.compact]="appConfig.nodes[0].settings.menuType === 'Compact'" [class.mini]="appConfig.nodes[0].settings.menuType === 'Mini'">
|
||||
<div fxLayout="column" id="rtl-container" class="rtl-container" [ngClass]="settings.theme" [class.horizontal]="settings.menu === 'Horizontal'" [class.compact]="settings.menuType === 'Compact'" [class.mini]="settings.menuType === 'Mini'">
|
||||
<mat-sidenav-container>
|
||||
<mat-sidenav perfectScrollbar *ngIf="appConfig.nodes[0].settings.menu === 'Vertical'" [opened]="appConfig.nodes[0].settings.flgSidenavOpened" [mode]="(appConfig.nodes[0].settings.flgSidenavPinned) ? 'side' : 'over'"
|
||||
<mat-sidenav perfectScrollbar *ngIf="settings.menu === 'Vertical'" [opened]="settings.flgSidenavOpened" [mode]="(settings.flgSidenavPinned) ? 'side' : 'over'"
|
||||
#sideNavigation class="sidenav mat-elevation-z6 overflow-auto">
|
||||
<rtl-side-navigation (ChildNavClicked)="onNavigationClicked($event)"></rtl-side-navigation>
|
||||
</mat-sidenav>
|
||||
<mat-sidenav-content perfectScrollbar class="overflow-auto">
|
||||
<mat-toolbar fxLayout="row" fxLayoutAlign="space-between center" color="primary" class="padding-gap-x">
|
||||
<div fxLayoutAlign="center center">
|
||||
<button *ngIf="appConfig.nodes[0].settings.menu === 'Vertical'" mat-icon-button (click)="sideNavToggle(sideNavigation)">
|
||||
<button *ngIf="settings.menu === 'Vertical'" mat-icon-button (click)="sideNavToggle(sideNavigation)">
|
||||
<mat-icon>menu</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Ride The Lightning <span class="font-60-percent">(Beta)</span></h2>
|
||||
</div>
|
||||
<div>
|
||||
<div fxLayoutAlign="space-between center">
|
||||
<div *ngIf="appConfig.nodes.length > 0" tabindex="1" fxLayoutAlign="start start" class="nodes-list">
|
||||
<mat-form-field fxFlex="99">
|
||||
<mat-select (selectionChange)="onSelectionChange($event.value)">
|
||||
<mat-option *ngFor="let node of appConfig.nodes; index as idx" [value]="idx">
|
||||
{{node.index}}: {{node.lnNode}} ({{node.lnImplementation}})
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<rtl-top-menu></rtl-top-menu>
|
||||
</div>
|
||||
</mat-toolbar>
|
||||
@ -25,7 +34,7 @@
|
||||
<mat-icon [ngClass]="{'icon-smaller cursor-pointer copy-icon-smaller': smallScreen, 'icon-small cursor-pointer copy-icon': !smallScreen}">file_copy</mat-icon><span [hidden]="!flgCopied">Copied</span>
|
||||
</div>
|
||||
</div>
|
||||
<mat-toolbar color="primary" *ngIf="appConfig.nodes[0].settings.menu === 'Horizontal'" class="padding-gap-x horizontal-nav">
|
||||
<mat-toolbar color="primary" *ngIf="settings.menu === 'Horizontal'" class="padding-gap-x horizontal-nav">
|
||||
<div fxLayout="row" fxFlex="100" fxLayoutAlign="center center" class="h-100">
|
||||
<rtl-horizontal-navigation></rtl-horizontal-navigation>
|
||||
</div>
|
||||
@ -41,7 +50,7 @@
|
||||
<rtl-settings-nav (done)="settingSidenav.toggle()"></rtl-settings-nav>
|
||||
</mat-sidenav>
|
||||
</mat-sidenav-container>
|
||||
<div class="rtl-spinner" *ngIf="undefined === appConfig.nodes[0].settings.theme">
|
||||
<div class="rtl-spinner" *ngIf="undefined === settings.theme">
|
||||
<mat-spinner color="accent"></mat-spinner>
|
||||
<h4>Loading RTL...</h4>
|
||||
</div>
|
||||
|
@ -2,3 +2,7 @@
|
||||
display: inline-flex !important;
|
||||
top: 0px !important;
|
||||
}
|
||||
|
||||
.nodes-list {
|
||||
font-size: 60%;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import { Actions } from '@ngrx/effects';
|
||||
import { UserIdleService } from 'angular-user-idle';
|
||||
|
||||
import { LoggerService } from './shared/services/logger.service';
|
||||
import { Settings, Authentication, SSO, RTLConfiguration } from './shared/models/RTLconfig';
|
||||
import { RTLConfiguration, Settings } from './shared/models/RTLconfig';
|
||||
import { GetInfo } from './shared/models/lndModels';
|
||||
|
||||
import * as RTLActions from './shared/store/rtl.actions';
|
||||
@ -21,6 +21,8 @@ import * as fromRTLReducer from './shared/store/rtl.reducers';
|
||||
export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
@ViewChild('sideNavigation') sideNavigation: any;
|
||||
@ViewChild('settingSidenav') settingSidenav: any;
|
||||
public selNodeIndex = 0;
|
||||
public settings: Settings;
|
||||
public information: GetInfo = {};
|
||||
public flgLoading: Array<Boolean | 'error'> = [true]; // 0: Info
|
||||
public flgCopied = false;
|
||||
@ -38,18 +40,20 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.store.select('rtlRoot')
|
||||
.pipe(takeUntil(this.unsubs[0]))
|
||||
.subscribe(rtlStore => {
|
||||
this.selNodeIndex = rtlStore.selNodeIndex;
|
||||
this.settings = rtlStore.appConfig.nodes[this.selNodeIndex].settings;
|
||||
this.appConfig = rtlStore.appConfig;
|
||||
this.information = rtlStore.information;
|
||||
this.flgLoading[0] = (undefined !== this.information.identity_pubkey) ? false : true;
|
||||
if (window.innerWidth <= 768) {
|
||||
this.appConfig.nodes[0].settings.menu = 'Vertical';
|
||||
this.appConfig.nodes[0].settings.flgSidenavOpened = false;
|
||||
this.appConfig.nodes[0].settings.flgSidenavPinned = false;
|
||||
this.appConfig.nodes[this.selNodeIndex].settings.menu = 'Vertical';
|
||||
this.appConfig.nodes[this.selNodeIndex].settings.flgSidenavOpened = false;
|
||||
this.appConfig.nodes[this.selNodeIndex].settings.flgSidenavPinned = false;
|
||||
}
|
||||
if (window.innerWidth <= 414) {
|
||||
this.smallScreen = true;
|
||||
}
|
||||
this.logger.info(this.appConfig.nodes[0].settings);
|
||||
this.logger.info(this.appConfig.nodes[this.selNodeIndex].settings);
|
||||
if (!sessionStorage.getItem('token')) {
|
||||
this.flgLoading[0] = false;
|
||||
}
|
||||
@ -71,9 +75,9 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
if (
|
||||
this.appConfig.nodes[0].settings.menu === 'Horizontal' ||
|
||||
this.appConfig.nodes[0].settings.menuType === 'Compact' ||
|
||||
this.appConfig.nodes[0].settings.menuType === 'Mini') {
|
||||
this.appConfig.nodes[this.selNodeIndex].settings.menu === 'Horizontal' ||
|
||||
this.appConfig.nodes[this.selNodeIndex].settings.menuType === 'Compact' ||
|
||||
this.appConfig.nodes[this.selNodeIndex].settings.menuType === 'Mini') {
|
||||
this.settingSidenav.toggle(); // To dynamically update the width to 100% after side nav is closed
|
||||
setTimeout(() => { this.settingSidenav.toggle(); }, 100);
|
||||
}
|
||||
@ -122,7 +126,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
if (!this.appConfig.nodes[0].settings.flgSidenavPinned) {
|
||||
if (!this.appConfig.nodes[this.selNodeIndex].settings.flgSidenavPinned) {
|
||||
this.sideNavigation.close();
|
||||
this.settingSidenav.toggle();
|
||||
}
|
||||
@ -135,9 +139,9 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
@HostListener('window:resize')
|
||||
public onWindowResize(): void {
|
||||
if (window.innerWidth <= 768) {
|
||||
this.appConfig.nodes[0].settings.menu = 'Vertical';
|
||||
this.appConfig.nodes[0].settings.flgSidenavOpened = false;
|
||||
this.appConfig.nodes[0].settings.flgSidenavPinned = false;
|
||||
this.appConfig.nodes[this.selNodeIndex].settings.menu = 'Vertical';
|
||||
this.appConfig.nodes[this.selNodeIndex].settings.flgSidenavOpened = false;
|
||||
this.appConfig.nodes[this.selNodeIndex].settings.flgSidenavPinned = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -157,6 +161,12 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.logger.info('Copied Text: ' + payload);
|
||||
}
|
||||
|
||||
onSelectionChange(val: number) {
|
||||
console.warn(val);
|
||||
this.selNodeIndex = val;
|
||||
this.store.dispatch(new RTLActions.SetSelNodeIndex(this.selNodeIndex));
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.unsubs.forEach(unsub => {
|
||||
unsub.next();
|
||||
|
@ -19,6 +19,7 @@ import * as fromRTLReducer from '../../../shared/store/rtl.reducers';
|
||||
})
|
||||
export class ChannelPendingComponent implements OnInit, OnDestroy {
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
public selNodeIndex = 0;
|
||||
public selectedFilter = 0;
|
||||
public settings: Settings;
|
||||
public information: GetInfo = {};
|
||||
@ -105,7 +106,8 @@ export class ChannelPendingComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
});
|
||||
|
||||
this.settings = rtlStore.appConfig.nodes[0].settings;
|
||||
this.selNodeIndex = rtlStore.selNodeIndex;
|
||||
this.settings = rtlStore.appConfig.nodes[this.selNodeIndex].settings;
|
||||
this.information = rtlStore.information;
|
||||
this.pendingChannels = rtlStore.pendingChannels;
|
||||
if (undefined !== this.pendingChannels.total_limbo_balance) {
|
||||
|
@ -15,6 +15,7 @@ import * as fromRTLReducer from '../../shared/store/rtl.reducers';
|
||||
styleUrls: ['./home.component.scss']
|
||||
})
|
||||
export class HomeComponent implements OnInit, OnDestroy {
|
||||
public selNodeIndex = 0;
|
||||
public settings: Settings;
|
||||
public fees: Fees;
|
||||
public information: GetInfo = {};
|
||||
@ -88,7 +89,8 @@ export class HomeComponent implements OnInit, OnDestroy {
|
||||
this.flgLoading[6] = 'error';
|
||||
}
|
||||
});
|
||||
this.settings = rtlStore.appConfig.nodes[0].settings;
|
||||
this.selNodeIndex = rtlStore.selNodeIndex;
|
||||
this.settings = rtlStore.appConfig.nodes[this.selNodeIndex].settings;
|
||||
this.information = rtlStore.information;
|
||||
if (this.flgLoading[0] !== 'error') {
|
||||
this.flgLoading[0] = (undefined !== this.information.identity_pubkey) ? false : true;
|
||||
|
@ -22,6 +22,7 @@ import * as fromRTLReducer from '../../shared/store/rtl.reducers';
|
||||
})
|
||||
export class InvoicesComponent implements OnInit, OnDestroy {
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
public selNodeIndex = 0;
|
||||
public newlyAddedInvoiceMemo = '';
|
||||
public newlyAddedInvoiceValue = 0;
|
||||
public flgAnimate = true;
|
||||
@ -67,7 +68,8 @@ export class InvoicesComponent implements OnInit, OnDestroy {
|
||||
this.flgLoading[0] = 'error';
|
||||
}
|
||||
});
|
||||
this.settings = rtlStore.appConfig.nodes[0].settings;
|
||||
this.selNodeIndex = rtlStore.selNodeIndex;
|
||||
this.settings = rtlStore.appConfig.nodes[this.selNodeIndex].settings;
|
||||
this.information = rtlStore.information;
|
||||
this.logger.info(rtlStore);
|
||||
this.loadInvoicesTable(rtlStore.invoices);
|
||||
|
@ -25,6 +25,7 @@ import * as fromRTLReducer from '../../../shared/store/rtl.reducers';
|
||||
})
|
||||
export class SideNavigationComponent implements OnInit, OnDestroy {
|
||||
@Output() ChildNavClicked = new EventEmitter<any>();
|
||||
public selNodeIndex = 0;
|
||||
public version = '';
|
||||
public settings: Settings;
|
||||
public information: GetInfo = {};
|
||||
@ -62,7 +63,8 @@ export class SideNavigationComponent implements OnInit, OnDestroy {
|
||||
this.store.select('rtlRoot')
|
||||
.pipe(takeUntil(this.unSubs[0]))
|
||||
.subscribe((rtlStore: fromRTLReducer.State) => {
|
||||
this.settings = rtlStore.appConfig.nodes[0].settings;
|
||||
this.selNodeIndex = rtlStore.selNodeIndex;
|
||||
this.settings = rtlStore.appConfig.nodes[this.selNodeIndex].settings;
|
||||
this.information = rtlStore.information;
|
||||
this.numPendingChannels = rtlStore.numberOfPendingChannels;
|
||||
|
||||
|
@ -19,6 +19,7 @@ import * as RTLActions from '../../../shared/store/rtl.actions';
|
||||
styleUrls: ['./top-menu.component.scss']
|
||||
})
|
||||
export class TopMenuComponent implements OnInit, OnDestroy {
|
||||
public selNodeIndex = 0;
|
||||
public settings: Settings;
|
||||
public version = '';
|
||||
public information: GetInfo = {};
|
||||
@ -35,7 +36,8 @@ export class TopMenuComponent implements OnInit, OnDestroy {
|
||||
this.store.select('rtlRoot')
|
||||
.pipe(takeUntil(this.unSubs[0]))
|
||||
.subscribe((rtlStore: fromRTLReducer.State) => {
|
||||
this.settings = rtlStore.appConfig.nodes[0].settings;
|
||||
this.selNodeIndex = rtlStore.selNodeIndex;
|
||||
this.settings = rtlStore.appConfig.nodes[this.selNodeIndex].settings;
|
||||
|
||||
this.information = rtlStore.information;
|
||||
this.flgLoading = (undefined !== this.information.identity_pubkey) ? false : true;
|
||||
|
@ -23,6 +23,7 @@ import * as fromRTLReducer from '../../shared/store/rtl.reducers';
|
||||
export class PaymentsComponent implements OnInit, OnDestroy {
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ViewChild('sendPaymentForm') form;
|
||||
public selNodeIndex = 0;
|
||||
public newlyAddedPayment = '';
|
||||
public flgAnimate = true;
|
||||
public settings: Settings;
|
||||
@ -67,7 +68,8 @@ export class PaymentsComponent implements OnInit, OnDestroy {
|
||||
this.flgLoading[0] = 'error';
|
||||
}
|
||||
});
|
||||
this.settings = rtlStore.appConfig.nodes[0].settings;
|
||||
this.selNodeIndex = rtlStore.selNodeIndex;
|
||||
this.settings = rtlStore.appConfig.nodes[this.selNodeIndex].settings;
|
||||
this.information = rtlStore.information;
|
||||
this.paymentJSONArr = (rtlStore.payments.length > 0) ? rtlStore.payments : [];
|
||||
this.payments = (undefined === rtlStore.payments) ? new MatTableDataSource([]) : new MatTableDataSource<Payment>([...this.paymentJSONArr]);
|
||||
|
@ -14,6 +14,7 @@ import { Authentication } from '../../shared/models/RTLconfig';
|
||||
styleUrls: ['./server-config.component.scss']
|
||||
})
|
||||
export class ServerConfigComponent implements OnInit, OnDestroy {
|
||||
public selNodeIndex = 0;
|
||||
public selectedNodeType = 'lnd';
|
||||
public authSettings: Authentication = {};
|
||||
public showLND = false;
|
||||
@ -33,7 +34,8 @@ export class ServerConfigComponent implements OnInit, OnDestroy {
|
||||
this.resetData();
|
||||
}
|
||||
});
|
||||
this.authSettings = rtlStore.appConfig.nodes[0].authentication;
|
||||
this.selNodeIndex = rtlStore.selNodeIndex;
|
||||
this.authSettings = rtlStore.appConfig.nodes[this.selNodeIndex].authentication;
|
||||
if (undefined !== this.authSettings && this.authSettings.lndConfigPath !== '') {
|
||||
this.showLND = true;
|
||||
}
|
||||
|
@ -13,12 +13,13 @@ import * as RTLActions from '../../shared/store/rtl.actions';
|
||||
styleUrls: ['./signin.component.scss']
|
||||
})
|
||||
export class SigninComponent implements OnInit, OnDestroy {
|
||||
password = '';
|
||||
nodeAuthType = '';
|
||||
rtlSSO = 0;
|
||||
rtlCookiePath = '';
|
||||
hintStr = '';
|
||||
accessKey = '';
|
||||
public selNodeIndex = 0;
|
||||
public password = '';
|
||||
public nodeAuthType = '';
|
||||
public rtlSSO = 0;
|
||||
public rtlCookiePath = '';
|
||||
public hintStr = '';
|
||||
public accessKey = '';
|
||||
|
||||
private unsub: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()];
|
||||
|
||||
@ -31,7 +32,8 @@ export class SigninComponent implements OnInit, OnDestroy {
|
||||
rtlStore.effectErrors.forEach(effectsErr => {
|
||||
this.logger.error(effectsErr);
|
||||
});
|
||||
this.nodeAuthType = rtlStore.appConfig.nodes[0].authentication.nodeAuthType;
|
||||
this.selNodeIndex = rtlStore.selNodeIndex;
|
||||
this.nodeAuthType = rtlStore.appConfig.nodes[this.selNodeIndex].authentication.nodeAuthType;
|
||||
this.logger.info(rtlStore);
|
||||
if (this.nodeAuthType.toUpperCase() === 'DEFAULT') {
|
||||
this.hintStr = 'Enter RPC password';
|
||||
|
@ -17,7 +17,7 @@
|
||||
</svg>
|
||||
</mat-card-content>
|
||||
<span *ngIf="information?.currency_unit; else withoutData">
|
||||
<h3 *ngIf="appConfig.nodes[0].settings?.satsToBTC; else smallerUnit1">{{blockchainBalance?.btc_total_balance | number}} {{information?.currency_unit}}</h3>
|
||||
<h3 *ngIf="settings?.satsToBTC; else smallerUnit1">{{blockchainBalance?.btc_total_balance | number}} {{information?.currency_unit}}</h3>
|
||||
<ng-template #smallerUnit1><h3>{{blockchainBalance?.total_balance | number}} {{information?.smaller_currency_unit}}</h3></ng-template>
|
||||
</span>
|
||||
</mat-card-content>
|
||||
@ -40,7 +40,7 @@
|
||||
</svg>
|
||||
</mat-card-content>
|
||||
<span *ngIf="information?.currency_unit; else withoutData">
|
||||
<h3 *ngIf="appConfig.nodes[0].settings?.satsToBTC; else smallerUnit2">{{blockchainBalance?.btc_confirmed_balance | number}} {{information?.currency_unit}}</h3>
|
||||
<h3 *ngIf="settings?.satsToBTC; else smallerUnit2">{{blockchainBalance?.btc_confirmed_balance | number}} {{information?.currency_unit}}</h3>
|
||||
<ng-template #smallerUnit2><h3>{{blockchainBalance?.confirmed_balance | number}} {{information?.smaller_currency_unit}}</h3></ng-template>
|
||||
</span>
|
||||
</mat-card-content>
|
||||
@ -63,7 +63,7 @@
|
||||
</svg>
|
||||
</mat-card-content>
|
||||
<span *ngIf="information?.currency_unit; else withoutData">
|
||||
<h3 *ngIf="appConfig.nodes[0].settings?.satsToBTC; else smallerUnit3">{{blockchainBalance?.btc_unconfirmed_balance | number}} {{information?.currency_unit}}</h3>
|
||||
<h3 *ngIf="settings?.satsToBTC; else smallerUnit3">{{blockchainBalance?.btc_unconfirmed_balance | number}} {{information?.currency_unit}}</h3>
|
||||
<ng-template #smallerUnit3><h3>{{blockchainBalance?.unconfirmed_balance | number}} {{information?.smaller_currency_unit}}</h3></ng-template>
|
||||
</span>
|
||||
</mat-card-content>
|
||||
|
@ -18,6 +18,8 @@ import * as fromRTLReducer from '../../../shared/store/rtl.reducers';
|
||||
styleUrls: ['./send-receive-trans.component.scss']
|
||||
})
|
||||
export class SendReceiveTransComponent implements OnInit, OnDestroy {
|
||||
public selNodeIndex = 0;
|
||||
public settings: Settings;
|
||||
public appConfig: RTLConfiguration;
|
||||
public addressTypes = [];
|
||||
public flgLoadingWallet: Boolean | 'error' = true;
|
||||
@ -42,6 +44,8 @@ export class SendReceiveTransComponent implements OnInit, OnDestroy {
|
||||
this.flgLoadingWallet = 'error';
|
||||
}
|
||||
});
|
||||
this.selNodeIndex = rtlStore.selNodeIndex;
|
||||
this.settings = rtlStore.appConfig.nodes[this.selNodeIndex].settings;
|
||||
this.appConfig = rtlStore.appConfig;
|
||||
this.information = rtlStore.information;
|
||||
this.addressTypes = rtlStore.addressTypes;
|
||||
|
@ -16,6 +16,7 @@ import * as fromRTLReducer from '../../store/rtl.reducers';
|
||||
styleUrls: ['./settings-nav.component.scss']
|
||||
})
|
||||
export class SettingsNavComponent implements OnInit, OnDestroy {
|
||||
public selNodeIndex = 0;
|
||||
public information: GetInfo = {};
|
||||
public settings: Settings;
|
||||
public menus = ['Vertical', 'Horizontal'];
|
||||
@ -24,6 +25,7 @@ export class SettingsNavComponent implements OnInit, OnDestroy {
|
||||
public selectedMenuType: string;
|
||||
public currencyUnit = 'BTC';
|
||||
public showSettingOption = true;
|
||||
|
||||
unsubs: Array<Subject<void>> = [new Subject(), new Subject()];
|
||||
@Output('done') done: EventEmitter<void> = new EventEmitter();
|
||||
|
||||
@ -33,7 +35,8 @@ export class SettingsNavComponent implements OnInit, OnDestroy {
|
||||
this.store.select('rtlRoot')
|
||||
.pipe(takeUntil(this.unsubs[0]))
|
||||
.subscribe((rtlStore: fromRTLReducer.State) => {
|
||||
this.settings = rtlStore.appConfig.nodes[0].settings;
|
||||
this.selNodeIndex = rtlStore.selNodeIndex;
|
||||
this.settings = rtlStore.appConfig.nodes[this.selNodeIndex].settings;
|
||||
this.selectedMenu = this.settings.menu;
|
||||
this.selectedMenuType = this.settings.menuType;
|
||||
if (window.innerWidth <= 768) {
|
||||
|
@ -20,6 +20,7 @@ export const SET_STORE = 'SET_STORE';
|
||||
export const FETCH_RTL_CONFIG = 'FETCH_RTL_CONFIG';
|
||||
export const SET_RTL_CONFIG = 'SET_RTL_CONFIG';
|
||||
export const SAVE_SETTINGS = 'SAVE_SETTINGS';
|
||||
export const SET_SEL_NODE_INDEX = 'SET_SEL_NODE_INDEX';
|
||||
export const FETCH_INFO = 'FETCH_INFO';
|
||||
export const SET_INFO = 'SET_INFO';
|
||||
export const FETCH_PEERS = 'FETCH_PEERS';
|
||||
@ -125,6 +126,11 @@ export class SaveSettings implements Action {
|
||||
constructor(public payload: Settings) {}
|
||||
}
|
||||
|
||||
export class SetSelNodeIndex implements Action {
|
||||
readonly type = SET_SEL_NODE_INDEX;
|
||||
constructor(public payload: number) {}
|
||||
}
|
||||
|
||||
export class FetchInfo implements Action {
|
||||
readonly type = FETCH_INFO;
|
||||
}
|
||||
@ -381,7 +387,7 @@ export type RTLActions =
|
||||
ClearEffectError | EffectError | OpenSpinner | CloseSpinner |
|
||||
FetchRTLConfig | SetRTLConfig | SaveSettings |
|
||||
OpenAlert | CloseAlert | OpenConfirmation | CloseConfirmation |
|
||||
FetchInfo | SetInfo |
|
||||
SetSelNodeIndex | FetchInfo | SetInfo |
|
||||
FetchPeers | SetPeers | AddPeer | DetachPeer | SaveNewPeer | RemovePeer |
|
||||
AddInvoice | SaveNewInvoice | GetForwardingHistory | SetForwardingHistory |
|
||||
FetchFees | SetFees |
|
||||
|
@ -8,6 +8,7 @@ import {
|
||||
|
||||
export interface State {
|
||||
effectErrors: ErrorPayload[];
|
||||
selNodeIndex: number;
|
||||
appConfig: RTLConfiguration;
|
||||
information: GetInfo;
|
||||
peers: Peer[];
|
||||
@ -32,6 +33,7 @@ export interface State {
|
||||
|
||||
const initialState: State = {
|
||||
effectErrors: [],
|
||||
selNodeIndex: 0,
|
||||
appConfig: {
|
||||
sso: { rtlSSO: 0, logoutRedirectLink: '/login' },
|
||||
nodes: [{
|
||||
@ -82,6 +84,11 @@ export function RTLRootReducer(state = initialState, action: RTLActions.RTLActio
|
||||
...state,
|
||||
effectErrors: [...state.effectErrors, action.payload]
|
||||
};
|
||||
case RTLActions.SET_SEL_NODE_INDEX:
|
||||
return {
|
||||
...state,
|
||||
selNodeIndex: action.payload
|
||||
};
|
||||
case RTLActions.SET_RTL_CONFIG:
|
||||
return {
|
||||
...state,
|
||||
|
Loading…
Reference in New Issue
Block a user