Settings day night & app-settings completed

Settings day night & app-settings completed
pull/260/head
Shahana Farooqui 5 years ago
parent 9690222e66
commit 470ec25fe5

@ -95,10 +95,11 @@ logoutRedirectLink=/login
[Settings]
flgSidenavOpened=true
flgSidenavPinned=true
menu=Vertical
menuType=Regular
fontSize=Regular
theme=dark-blue
menu=vertical
menuType=regular
fontSize=regular-font
themeMode=night
themeColor=blue
satsToBTC=false
lndServerUrl=https://192.168.0.0:8080/v1
bitcoindConfigPath=

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

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

@ -5,9 +5,12 @@
<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.486014dd6111683683a1.css"></head>
<link rel="apple-touch-icon" sizes="180x180" href="assets/images/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon/favicon-16x16.png">
<link rel="manifest" href="assets/images/favicon/site.webmanifest">
<link rel="stylesheet" href="styles.4e596b7e78bd09404984.css"></head>
<body>
<rtl-app></rtl-app>
<script src="runtime.feee63dac552d8844834.js"></script><script src="polyfills-es5.92f4069201c83f4833ef.js" nomodule></script><script src="polyfills.5ddcccdb990eb395f306.js"></script><script src="main.bf4aafcd2364c6e5a38d.js"></script></body>
<script src="runtime.86a778115957b36fdd25.js"></script><script src="polyfills-es5.92f4069201c83f4833ef.js" nomodule></script><script src="polyfills.5ddcccdb990eb395f306.js"></script><script src="main.5276f974859f4c9d4d06.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

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

@ -1 +0,0 @@
!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:"286c4dfbd0213d219ea9",6:"f632d15c8cc4d89db350",7:"c9a17032e7cb232a7ac4"}[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()}([]);

@ -1 +0,0 @@
!function(e){function r(r){for(var n,c,i=r[0],a=r[1],f=r[2],p=0,s=[];p<i.length;p++)o[c=i[p]]&&s.push(o[c][0]),o[c]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[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=c(c.s=t[0]))}return e}var n={},o={0:0},u=[];function c(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,c),t.l=!0,t.exports}c.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,c.nc&&i.setAttribute("nonce",c.nc),i.src=function(e){return c.p+""+({}[e]||e)+"."+{1:"dc65164c2cc38ecb3ec0",6:"8f2384e487c219c3bbe9",7:"5b9eec5877f949c48a68"}[e]+".js"}(e);var a=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;a.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",a.name="ChunkLoadError",a.type=n,a.request=u,t[1](a)}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)},c.m=e,c.c=n,c.d=function(e,r,t){c.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,r){if(1&r&&(e=c(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(c.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)c.d(t,n,(function(r){return e[r]}).bind(null,n));return t},c.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(r,"a",r),r},c.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},c.p="",c.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],a=i.push.bind(i);i.push=r,i=i.slice();for(var f=0;f<i.length;f++)r(i[f]);var l=a;t()}([]);

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

@ -46,10 +46,11 @@ connect.setDefaultConfig = () => {
Settings: {
flgSidenavOpened: true,
flgSidenavPinned: true,
menu: 'Vertical',
menuType: 'Regular',
fontSize: 'Regular',
theme: 'dark-blue',
menu: 'vertical',
menuType: 'regular',
fontSize: 'regular-font',
themeMode: 'night',
themeColor: 'blue',
satsToBTC: false,
channelBackupPath: homeDir + common.path_separator + 'backup' + common.path_separator + 'node-0',
lnServerUrl: 'https://localhost:8080/v1',

@ -100,7 +100,8 @@ exports.updateUISettings = (req, res, next) => {
node.Settings.menu = req.body.updatedSettings.menu;
node.Settings.menuType = req.body.updatedSettings.menuType;
node.Settings.fontSize = req.body.updatedSettings.fontSize;
node.Settings.theme = req.body.updatedSettings.theme;
node.Settings.themeMode = req.body.updatedSettings.themeMode;
node.Settings.themeColor = req.body.updatedSettings.themeColor;
node.Settings.satsToBTC = req.body.updatedSettings.satsToBTC;
}
});
@ -125,7 +126,8 @@ exports.updateUISettings = (req, res, next) => {
settingsTemp.menu = req.body.updatedSettings.menu;
settingsTemp.menuType = req.body.updatedSettings.menuType;
settingsTemp.fontSize = req.body.updatedSettings.fontSize;
settingsTemp.theme = req.body.updatedSettings.theme;
settingsTemp.themeMode = req.body.updatedSettings.themeMode;
settingsTemp.themeColor = req.body.updatedSettings.themeColor;
settingsTemp.satsToBTC = req.body.updatedSettings.satsToBTC;
delete config.Settings;
fs.writeFileSync(RTLConfFile, ini.stringify(config));

@ -18,13 +18,15 @@ flgSidenavOpened=true
;Set by RTL
flgSidenavPinned=true
;Set by RTL
menu=Vertical
menu=vertical
;Set by RTL
menuType=Regular
menuType=regular
;Set by RTL
fontSize=Regular
fontSize=regular-font
;Set by RTL
theme=dark-blue
themeMode=night
;Set by RTL
themeColor=blue
;Set by RTL
satsToBTC=false
;Full path of the bitcoin.conf file including the file name

@ -77,10 +77,11 @@ Ensure that the follow values are correct per your config:
"Settings": {
"flgSidenavOpened": false,
"flgSidenavPinned": true,
"menu": "Vertical",
"menuType": "Regular",
"fontSize": "Regular",
"theme": "dark-pink",
"menu": "vertical",
"menuType": "regular",
"fontSize": "regular-font",
"themeMode": "night",
"themeColor": "pink",
"satsToBTC": false,
"bitcoindConfigPath": "",
"enableLogging": "true",

@ -19,10 +19,11 @@
"Settings": {
"flgSidenavOpened": "true",
"flgSidenavPinned": "true",
"menu": "Vertical",
"menuType": "Regular",
"theme": "dark-blue",
"fontSize":"Regular",
"menu": "vertical",
"menuType": "regular",
"themeMode": "night",
"themeColor": "blue",
"fontSize":"regular-font",
"satsToBTC": "false",
"channelBackupPath": "C:\\RTL\\backup\\node-1",
"bitcoindConfigPath": "<Optional: path of bitcoind.conf path if available locally>",
@ -40,9 +41,10 @@
"Settings": {
"flgSidenavOpened": "true",
"flgSidenavPinned": "true",
"menu": "Vertical",
"menuType": "Regular",
"theme": "light-teal",
"menu": "vertical",
"menuType": "regular",
"themeMode": "day",
"themeColor": "teal",
"satsToBTC": "false",
"channelBackupPath": "C:\\RTL\\backup\\node-2",
"bitcoindConfigPath": "",

@ -7,10 +7,11 @@ rtlPass=
[Settings]
flgSidenavOpened=true
flgSidenavPinned=true
menu=Vertical
menuType=Regular
fontSize=Regular
theme=dark-blue
menu=vertical
menuType=regular
fontSize=regular-font
themeMode=night
themeColor=blue
satsToBTC=false
channelBackupPath=C:\RTL\backup
bitcoindConfigPath=

@ -1,22 +1,22 @@
<div fxLayout="column" id="rtl-container" class="rtl-container" [ngClass]="[settings.theme, settings.fontSize]" [class.horizontal]="settings.menu === 'Horizontal'" [class.compact]="settings.menuType === 'Compact'" [class.mini]="settings.menuType === 'Mini'">
<div fxLayout="column" id="rtl-container" class="rtl-container" [ngClass]="[settings.themeColor, settings.themeMode, settings.fontSize]" [class.horizontal]="settings.menu === 'horizontal'" [class.compact]="settings.menuType === 'compact'" [class.mini]="settings.menuType === 'mini'">
<mat-toolbar fxLayout="row" fxLayoutAlign="space-between center" class="padding-gap-x bg-primary">
<div fxLayoutAlign="center center">
<button *ngIf="settings.menu === 'Vertical'" class="top-toolbar-icon" mat-icon-button (click)="sideNavToggle()">
<button *ngIf="settings.menu === 'vertical'" class="top-toolbar-icon" mat-icon-button (click)="sideNavToggle()">
<mat-icon>menu</mat-icon>
</button>
<button *ngIf="settings.fontSize === 'small-font' && settings.menu === 'Vertical' && settings.menuType !== 'Mini' && !smallScreen" mat-icon-button (click)="settings.flgSidenavPinned = !settings.flgSidenavPinned">
<button *ngIf="settings.fontSize === 'small-font' && settings.menu === 'vertical' && settings.menuType !== 'mini' && !smallScreen" mat-icon-button (click)="settings.flgSidenavPinned = !settings.flgSidenavPinned">
<svg class="top-toolbar-icon icon-pinned" viewBox="0 0 42 42">
<path fill="currentColor" *ngIf="!settings.flgSidenavPinned" d="M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z" />
<path fill="currentColor" *ngIf="settings.flgSidenavPinned" d="M2,5.27L3.28,4L20,20.72L18.73,22L12.8,16.07V22H11.2V16H6V14L8,12V11.27L2,5.27M16,12L18,14V16H17.82L8,6.18V4H7V2H17V4H16V12Z" />
</svg>
</button>
<button *ngIf="settings.fontSize === 'regular-font' && settings.menu === 'Vertical' && settings.menuType !== 'Mini' && !smallScreen" mat-icon-button (click)="settings.flgSidenavPinned = !settings.flgSidenavPinned">
<button *ngIf="settings.fontSize === 'regular-font' && settings.menu === 'vertical' && settings.menuType !== 'mini' && !smallScreen" mat-icon-button (click)="settings.flgSidenavPinned = !settings.flgSidenavPinned">
<svg class="top-toolbar-icon icon-pinned" viewBox="0 0 32 32">
<path fill="currentColor" *ngIf="!settings.flgSidenavPinned" d="M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z" />
<path fill="currentColor" *ngIf="settings.flgSidenavPinned" d="M2,5.27L3.28,4L20,20.72L18.73,22L12.8,16.07V22H11.2V16H6V14L8,12V11.27L2,5.27M16,12L18,14V16H17.82L8,6.18V4H7V2H17V4H16V12Z" />
</svg>
</button>
<button *ngIf="settings.fontSize === 'large-font' && settings.menu === 'Vertical' && settings.menuType !== 'Mini' && !smallScreen" mat-icon-button (click)="settings.flgSidenavPinned = !settings.flgSidenavPinned">
<button *ngIf="settings.fontSize === 'large-font' && settings.menu === 'vertical' && settings.menuType !== 'mini' && !smallScreen" mat-icon-button (click)="settings.flgSidenavPinned = !settings.flgSidenavPinned">
<svg class="top-toolbar-icon icon-pinned" viewBox="0 0 24 24">
<path fill="currentColor" *ngIf="!settings.flgSidenavPinned" d="M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z" />
<path fill="currentColor" *ngIf="settings.flgSidenavPinned" d="M2,5.27L3.28,4L20,20.72L18.73,22L12.8,16.07V22H11.2V16H6V14L8,12V11.27L2,5.27M16,12L18,14V16H17.82L8,6.18V4H7V2H17V4H16V12Z" />
@ -32,11 +32,11 @@
<rtl-top-menu></rtl-top-menu>
</div>
</mat-toolbar>
<mat-toolbar color="primary" *ngIf="settings.menu === 'Horizontal'" class="padding-gap-x horizontal-nav">
<mat-toolbar color="primary" *ngIf="settings.menu === 'horizontal'" class="padding-gap-x horizontal-nav">
<rtl-horizontal-navigation fxLayout="row" fxFlex="100" fxLayoutAlign="start center" class="h-100"></rtl-horizontal-navigation>
</mat-toolbar>
<mat-sidenav-container>
<mat-sidenav perfectScrollbar *ngIf="settings.menu === 'Vertical'" [opened]="settings.flgSidenavOpened" [mode]="(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)" fxFlex="100"></rtl-side-navigation>
</mat-sidenav>
@ -45,11 +45,8 @@
<router-outlet></router-outlet>
</div>
</mat-sidenav-content>
<mat-sidenav #settingSidenav position="end" class="settings mat-elevation-z6" mode="side">
<rtl-settings-nav (done)="settingSidenav.toggle()"></rtl-settings-nav>
</mat-sidenav>
</mat-sidenav-container>
<div class="rtl-spinner" *ngIf="undefined === settings.theme">
<div class="rtl-spinner" *ngIf="undefined === settings.themeColor">
<mat-spinner color="accent"></mat-spinner>
<h4>Loading RTL...</h4>
</div>

@ -48,7 +48,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
this.information = rtlStore.nodeData;
this.flgLoading[0] = (undefined !== this.information.identity_pubkey) ? false : true;
if (window.innerWidth <= 768) {
this.settings.menu = 'Vertical';
this.settings.menu = 'vertical';
this.settings.flgSidenavOpened = false;
this.settings.flgSidenavPinned = false;
}
@ -73,9 +73,9 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
}
}
if (
this.settings.menu === 'Horizontal' ||
this.settings.menuType === 'Compact' ||
this.settings.menuType === 'Mini') {
this.settings.menu === 'horizontal' ||
this.settings.menuType === 'compact' ||
this.settings.menuType === 'mini') {
this.settingSidenav.toggle(); // To dynamically update the width to 100% after side nav is closed
setTimeout(() => { this.settingSidenav.toggle(); }, 100);
}
@ -115,7 +115,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
@HostListener('window:resize')
public onWindowResize(): void {
if (window.innerWidth <= 768) {
this.settings.menu = 'Vertical';
this.settings.menu = 'vertical';
this.settings.flgSidenavOpened = false;
this.settings.flgSidenavPinned = false;
}

File diff suppressed because one or more lines are too long

@ -5,7 +5,7 @@ import { Store } from '@ngrx/store';
import { faTools } from '@fortawesome/free-solid-svg-icons';
import { LightningNode, RTLConfiguration, GetInfoRoot } from '../../models/RTLconfig';
import { LightningNode, Settings, RTLConfiguration, GetInfoRoot } from '../../models/RTLconfig';
import { LoggerService } from '../../services/logger.service';
import * as RTLActions from '../../../store/rtl.actions';
@ -20,18 +20,21 @@ export class AppSettingsComponent implements OnInit, OnDestroy {
public faTools = faTools;
public selNode: LightningNode;
public information: GetInfoRoot = {};
public menus = ['Vertical', 'Horizontal'];
public menuTypes = ['Regular', 'Compact', 'Mini'];
public themeModes = ['Day', 'Night'];
public menus = [{id: 'vertical', name: 'Vertical'}, {id: 'horizontal', name: 'Horizontal'}];
public menuTypes = [{id: 'regular', name: 'Regular'}, {id: 'compact', name: 'Compact'}, {id: 'mini', name: 'Mini'}];
public themeModes = [{id: 'day', name: 'Day'}, {id: 'night', name: 'Night'}];
public themeColors = ['purple-white', 'green', 'pink', 'blue'];
public fontSizes = [{id: 1, name: 'Small', class: 'small-font'}, {id: 2, name: 'Regular', class: 'regular-font'}, {id: 3, name: 'Large', class: 'large-font'}];
public selectedMenu: string;
public selectedMenuType: string;
public selectedFontSize: any;
public selectedThemeMode = 'Day';
public selectedMenu = {id: 'vertical', name: 'Vertical'};
public selectedMenuType = {id: 'regular', name: 'Regular'};
public selectedFontSize = {id: 2, name: 'Regular', class: 'regular-font'};
public selectedThemeMode = {id: 'day', name: 'Day'};
public selectedThemeColor = 'blue';
public currencyUnit = 'BTC';
public smallerCurrencyUnit = 'SATS';
public showSettingOption = true;
public appConfig: RTLConfiguration;
public previousSettings: Settings;
unsubs: Array<Subject<void>> = [new Subject(), new Subject()];
@Output('done') done: EventEmitter<void> = new EventEmitter();
@ -44,11 +47,13 @@ export class AppSettingsComponent implements OnInit, OnDestroy {
.subscribe((rtlStore) => {
this.appConfig = rtlStore.appConfig;
this.selNode = rtlStore.selNode;
this.selectedMenu = this.selNode.settings.menu;
this.selectedMenuType = this.selNode.settings.menuType;
this.selectedFontSize = this.fontSizes.filter(fontSize => fontSize.class === this.selNode.settings.fontSize)[0];
this.selectedMenu = this.menus.find(menu => menu.id === this.selNode.settings.menu);
this.selectedMenuType = this.menuTypes.find(menuType => this.selNode.settings.menuType === menuType.id);
this.selectedThemeMode = this.themeModes.find(themeMode => this.selNode.settings.themeMode === themeMode.id);
this.selectedThemeColor = this.selNode.settings.themeColor;
this.selectedFontSize = this.fontSizes.find(fontSize => fontSize.class === this.selNode.settings.fontSize);
if (window.innerWidth <= 768) {
this.selNode.settings.menu = 'Vertical';
this.selNode.settings.menu = 'vertical';
this.selNode.settings.flgSidenavOpened = false;
this.selNode.settings.flgSidenavPinned = false;
this.showSettingOption = false;
@ -56,12 +61,13 @@ export class AppSettingsComponent implements OnInit, OnDestroy {
this.information = rtlStore.nodeData;
this.smallerCurrencyUnit = (undefined !== this.information && undefined !== this.information.smaller_currency_unit) ? this.information.smaller_currency_unit : 'SATS';
this.currencyUnit = (undefined !== this.information && undefined !== this.information.currency_unit) ? this.information.currency_unit : 'BTC';
this.previousSettings = JSON.parse(JSON.stringify(this.selNode.settings));
this.logger.info(rtlStore);
});
}
public chooseMenuType() {
this.selNode.settings.menuType = this.selectedMenuType;
this.selNode.settings.menuType = this.selectedMenuType.id;
}
public chooseFontSize() {
@ -76,35 +82,37 @@ export class AppSettingsComponent implements OnInit, OnDestroy {
if(toggleField === 'menu') {
this.selNode.settings.flgSidenavOpened = (!event.checked) ? false : true;
setTimeout(() => {
this.selNode.settings.menu = (!event.checked) ? 'Horizontal' : 'Vertical';
this.selNode.settings.menu = (!event.checked) ? 'horizontal' : 'vertical';
}, 10);
} else {
this.selNode.settings[toggleField] = !this.selNode.settings[toggleField];
}
}
changeTheme(newTheme: string) {
this.selNode.settings.theme = newTheme;
changeThemeColor(newThemeColor: string) {
this.selectedThemeColor = newThemeColor;
this.selNode.settings.themeColor = newThemeColor;
}
choosethemeMode() {
chooseThemeMode() {
this.selNode.settings.themeMode = this.selectedThemeMode.id;
}
onUpdateSettings() {
this.logger.info(this.selNode.settings);
this.store.dispatch(new RTLActions.OpenSpinner('Updating Settings...'));
this.store.dispatch(new RTLActions.SaveSettings(this.selNode.settings));
this.done.emit();
}
onSelectionChange(selNodeValue: LightningNode) {
this.selNode = selNodeValue;
this.store.dispatch(new RTLActions.OpenSpinner('Updating Selected Node...'));
this.store.dispatch(new RTLActions.SetSelelectedNode({ lnNode: selNodeValue, isInitialSetup: false }));
}
onResetSettings() {
this.selNode.settings = this.previousSettings;
this.selectedMenu = this.menus.find(menu => menu.id === this.previousSettings.menu);
this.selectedMenuType = this.menuTypes.find(menuType => menuType.id === this.previousSettings.menuType);
this.selectedFontSize = this.fontSizes.find(fontSize => fontSize.class === this.previousSettings.fontSize);
this.selectedThemeMode = this.themeModes.find(themeMode => themeMode.id === this.previousSettings.themeMode);
this.selectedThemeColor = this.previousSettings.themeColor;
this.store.dispatch(new RTLActions.SetSelelectedNode({ lnNode: this.selNode, isInitialSetup: true }));
}
ngOnDestroy() {

@ -3,6 +3,7 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { faEject } from '@fortawesome/free-solid-svg-icons';
import { SessionService } from '../../../services/session.service';
import { MENU_DATA } from '../../../models/navMenu';
@ -40,7 +41,7 @@ export class HorizontalNavigationComponent implements OnInit, OnDestroy {
.pipe(takeUntil(this.unSubs[1]))
.subscribe(session => {
if(session.token) {
this.menuNodes.push({id: 200, parentId: 0, name: 'Logout', icon: 'eject'});
this.menuNodes.push({id: 200, parentId: 0, name: 'Logout', iconType: 'FA', icon: faEject});
} else {
this.menuNodes.pop();
}

File diff suppressed because one or more lines are too long

@ -34,7 +34,7 @@ export class SideNavigationComponent implements OnInit, OnDestroy {
public information: GetInfoRoot = {};
public informationChain: GetInfoChain = {};
public flgLoading = true;
public logoutNode = [{id: 200, parentId: 0, name: 'Logout', iconType: 'SVG', icon: 'logout'}];
public logoutNode = [{id: 200, parentId: 0, name: 'Logout', iconType: 'FA', icon: faEject}];
public showLogout = false;
public numPendingChannels = 0;
public smallScreen = false;

File diff suppressed because one or more lines are too long

@ -1,72 +0,0 @@
<mat-toolbar color="primary" fxLayoutAlign = "space-between center" class="">
<h4>Settings</h4>
</mat-toolbar>
<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></mat-divider>
</div>
<div *ngIf="selNode.lnImplementation !== 'CLT'">
<h4>Currency Unit</h4>
<div fxLayout="row" fxLayoutAlign="space-between center">
<span>{{currencyUnit}}</span>
<mat-slide-toggle [checked]="selNode?.settings?.satsToBTC" (change)="toggleSettings('satsToBTC')" labelPosition="before"></mat-slide-toggle>
</div>
<mat-divider class="mt-2"></mat-divider>
</div>
<div *ngIf="showSettingOption">
<h4>Menu</h4>
<mat-radio-group [(ngModel)]="selectedMenu" (change)="chooseMenu()">
<mat-radio-button *ngFor="let menu of menus" [value]="menu">{{menu}}</mat-radio-button>
</mat-radio-group>
<mat-divider class="mt-2"></mat-divider>
</div>
<h4>Menu Type</h4>
<mat-radio-group [(ngModel)]="selectedMenuType" (change)="chooseMenuType()">
<mat-radio-button *ngFor="let menuType of menuTypes" [value]="menuType">{{menuType}}</mat-radio-button>
</mat-radio-group>
<mat-divider class="mt-2"></mat-divider>
<div *ngIf="showSettingOption">
<div fxLayout="column">
<h4>Sidenav Options</h4>
<div fxLayout="row" fxLayoutAlign="space-between center">
<span>Opened</span>
<mat-slide-toggle [checked]="selNode?.settings?.flgSidenavOpened" (change)="toggleSettings('flgSidenavOpened')"
labelPosition="before"></mat-slide-toggle>
</div>
<div fxLayout="row" fxLayoutAlign="space-between center">
<span>Pinned</span>
<mat-slide-toggle [checked]="selNode?.settings?.flgSidenavPinned" (change)="toggleSettings('flgSidenavPinned')"
labelPosition="before"></mat-slide-toggle>
</div>
</div>
<mat-divider class="mt-2"></mat-divider>
</div>
<h4>Skins</h4>
<div fxLayout="row" fxLayoutAlign="start start" class="p-0">
<div class="skin dark-purple m-1px" (click)="changeTheme('purple-white-dark-theme')"></div>
<div class="skin dark-blue m-1px" (click)="changeTheme('dark-blue')"></div>
<div class="skin dark-green m-1px" (click)="changeTheme('dark-green')"></div>
<div class="skin dark-pink m-1px" (click)="changeTheme('dark-pink')"></div>
</div>
<div fxLayout="row" fxLayoutAlign="start start" class="p-0">
<div class="skin light-purple m-1px" (click)="changeTheme('purple-white-light-theme')"></div>
<div class="skin light-blue m-1px" (click)="changeTheme('light-blue')"></div>
<div class="skin light-teal m-1px" (click)="changeTheme('light-teal')"></div>
<div class="skin light-blue-gray m-1px" (click)="changeTheme('light-blue-gray')"></div>
</div>
</div>
</div>

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SettingsNavComponent } from './settings-nav.component';
describe('SettingsNavComponent', () => {
let component: SettingsNavComponent;
let fixture: ComponentFixture<SettingsNavComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SettingsNavComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SettingsNavComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -1,92 +0,0 @@
import { Component, OnInit, OnDestroy, Output, EventEmitter } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { LightningNode, RTLConfiguration, GetInfoRoot } from '../../models/RTLconfig';
import { LoggerService } from '../../services/logger.service';
import * as RTLActions from '../../../store/rtl.actions';
import * as fromRTLReducer from '../../../store/rtl.reducers';
@Component({
selector: 'rtl-settings-nav',
templateUrl: './settings-nav.component.html',
styleUrls: ['./settings-nav.component.scss']
})
export class SettingsNavComponent implements OnInit, OnDestroy {
public selNode: LightningNode;
public information: GetInfoRoot = {};
public menus = ['Vertical', 'Horizontal'];
public menuTypes = ['Regular', 'Compact', 'Mini'];
public selectedMenu: string;
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();
constructor(private logger: LoggerService, private store: Store<fromRTLReducer.RTLState>) {}
ngOnInit() {
this.store.select('root')
.pipe(takeUntil(this.unsubs[0]))
.subscribe((rtlStore) => {
this.appConfig = rtlStore.appConfig;
this.selNode = rtlStore.selNode;
this.selectedMenu = this.selNode.settings.menu;
this.selectedMenuType = this.selNode.settings.menuType;
if (window.innerWidth <= 768) {
this.selNode.settings.menu = 'Vertical';
this.selNode.settings.flgSidenavOpened = false;
this.selNode.settings.flgSidenavPinned = false;
this.showSettingOption = false;
}
this.information = rtlStore.nodeData;
this.currencyUnit = (undefined !== this.information && undefined !== this.information.currency_unit) ? this.information.currency_unit : 'BTC';
this.logger.info(rtlStore);
});
}
public chooseMenu() {
this.selNode.settings.menu = this.selectedMenu;
}
public chooseMenuType() {
this.selNode.settings.menuType = this.selectedMenuType;
}
toggleSettings(toggleField: string) {
this.selNode.settings[toggleField] = !this.selNode.settings[toggleField];
if (toggleField === 'satsToBTC') {
this.store.dispatch(new RTLActions.SetChildNodeSettings({channelBackupPath: this.selNode.settings.channelBackupPath, satsToBTC: this.selNode.settings.satsToBTC}));
this.store.dispatch(new RTLActions.SetChildNodeSettingsCL({channelBackupPath: this.selNode.settings.channelBackupPath, satsToBTC: this.selNode.settings.satsToBTC}));
}
}
changeTheme(newTheme: string) {
this.selNode.settings.theme = newTheme;
}
onClose() {
this.logger.info(this.selNode.settings);
this.store.dispatch(new RTLActions.SaveSettings(this.selNode.settings));
this.done.emit();
}
onSelectionChange(selNodeValue: LightningNode) {
this.selNode = selNodeValue;
this.store.dispatch(new RTLActions.OpenSpinner('Updating Selected Node...'));
this.store.dispatch(new RTLActions.SetSelelectedNode({ lnNode: selNodeValue, isInitialSetup: false }));
}
ngOnDestroy() {
this.unsubs.forEach(unsub => {
unsub.next();
unsub.complete();
});
}
}

File diff suppressed because one or more lines are too long

@ -4,6 +4,8 @@ import { takeUntil } from 'rxjs/operators';
import * as sha256 from 'sha256';
import { Store } from '@ngrx/store';
import { faUnlockAlt } from '@fortawesome/free-solid-svg-icons';
import { LightningNode } from '../../models/RTLconfig';
import { LoggerService } from '../../services/logger.service';
import * as fromRTLReducer from '../../../store/rtl.reducers';
@ -15,6 +17,7 @@ import * as RTLActions from '../../../store/rtl.actions';
styleUrls: ['./signin.component.scss']
})
export class SigninComponent implements OnInit, OnDestroy {
public faUnlockAlt = faUnlockAlt;
public selNode: LightningNode;
public password = '';
public nodeAuthType = '';

@ -19,7 +19,8 @@ export class Settings {
public menu: string,
public menuType: string,
public fontSize: string,
public theme: string,
public themeMode: string,
public themeColor: string,
public satsToBTC: boolean,
public bitcoindConfigPath?: string,
public enableLogging?: boolean,

@ -2,30 +2,32 @@ import { faTachometerAlt, faLink, faBolt, faExchangeAlt, faUsers, faProjectDiagr
export const MENU_DATA: MenuRootNode = {
LNDChildren: [
{id: 1, parentId: 0, name: 'Dashboard', iconType:'SVG', icon: 'dashboard', link: '/lnd/home'},
{id: 2, parentId: 0, name: 'On-chain', iconType:'SVG', icon: 'on-chain', link: '/lnd/transsendreceive'},
{id: 3, parentId: 0, name: 'Lightning', iconType:'SVG', icon: 'lightning', link: '/lnd/chnlmanage', children: [
{id: 31, parentId: 3, name: 'Transactions', iconType:'SVG', icon: 'transactions', link: '/lnd/chnlmanage'},
{id: 32, parentId: 3, name: 'Peers/Channels', iconType:'SVG', icon: 'world', link: '/lnd/chnlpending'},
{id: 33, parentId: 3, name: 'Lookup', iconType:'SVG', icon: 'lookup', link: '/lnd/chnlclosed'},
{id: 34, parentId: 3, name: 'Routing', iconType:'SVG', icon: 'routing', link: '/lnd/chnlbackup'}
{id: 1, parentId: 0, name: 'Dashboard', iconType: 'FA', icon: faTachometerAlt, link: '/lnd/home'},
{id: 2, parentId: 0, name: 'On-chain', iconType: 'FA', icon: faLink, link: '/lnd/transsendreceive'},
{id: 3, parentId: 0, name: 'Lightning', iconType: 'FA', icon: faBolt, link: '/lnd/chnlmanage', children: [
{id: 31, parentId: 3, name: 'Transactions', iconType: 'FA', icon: faExchangeAlt, link: '/lnd/chnlmanage'},
{id: 32, parentId: 3, name: 'Peers/Channels', iconType: 'FA', icon: faUsers, link: '/lnd/chnlpending'},
{id: 33, parentId: 3, name: 'Lookup', iconType: 'FA', icon: faSearch, link: '/lnd/chnlclosed'},
{id: 34, parentId: 3, name: 'Routing', iconType: 'FA', icon: faProjectDiagram, link: '/lnd/chnlbackup'}
]},
{id: 4, parentId: 0, name: 'Advanced', iconType:'SVG', icon: 'advanced', link: '/sconfig'},
{id: 5, parentId: 0, name: 'Settings', iconType:'SVG', icon: 'settings', link: '/settings'},
{id: 6, parentId: 0, name: 'Help', iconType:'SVG', icon: 'help', link: '/help'}
{id: 4, parentId: 0, name: 'Advanced', iconType: 'FA', icon: faCog, link: '/sconfig'},
{id: 5, parentId: 0, name: 'Settings', iconType: 'FA', icon: faTools, link: '/settings'},
{id: 6, parentId: 0, name: 'Help', iconType: 'FA', icon: faLifeRing, link: '/help'}
],
CLChildren: [
{id: 1, parentId: 0, name: 'Dashboard', iconType:'SVG', icon: 'dashboard', link: '/cl/home'},
{id: 2, parentId: 0, name: 'On Chain', iconType:'SVG', icon: 'on-chain', link: '/cl/onchain'},
{id: 3, parentId: 0, name: 'Lightning', iconType:'SVG', icon: 'lightning', link: '/cl/chnlmanage', children: [
{id: 31, parentId: 3, name: 'Transactions', iconType:'SVG', icon: 'transactions', link: '/cl/chnlmanage'},
{id: 32, parentId: 3, name: 'Peers/Channels', iconType:'SVG', icon: 'world', link: '/cl/peers'},
{id: 33, parentId: 3, name: 'Lookup', iconType:'SVG', icon: 'lookup', link: '/cl/lookups'},
{id: 34, parentId: 3, name: 'Routing', iconType:'SVG', icon: 'routing', link: '/cl/queryroutes'}
{id: 1, parentId: 0, name: 'Home', icon: 'home', link: '/cl/home'},
{id: 2, parentId: 0, name: 'On Chain', icon: 'account_balance_wallet', link: '/cl/onchain'},
{id: 3, parentId: 0, name: 'Peers', icon: 'group', link: '/cl/peers'},
{id: 4, parentId: 0, name: 'Channels', icon: 'settings_ethernet', link: '/cl/chnlmanage'},
{id: 5, parentId: 0, name: 'Payments', icon: 'payment', link: '/cl/paymentsend', children: [
{id: 51, parentId: 5, name: 'Send', icon: 'send', link: '/cl/paymentsend'},
{id: 52, parentId: 5, name: 'Query Routes', icon: 'explore', link: '/cl/queryroutes'}
]},
{id: 4, parentId: 0, name: 'Advanced', iconType:'SVG', icon: 'advanced', link: '/sconfig'},
{id: 5, parentId: 0, name: 'Settings', iconType:'SVG', icon: 'settings', link: '/settings'},
{id: 6, parentId: 0, name: 'Help', iconType:'SVG', icon: 'help', link: '/help'}
{id: 6, parentId: 0, name: 'Invoices', icon: 'receipt', link: '/cl/invoices'},
{id: 7, parentId: 0, name: 'Forwarding History', icon: 'timeline', link: '/cl/forwardinghistory'},
{id: 9, parentId: 0, name: 'Lookups', icon: 'search', link: '/cl/lookups'},
{id: 10, parentId: 0, name: 'Node Config', icon: 'perm_data_setting', link: '/sconfig'},
{id: 11, parentId: 0, name: 'Help', icon: 'help', link: '/help'}
]
};

@ -11,4 +11,10 @@ export class CommonService {
});
}
camelCase(str) {
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, (word, index) => {
return index == 0 ? word.toLowerCase() : word.toUpperCase();
}).replace(/\s+/g, '');
}
}

@ -25,7 +25,6 @@ import { HelpComponent } from './components/help/help.component';
import { SideNavigationComponent } from './components/navigation/side-navigation/side-navigation.component';
import { TopMenuComponent } from './components/navigation/top-menu/top-menu.component';
import { HorizontalNavigationComponent } from './components/navigation/horizontal-navigation/horizontal-navigation.component';
import { SettingsNavComponent } from './components/settings-nav/settings-nav.component';
import { ServerConfigComponent } from './components/server-config/server-config.component';
import { ErrorComponent } from './components/error/error.component';
import { ClipboardDirective } from './directive/clipboard.directive';
@ -109,7 +108,6 @@ import { RemoveLeadingZerosPipe } from './pipes/remove-leading-zero.pipe';
ConfirmationMessageComponent,
SpinnerDialogComponent,
NotFoundComponent,
SettingsNavComponent,
SideNavigationComponent,
TopMenuComponent,
HorizontalNavigationComponent,
@ -127,7 +125,6 @@ import { RemoveLeadingZerosPipe } from './pipes/remove-leading-zero.pipe';
ConfirmationMessageComponent,
SpinnerDialogComponent,
NotFoundComponent,
SettingsNavComponent,
SideNavigationComponent,
TopMenuComponent,
HorizontalNavigationComponent,

@ -0,0 +1,30 @@
@import './color-swatches/day-foreground.scss';
@import './color-swatches/day-background.scss';
@import './color-swatches/white-accent.swatch.scss';
@import './color-swatches/blue-primary.swatch.scss';
@import '~@angular/material/theming';
@include mat-core();
@function create-custom-theme($primary, $accent, $warn: mat-palette($mat-red)) {
@return (
primary: $primary,
accent: $accent,
warn: $warn,
is-dark: false,
foreground: $custom-day-theme-foreground,
background: $custom-day-theme-background
);
}
$blue-primary: mat-palette($mat-indigo, 800, 300, 900);
$blue-accent: mat-palette($mat-pink, A200, A100, A400);
$blue-warn: mat-palette($mat-red, 500);
$alternate-blue-primary: mat-palette($blue-primary, 500, 300, 900);
$alternate-blue-accent: mat-palette($white-accent, 800, 600, 900);
$alternate-blue-warn: mat-palette($mat-red);
$blue-day-theme: create-custom-theme($blue-primary, $blue-accent, $blue-warn);
$alternate-blue-day-theme: mat-light-theme($alternate-blue-primary, $alternate-blue-accent, $alternate-blue-warn);
$blue-night-theme: mat-dark-theme($blue-primary, $blue-accent, $blue-warn);
$alternate-blue-night-theme: mat-dark-theme($alternate-blue-primary, $alternate-blue-accent, $alternate-blue-warn);

@ -0,0 +1,16 @@
$custom-day-theme-background: (
status-bar: map_get($mat-grey, 300),
app-bar: map_get($mat-grey, 100),
background:map_get($mat-gray, 100),
hover: rgba(black, 0.04),
card: map_get($mat-gray, 100),
dialog: map_get($mat-gray, 100),
disabled-button: rgba(black, 0.12),
raised-button: map_get($mat-grey, 50),
focused-button: $dark-focused,
selected-button: map_get($mat-grey, 300),
selected-disabled-button: map_get($mat-grey, 400),
disabled-button-toggle: map_get($mat-grey, 200),
unselected-chip: map_get($mat-grey, 300),
disabled-list-option: map_get($mat-grey, 200),
);

@ -0,0 +1,16 @@
$custom-day-theme-foreground: (
base: black,
divider: $dark-dividers,
dividers: $dark-dividers,
disabled: $dark-disabled-text,
disabled-button: rgba(black, 0.26),
disabled-text: $dark-disabled-text,
hint-text: $dark-disabled-text,
secondary-text: $dark-secondary-text,
icon: rgba(black, 1),
icons: rgba(black, 1),
text: rgba(black, 1),
slider-min: rgba(black, 1),
slider-off: rgba(black, 0.5),
slider-off-active: rgba(black, 0.6),
);

@ -1,15 +0,0 @@
@import './color-swatches/purple-primary.swatch.scss';
@import './color-swatches/white-accent.swatch.scss';
@import './color-swatches/blue-primary.swatch.scss';
@import '~@angular/material/theming';
@include mat-core();
$blue-dark-primary: mat-palette($mat-light-blue, 700, 300, 900);
$blue-dark-accent: mat-palette($mat-amber, A100, 900, A700);
$blue-dark-warn: mat-palette($mat-red, A200);
$blue-dark-theme: mat-dark-theme($blue-dark-primary, $blue-dark-accent, $blue-dark-warn);
$alternate-blue-dark-primary: mat-palette($blue-primary, 500, 300, 900);
$alternate-blue-dark-accent: mat-palette($white-accent, 800, 600, 900);
$alternate-blue-dark-warn: mat-palette($mat-red);
$alternate-blue-dark-theme: mat-dark-theme($alternate-blue-dark-primary, $alternate-blue-dark-accent, $alternate-blue-dark-warn);

@ -1,16 +0,0 @@
@import './color-swatches/purple-primary.swatch.scss';
@import './color-swatches/white-accent.swatch.scss';
@import './color-swatches/blue-primary.swatch.scss';
@import '~@angular/material/theming';
@include mat-core();
$green-dark-primary: mat-palette($mat-teal, 800, 300, 900);
$green-dark-accent: mat-palette($mat-amber, A100, 900, A700);
$green-dark-warn: mat-palette($mat-red, A200);
$green-dark-theme: mat-dark-theme($green-dark-primary, $green-dark-accent, $green-dark-warn);
$alternate-green-dark-primary: mat-palette($blue-primary, 500, 300, 900);
$alternate-green-dark-accent: mat-palette($white-accent, 800, 600, 900);
$alternate-green-dark-warn: mat-palette($mat-red);
$alternate-green-dark-theme: mat-dark-theme($alternate-green-dark-primary, $alternate-green-dark-accent, $alternate-green-dark-warn);

@ -1,15 +0,0 @@
@import './color-swatches/purple-primary.swatch.scss';
@import './color-swatches/white-accent.swatch.scss';
@import './color-swatches/blue-primary.swatch.scss';
@import '~@angular/material/theming';
@include mat-core();
$pink-dark-primary: mat-palette($mat-pink, 700, 400, 900);
$pink-dark-accent: mat-palette($mat-blue-grey, 700, 500, 900);
$pink-dark-warn: mat-palette($mat-red, A200);
$pink-dark-theme: mat-dark-theme($pink-dark-primary, $pink-dark-accent, $pink-dark-warn);
$alternate-pink-dark-primary: mat-palette($blue-primary, 500, 300, 900);
$alternate-pink-dark-accent: mat-palette($white-accent, 800, 600, 900);
$alternate-pink-dark-warn: mat-palette($mat-red);
$alternate-pink-dark-theme: mat-dark-theme($alternate-pink-dark-primary, $alternate-pink-dark-accent, $alternate-pink-dark-warn);

@ -1,15 +0,0 @@
@import './color-swatches/purple-primary.swatch.scss';
@import './color-swatches/white-accent.swatch.scss';
@import './color-swatches/blue-primary.swatch.scss';
@import '~@angular/material/theming';
@include mat-core();
$purple-white-dark-primary: mat-palette($purple-primary, 500, 400, 700);
$purple-white-dark-accent: mat-palette($white-accent, 800, 600, 900);
$purple-white-dark-warn: mat-palette($mat-red);
$purple-white-dark-theme: mat-dark-theme($purple-white-dark-primary, $purple-white-dark-accent, $purple-white-dark-warn);
$alternate-purple-white-dark-primary: mat-palette($blue-primary, 500, 300, 900);
$alternate-purple-white-dark-accent: mat-palette($white-accent, 800, 600, 900);
$alternate-purple-white-dark-warn: mat-palette($mat-red);
$alternate-purple-white-dark-theme: mat-dark-theme($alternate-purple-white-dark-primary, $alternate-purple-white-dark-accent, $alternate-purple-white-dark-warn);

@ -0,0 +1,31 @@
@import './color-swatches/day-foreground.scss';
@import './color-swatches/day-background.scss';
@import './color-swatches/white-accent.swatch.scss';
@import './color-swatches/blue-primary.swatch.scss';
@import '~@angular/material/theming';
@include mat-core();
@function create-custom-theme($primary, $accent, $warn: mat-palette($mat-red)) {
@return (
primary: $primary,
accent: $accent,
warn: $warn,
is-dark: false,
foreground: $custom-day-theme-foreground,
background: $custom-day-theme-background
);
}
$green-primary: mat-palette($mat-teal, 800, 300, 900);
$green-accent: mat-palette($mat-amber, A200, A100, A700);
$green-warn: mat-palette($mat-red, A200);
$alternate-green-primary: mat-palette($blue-primary, 500, 300, 900);
$alternate-green-accent: mat-palette($white-accent, 800, 600, 900);
$alternate-green-warn: mat-palette($mat-red);
$green-day-theme: create-custom-theme($green-primary, $green-accent, $green-warn);
$alternate-green-day-theme: mat-light-theme($alternate-green-primary, $alternate-green-accent, $alternate-green-warn);
$green-night-theme: mat-dark-theme($green-primary, $green-accent, $green-warn);
$alternate-green-night-theme: mat-dark-theme($alternate-green-primary, $alternate-green-accent, $alternate-green-warn);

@ -1,60 +0,0 @@
@import './color-swatches/purple-primary.swatch.scss';
@import './color-swatches/white-accent.swatch.scss';
@import './color-swatches/blue-primary.swatch.scss';
@import '~@angular/material/theming';
@include mat-core();
$custom-light-theme-background: (
status-bar: map_get($mat-grey, 300),
app-bar: map_get($mat-grey, 100),
background:map_get($mat-gray, 100),
hover: rgba(black, 0.04),
card: map_get($mat-gray, 100),
dialog: map_get($mat-gray, 100),
disabled-button: rgba(black, 0.12),
raised-button: map_get($mat-grey, 50),
focused-button: $dark-focused,
selected-button: map_get($mat-grey, 300),
selected-disabled-button: map_get($mat-grey, 400),
disabled-button-toggle: map_get($mat-grey, 200),
unselected-chip: map_get($mat-grey, 300),
disabled-list-option: map_get($mat-grey, 200),
);
$custom-light-theme-foreground: (
base: black,
divider: $dark-dividers,
dividers: $dark-dividers,
disabled: $dark-disabled-text,
disabled-button: rgba(black, 0.26),
disabled-text: $dark-disabled-text,
hint-text: $dark-disabled-text,
secondary-text: $dark-secondary-text,
icon: rgba(black, 1),
icons: rgba(black, 1),
text: rgba(black, 1),
slider-min: rgba(black, 1),
slider-off: rgba(black, 0.5),
slider-off-active: rgba(black, 0.6),
);
@function create-custom-theme($primary, $accent, $warn: mat-palette($mat-red)) {
@return (
primary: $primary,
accent: $accent,
warn: $warn,
is-dark: false,
foreground: $custom-light-theme-foreground,
background: $custom-light-theme-background
);
}
$blue-light-primary: mat-palette($mat-indigo, 800, 300, 900);
$blue-light-accent: mat-palette($mat-pink, A200, A100, A400);
$blue-light-warn: mat-palette($mat-red, 500);
$blue-light-theme: create-custom-theme($blue-light-primary, $blue-light-accent, $blue-light-warn);
$alternate-blue-light-primary: mat-palette($blue-primary, 500, 300, 900);
$alternate-blue-light-accent: mat-palette($white-accent, 800, 600, 900);
$alternate-blue-light-warn: mat-palette($mat-red);
$alternate-blue-light-theme: mat-dark-theme($alternate-blue-light-primary, $alternate-blue-light-accent, $alternate-blue-light-warn);

@ -1,60 +0,0 @@
@import './color-swatches/purple-primary.swatch.scss';
@import './color-swatches/white-accent.swatch.scss';
@import './color-swatches/blue-primary.swatch.scss';
@import '~@angular/material/theming';
@include mat-core();
$custom-light-theme-background: (
status-bar: map_get($mat-grey, 300),
app-bar: map_get($mat-grey, 100),
background:map_get($mat-gray, 100),
hover: rgba(black, 0.04),
card: map_get($mat-gray, 100),
dialog: map_get($mat-gray, 100),
disabled-button: rgba(black, 0.12),
raised-button: map_get($mat-grey, 50),
focused-button: $dark-focused,
selected-button: map_get($mat-grey, 300),
selected-disabled-button: map_get($mat-grey, 400),
disabled-button-toggle: map_get($mat-grey, 200),
unselected-chip: map_get($mat-grey, 300),
disabled-list-option: map_get($mat-grey, 200),
);
$custom-light-theme-foreground: (
base: black,
divider: $dark-dividers,
dividers: $dark-dividers,
disabled: $dark-disabled-text,
disabled-button: rgba(black, 0.26),
disabled-text: $dark-disabled-text,
hint-text: $dark-disabled-text,
secondary-text: $dark-secondary-text,
icon: rgba(black, 1),
icons: rgba(black, 1),
text: rgba(black, 1),
slider-min: rgba(black, 1),
slider-off: rgba(black, 0.5),
slider-off-active: rgba(black, 0.6),
);
@function create-custom-theme($primary, $accent, $warn: mat-palette($mat-red)) {
@return (
primary: $primary,
accent: $accent,
warn: $warn,
is-dark: false,
foreground: $custom-light-theme-foreground,
background: $custom-light-theme-background
);
}
$blue-gray-light-primary: mat-palette($mat-blue-gray, 800, 200, 900);
$blue-gray-light-accent: mat-palette($mat-green, 600, 300, 900);
$blue-gray-light-warn: mat-palette($mat-red, A400);
$blue-gray-light-theme: create-custom-theme($blue-gray-light-primary, $blue-gray-light-accent, $blue-gray-light-warn);
$alternate-blue-gray-light-primary: mat-palette($blue-primary, 500, 300, 900);
$alternate-blue-gray-light-accent: mat-palette($white-accent, 800, 600, 900);
$alternate-blue-gray-light-warn: mat-palette($mat-red);
$alternate-blue-gray-light-theme: mat-dark-theme($alternate-blue-gray-light-primary, $alternate-blue-gray-light-accent, $alternate-blue-gray-light-warn);

@ -1,15 +0,0 @@
@import './color-swatches/purple-primary.swatch.scss';
@import './color-swatches/white-accent.swatch.scss';
@import './color-swatches/blue-primary.swatch.scss';
@import '~@angular/material/theming';
@include mat-core();
$purple-white-light-primary: mat-palette($purple-primary, 500, 400, 700);
$purple-white-light-accent: mat-palette($white-accent, 800, 600, 900);
$purple-white-light-warn: mat-palette($mat-red);
$purple-white-light-theme: mat-light-theme($purple-white-light-primary, $purple-white-light-accent, $purple-white-light-warn);
$alternate-purple-white-light-primary: mat-palette($blue-primary, 500, 300, 900);
$alternate-purple-white-light-accent: mat-palette($white-accent, 800, 600, 900);
$alternate-purple-white-light-warn: mat-palette($mat-red);
$alternate-purple-white-light-theme: mat-light-theme($alternate-purple-white-light-primary, $alternate-purple-white-light-accent, $alternate-purple-white-light-warn);

@ -1,60 +0,0 @@
@import './color-swatches/purple-primary.swatch.scss';
@import './color-swatches/white-accent.swatch.scss';
@import './color-swatches/blue-primary.swatch.scss';
@import '~@angular/material/theming';
@include mat-core();
$custom-light-theme-background: (
status-bar: map_get($mat-grey, 300),
app-bar: map_get($mat-grey, 100),
background:map_get($mat-gray, 100),
hover: rgba(black, 0.04),
card: map_get($mat-gray, 100),
dialog: map_get($mat-gray, 100),
disabled-button: rgba(black, 0.12),
raised-button: map_get($mat-grey, 50),
focused-button: $dark-focused,
selected-button: map_get($mat-grey, 300),
selected-disabled-button: map_get($mat-grey, 400),
disabled-button-toggle: map_get($mat-grey, 200),
unselected-chip: map_get($mat-grey, 300),
disabled-list-option: map_get($mat-grey, 200),
);
$custom-light-theme-foreground: (
base: black,
divider: $dark-dividers,
dividers: $dark-dividers,
disabled: $dark-disabled-text,
disabled-button: rgba(black, 0.26),
disabled-text: $dark-disabled-text,
hint-text: $dark-disabled-text,
secondary-text: $dark-secondary-text,
icon: rgba(black, 1),
icons: rgba(black, 1),
text: rgba(black, 1),
slider-min: rgba(black, 1),
slider-off: rgba(black, 0.5),
slider-off-active: rgba(black, 0.6),
);
@function create-custom-theme($primary, $accent, $warn: mat-palette($mat-red)) {
@return (
primary: $primary,
accent: $accent,
warn: $warn,
is-dark: false,
foreground: $custom-light-theme-foreground,
background: $custom-light-theme-background
);
}
$teal-light-primary: mat-palette($mat-teal, 800, 300, 900);
$teal-light-accent: mat-palette($mat-amber, A200, A100, A700);
$teal-light-warn: mat-palette($mat-red, A200);
$teal-light-theme: create-custom-theme($teal-light-primary, $teal-light-accent, $teal-light-warn);
$alternate-teal-light-primary: mat-palette($blue-primary, 500, 300, 900);
$alternate-teal-light-accent: mat-palette($white-accent, 800, 600, 900);
$alternate-teal-light-warn: mat-palette($mat-red);
$alternate-teal-light-theme: mat-dark-theme($alternate-teal-light-primary, $alternate-teal-light-accent, $alternate-teal-light-warn);

@ -0,0 +1,17 @@
@import './color-swatches/white-accent.swatch.scss';
@import './color-swatches/blue-primary.swatch.scss';
@import '~@angular/material/theming';
@include mat-core();
$pink-primary: mat-palette($mat-pink, 700, 400, 900);
$pink-accent: mat-palette($mat-blue-grey, 700, 500, 900);
$pink-warn: mat-palette($mat-red, A200);
$alternate-pink-primary: mat-palette($blue-primary, 500, 300, 900);
$alternate-pink-accent: mat-palette($white-accent, 800, 600, 900);
$alternate-pink-warn: mat-palette($mat-red);
$pink-day-theme: mat-light-theme($pink-primary, $pink-accent, $pink-warn);
$alternate-pink-day-theme: mat-light-theme($alternate-pink-primary, $alternate-pink-accent, $alternate-pink-warn);
$pink-night-theme: mat-dark-theme($pink-primary, $pink-accent, $pink-warn);
$alternate-pink-night-theme: mat-dark-theme($alternate-pink-primary, $alternate-pink-accent, $alternate-pink-warn);

@ -0,0 +1,18 @@
@import './color-swatches/purple-primary.swatch.scss';
@import './color-swatches/white-accent.swatch.scss';
@import './color-swatches/blue-primary.swatch.scss';
@import '~@angular/material/theming';
@include mat-core();
$purple-white-primary: mat-palette($purple-primary, 500, 400, 700);
$purple-white-accent: mat-palette($white-accent, 800, 600, 900);
$purple-white-warn: mat-palette($mat-red);
$alternate-purple-white-primary: mat-palette($blue-primary, 500, 300, 900);
$alternate-purple-white-accent: mat-palette($white-accent, 800, 600, 900);
$alternate-purple-white-warn: mat-palette($mat-red);
$purple-white-day-theme: mat-light-theme($purple-white-primary, $purple-white-accent, $purple-white-warn);
$alternate-purple-white-day-theme: mat-light-theme($alternate-purple-white-primary, $alternate-purple-white-accent, $alternate-purple-white-warn);
$purple-white-night-theme: mat-dark-theme($purple-white-primary, $purple-white-accent, $purple-white-warn);
$alternate-purple-white-night-theme: mat-dark-theme($alternate-purple-white-primary, $alternate-purple-white-accent, $alternate-purple-white-warn);

@ -2,6 +2,7 @@
@mixin change-theme($theme, $alternate-theme) {
$primary: map-get($theme, primary);
$primary-lighter: mat-color(mat-palette($primary, lighter));
$primary-darker: mat-color(mat-palette($primary, darker));
$primary-node-toolbar : mat-color(mat-palette($primary, A700));
$accent: map-get($theme, accent);
@ -39,6 +40,20 @@
@include _mat-toolbar-color($alternate-primary);
}
&.night {
.selected-color {
border-color: $primary-lighter;
}
}
&.day {
.ng-fa-icon, .mat-nested-tree-node-parent .mat-icon {
color: rgba(0, 0, 0, 0.6);
}
.selected-color {
border-color: $primary-darker;
}
}
&.small-font {
.mr-4 {
margin-right: 1rem !important;
@ -204,6 +219,9 @@
color: mat-color($primary);
cursor: pointer;
background: rgba(0, 0, 0, 0.04);
& .ng-fa-icon, & .mat-icon {
color: mat-color($primary);
}
& .sidenav-img svg {
fill: mat-color($primary);
}

@ -573,8 +573,13 @@ body {
height: 4rem;
border-radius: 50%;
margin-right: 1rem;
cursor: pointer;
&.purple{
cursor: pointer;
&.selected-color {
width: 3.75rem;
height: 3.75rem;
border: 0.25rem solid;
}
&.purple-white{
background-color: #5e4ea5;
}
&.blue{

@ -4,70 +4,60 @@
@import 'typography';
.rtl-container{
&.purple-white-light-theme {
@debug "PURPLE LIGHT THEME";
@import "../skins/light-purple";
@include angular-material-theme($purple-white-light-theme);
@include change-theme($purple-white-light-theme, $alternate-purple-white-light-theme);
&.small-font {@include mat-core($small-typography);}
&.regular-font {@include mat-core($regular-typography);}
&.large-font {@include mat-core($large-typography);}
}
&.purple-white-dark-theme {
@debug "PURPLE DARK THEME";
@import "../skins/dark-purple";
@include angular-material-theme($purple-white-dark-theme);
@include change-theme($purple-white-dark-theme, $alternate-purple-white-dark-theme);
&.small-font {@include mat-core($small-typography);}
&.regular-font {@include mat-core($regular-typography);}
&.large-font {@include mat-core($large-typography);}
}
&.light-blue{
@import "../skins/light-blue";
@include angular-material-theme($blue-light-theme);
@include change-theme($blue-light-theme, $alternate-blue-light-theme);
&.purple-white {
@import "../skins/purple-white";
&.small-font {@include mat-core($small-typography);}
&.regular-font {@include mat-core($regular-typography);}
&.large-font {@include mat-core($large-typography);}
}
&.light-teal{
@import "../skins/light-teal";
@include angular-material-theme($teal-light-theme);
@include change-theme($teal-light-theme, $alternate-teal-light-theme);
&.day {
@include angular-material-theme($purple-white-day-theme);
@include change-theme($purple-white-day-theme, $alternate-purple-white-day-theme);
}
&.night {
@include angular-material-theme($purple-white-night-theme);
@include change-theme($purple-white-night-theme, $alternate-purple-white-night-theme);
}
}
&.blue{
@import "../skins/blue";
&.small-font {@include mat-core($small-typography);}
&.regular-font {@include mat-core($regular-typography);}
&.large-font {@include mat-core($large-typography);}
}
&.light-blue-gray{
@import "../skins/light-bluegray";
@include angular-material-theme($blue-gray-light-theme);
@include change-theme($blue-gray-light-theme, $alternate-blue-gray-light-theme);
&.day {
@include angular-material-theme($blue-day-theme);
@include change-theme($blue-day-theme, $alternate-blue-day-theme);
}
&.night {
@include angular-material-theme($blue-night-theme);
@include change-theme($blue-night-theme, $alternate-blue-night-theme);
}
}
&.green{
@import "../skins/green";
&.small-font {@include mat-core($small-typography);}
&.regular-font {@include mat-core($regular-typography);}
&.large-font {@include mat-core($large-typography);}
}
&.dark-blue{
@import "../skins/dark-blue";
@include angular-material-theme($blue-dark-theme);
@include change-theme($blue-dark-theme, $alternate-blue-dark-theme);
&.small-font {@include mat-core($small-typography);}
&.regular-font {@include mat-core($regular-typography);}
&.large-font {@include mat-core($large-typography);}
}
&.dark-green{
@import "../skins/dark-green";
@include angular-material-theme($green-dark-theme);
@include change-theme($green-dark-theme, $alternate-green-dark-theme);
&.small-font {@include mat-core($small-typography);}
&.regular-font {@include mat-core($regular-typography);}
&.large-font {@include mat-core($large-typography);}
}
&.dark-pink{
@import "../skins/dark-pink";
@include angular-material-theme($pink-dark-theme);
@include change-theme($pink-dark-theme, $alternate-pink-dark-theme);
&.day {
@include angular-material-theme($green-day-theme);
@include change-theme($green-day-theme, $alternate-green-day-theme);
}
&.night {
@include angular-material-theme($green-night-theme);
@include change-theme($green-night-theme, $alternate-green-night-theme);
}
}
&.pink{
@import "../skins/pink";
&.small-font {@include mat-core($small-typography);}
&.regular-font {@include mat-core($regular-typography);}
&.large-font {@include mat-core($large-typography);}
&.day {
@include angular-material-theme($pink-day-theme);
@include change-theme($pink-day-theme, $alternate-pink-day-theme);
}
&.night {
@include angular-material-theme($pink-night-theme);
@include change-theme($pink-night-theme, $alternate-pink-night-theme);
}
}
}

@ -5,7 +5,6 @@ import { Store } from '@ngrx/store';
import { Actions, Effect, ofType } from '@ngrx/effects';
import { of, Subject } from 'rxjs';
import { map, mergeMap, catchError, take, withLatestFrom } from 'rxjs/operators';
import { Location } from '@angular/common';
import { MatDialog } from '@angular/material';
@ -34,8 +33,7 @@ export class RTLEffects implements OnDestroy {
private logger: LoggerService,
private sessionService: SessionService,
public dialog: MatDialog,
private router: Router,
private location: Location) { }
private router: Router) { }
@Effect({ dispatch: false })
openSpinner = this.actions$.pipe(
@ -104,18 +102,31 @@ export class RTLEffects implements OnDestroy {
};
},
catchError((err) => {
this.logger.error(err);
this.store.dispatch(new RTLActions.EffectErrorRoot({ action: 'FetchRTLConfig', code: err.status, message: err.error.error }));
return of();
this.handleErrorWithoutAlert('FetchRTLConfig', err);
return of({type: RTLActions.VOID});
})
));
@Effect({ dispatch: false })
@Effect()
settingSave = this.actions$.pipe(
ofType(RTLActions.SAVE_SETTINGS),
mergeMap((action: RTLActions.SaveSettings) => {
this.store.dispatch(new RTLActions.ClearEffectErrorRoot('UpdateSettings'));
return this.httpClient.post<Settings>(environment.CONF_API, { updatedSettings: action.payload });
}
}),
map((updateStatus: any) => {
this.store.dispatch(new RTLActions.CloseSpinner());
this.logger.info(updateStatus);
return {
type: RTLActions.OPEN_ALERT,
payload: { data: { type: 'SUCCESS', titleMessage: updateStatus.message } }
};
},
catchError((err) => {
this.store.dispatch(new RTLActions.EffectErrorRoot({ action: 'UpdateSettings', code: err.status, message: err.error.error }));
this.handleErrorWithAlert('ERROR', 'Update Settings Failed!', environment.CONF_API, err);
return of({type: RTLActions.VOID});
})
));
@Effect()
@ -133,16 +144,9 @@ export class RTLEffects implements OnDestroy {
};
}),
catchError((err: any) => {
this.store.dispatch(new RTLActions.CloseSpinner());
this.logger.error(err);
this.store.dispatch(new RTLActions.EffectErrorRoot({ action: 'fetchConfig', code: err.status, message: err.error.error }));
return of(
{
type: RTLActions.OPEN_ALERT,
payload: { width: '70%', data: {type: 'ERROR', titleMessage: 'Fetch Config Failed!',
message: JSON.stringify({Code: err.status, Message: err.error.error})}}
}
);
this.handleErrorWithAlert('ERROR', 'Fetch Config Failed!', environment.CONF_API + '/config/' + action.payload, err);
return of({type: RTLActions.VOID});
}
));
})
@ -176,10 +180,8 @@ export class RTLEffects implements OnDestroy {
};
}),
catchError((err) => {
this.store.dispatch(new RTLActions.OpenAlert({ width: '70%', data: {type: 'ERROR', titleMessage: 'Authorization Failed',
message: JSON.stringify({Code: err.status, Message: err.error.error})}}));
this.store.dispatch(new RTLActions.EffectErrorRoot({ action: 'IsAuthorized', code: err.status, message: err.error.message }));
this.logger.error(err.error);
this.handleErrorWithAlert('ERROR', 'Authorization Failed', environment.AUTHENTICATE_API, err);
return of({
type: RTLActions.IS_AUTHORIZED_RES,
payload: 'ERROR'
@ -214,16 +216,15 @@ export class RTLEffects implements OnDestroy {
this.store.dispatch(new RTLActions.SetSelelectedNode({lnNode: rootStore.selNode, isInitialSetup: true}))
}),
catchError((err) => {
this.store.dispatch(new RTLActions.OpenAlert({ width: '70%', data: {type: 'ERROR', message: JSON.stringify(err.error)}}));
this.store.dispatch(new RTLActions.EffectErrorRoot({ action: 'Signin', code: err.status, message: err.error.message }));
this.logger.error(err.error);
this.handleErrorWithAlert('ERROR', 'Authorization Failed!', environment.AUTHENTICATE_API, err.error);
this.logger.info('Redirecting to Signin Error Page');
if (+rootStore.appConfig.sso.rtlSSO) {
this.router.navigate(['/error'], { state: { errorCode: '401', errorMessage: 'Single Sign On Failed!' }});
} else {
this.router.navigate([rootStore.appConfig.sso.logoutRedirectLink]);
}
return of();
return of({type: RTLActions.VOID});
})
);
}));
@ -259,17 +260,9 @@ export class RTLEffects implements OnDestroy {
return { type: RTLActions.VOID };
}),
catchError((err: any) => {
this.store.dispatch(new RTLActions.CloseSpinner());
this.store.dispatch(new RTLActions.EffectErrorRoot({ action: 'UpdateSelNode', code: err.status, message: err.error.message }));
this.logger.error(err);
return of(
{
type: RTLActions.OPEN_ALERT,
payload: { width: '70%', data: {type: 'ERROR', titleMessage: 'Update Selected Node Failed!',
message: JSON.stringify({code: err.status, Message: err.error.error})
}}
}
);
this.store.dispatch(new RTLActions.EffectErrorRoot({ action: 'UpdateSelNode', code: err.status, message: err.error.message }));
this.handleErrorWithAlert('ERROR', 'Update Selected Node Failed!', environment.CONF_API + '/updateSelNode', err);
return of({type: RTLActions.VOID});
})
);
}
@ -302,6 +295,32 @@ export class RTLEffects implements OnDestroy {
}
}
handleErrorWithoutAlert(actionName: string, err: { status: number, error: any }) {
this.logger.error('ERROR IN: ' + actionName + '\n' + JSON.stringify(err));
if (err.status === 401) {
this.logger.info('Redirecting to Signin');
this.store.dispatch(new RTLActions.Signout());
} else {
this.store.dispatch(new RTLActions.EffectErrorRoot({ action: actionName, code: err.status.toString(), message: err.error.error }));
}
}
handleErrorWithAlert(alertType: string, alertTitle: string, errURL: string, err: { status: number, error: any }) {
this.logger.error(err);
if (err.status === 401) {
this.logger.info('Redirecting to Signin');
this.store.dispatch(new RTLActions.Signout());
} else {
this.store.dispatch(new RTLActions.CloseSpinner());
this.store.dispatch(new RTLActions.OpenAlert({
width: '70%', data: {
type: alertType, titleMessage: alertTitle,
message: JSON.stringify({ code: err.status, Message: err.error.error, URL: errURL })
}
}));
}
}
ngOnDestroy() {
this.unSubs.forEach(completeSub => {
completeSub.next();

@ -13,7 +13,7 @@ export interface RootState {
nodeData: GetInfoRoot
}
const initNodeSettings = { flgSidenavOpened: true, flgSidenavPinned: true, menu: 'Vertical', menuType: 'Regular', fontSize: 'regular-font', theme: 'dark-blue', satsToBTC: false, channelBackupPath: '' };
const initNodeSettings = { flgSidenavOpened: true, flgSidenavPinned: true, menu: 'vertical', menuType: 'regular', fontSize: 'regular-font', themeMode: 'night', themeColor: 'blue', satsToBTC: false, channelBackupPath: '' };
const initNodeAuthentication = { nodeAuthType: 'CUSTOM', configPath: '', bitcoindConfigPath: '' };
const initRootState: RootState = {

Loading…
Cancel
Save