Config Upgrade RC
parent
9c9d4f08a0
commit
8fdba67a5d
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,30 +0,0 @@
|
|||||||
<div fxLayout="row" fxFlex="100" fxLayoutAlign="space-between center">
|
|
||||||
<div fxFlex="70" fxLayoutAlign="start start">
|
|
||||||
<div *ngFor="let menuNode of menuNodes">
|
|
||||||
<button mat-button *ngIf="undefined === menuNode.children" fxLayoutAlign="center center" class="horizontal-button" routerLinkActive="h-active-link" [routerLinkActiveOptions]="{exact: true}" routerLink="{{menuNode.link}}" (click)="onClick(menuNode)">
|
|
||||||
<fa-icon *ngIf="menuNode.iconType === 'FA'" matTooltip="{{menuNode.name}}" [icon]="menuNode.icon" class="fa-icon-small"></fa-icon>
|
|
||||||
</button>
|
|
||||||
<div *ngIf="undefined !== menuNode.children" fxLayoutAlign="start start" [matMenuTriggerFor]="childMenu">
|
|
||||||
<button mat-button class="horizontal-button" fxLayoutAlign="center center">
|
|
||||||
<fa-icon *ngIf="menuNode.iconType === 'FA'" matTooltip="{{menuNode.name}}" [icon]="menuNode.icon" class="fa-icon-small"></fa-icon>
|
|
||||||
</button>
|
|
||||||
<mat-menu #childMenu="matMenu" xPosition="after" overlapTrigger="false" class="child-menu">
|
|
||||||
<div *ngFor="let childNode of menuNode.children">
|
|
||||||
<button mat-button class="horizontal-button bg-primary px-2" fxFlex="100" fxLayoutAlign="center center" [routerLinkActive]="'h-active-link'" routerLink="{{childNode.link}}" [routerLinkActiveOptions]="{exact: true}">
|
|
||||||
<fa-icon *ngIf="childNode.iconType === 'FA'" matTooltip="{{childNode.name}}" [icon]="childNode.icon" class="fa-icon-small"></fa-icon>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</mat-menu>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div fxFlex="30" fxLayoutAlign="end center">
|
|
||||||
<mat-select fxFlex="40" *ngIf="appConfig.nodes.length > 1" [value]="selNode" (selectionChange)="onNodeSelectionChange($event.value)" class="m-2 multi-node-select">
|
|
||||||
<mat-option *ngFor="let node of appConfig.nodes" [value]="node" tabindex="19">
|
|
||||||
{{node.lnNode}} ({{node.lnImplementation}})
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
<button fxLayoutAlign="center center" mat-stroked-button color="primary" class="horizontal-button-show" tabindex="20" (click)="onShowPubkey()">Show Public Key</button>
|
|
||||||
<rtl-top-menu></rtl-top-menu>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,19 +0,0 @@
|
|||||||
.mat-menu-panel.child-menu {
|
|
||||||
min-width: 88px;
|
|
||||||
width:88px;
|
|
||||||
border-radius: 0;
|
|
||||||
margin-left: 30%;
|
|
||||||
margin-top: 6%;
|
|
||||||
.mat-menu-content {
|
|
||||||
.mat-menu-item {
|
|
||||||
padding: 0;
|
|
||||||
margin-top: -3px;
|
|
||||||
.mat-icon {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
|
|
||||||
import { HorizontalNavigationComponent } from './horizontal-navigation.component';
|
|
||||||
|
|
||||||
describe('HorizontalNavigationComponent', () => {
|
|
||||||
let component: HorizontalNavigationComponent;
|
|
||||||
let fixture: ComponentFixture<HorizontalNavigationComponent>;
|
|
||||||
|
|
||||||
beforeEach(async(() => {
|
|
||||||
TestBed.configureTestingModule({
|
|
||||||
declarations: [ HorizontalNavigationComponent ]
|
|
||||||
})
|
|
||||||
.compileComponents();
|
|
||||||
}));
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
fixture = TestBed.createComponent(HorizontalNavigationComponent);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
|
||||||
expect(component).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,102 +0,0 @@
|
|||||||
import { Component, OnInit, OnDestroy } from '@angular/core';
|
|
||||||
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';
|
|
||||||
|
|
||||||
import { RTLEffects } from '../../../../store/rtl.effects';
|
|
||||||
import * as RTLActions from '../../../../store/rtl.actions';
|
|
||||||
import * as fromRTLReducer from '../../../../store/rtl.reducers';
|
|
||||||
import { GetInfoRoot, ConfigSettingsNode, RTLConfiguration } from '../../../models/RTLconfig';
|
|
||||||
import { AlertTypeEnum } from '../../../services/consts-enums-functions';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'rtl-horizontal-navigation',
|
|
||||||
templateUrl: './horizontal-navigation.component.html',
|
|
||||||
styleUrls: ['./horizontal-navigation.component.scss']
|
|
||||||
})
|
|
||||||
export class HorizontalNavigationComponent implements OnInit, OnDestroy {
|
|
||||||
public menuNodes = [];
|
|
||||||
public logoutNode = [];
|
|
||||||
public showLogout = false;
|
|
||||||
public numPendingChannels = 0;
|
|
||||||
public appConfig: RTLConfiguration;
|
|
||||||
public selNode: ConfigSettingsNode;
|
|
||||||
public information: GetInfoRoot = {};
|
|
||||||
private unSubs = [new Subject(), new Subject(), new Subject()];
|
|
||||||
|
|
||||||
constructor(private sessionService: SessionService, private store: Store<fromRTLReducer.RTLState>, private rtlEffects: RTLEffects) {}
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
this.store.select('root')
|
|
||||||
.pipe(takeUntil(this.unSubs[0]))
|
|
||||||
.subscribe((rtlStore) => {
|
|
||||||
this.information = rtlStore.nodeData;
|
|
||||||
this.appConfig = rtlStore.appConfig;
|
|
||||||
this.selNode = rtlStore.selNode;
|
|
||||||
if(this.selNode.lnImplementation.toUpperCase() === 'CLT') {
|
|
||||||
this.menuNodes = MENU_DATA.CLChildren;
|
|
||||||
} else {
|
|
||||||
this.menuNodes = MENU_DATA.LNDChildren;
|
|
||||||
}
|
|
||||||
if(this.sessionService.getItem('token')) {
|
|
||||||
if (this.menuNodes[this.menuNodes.length - 1].id !== 200) {
|
|
||||||
this.menuNodes.push({id: 200, parentId: 0, name: 'Logout', iconType: 'FA', icon: faEject});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if(this.menuNodes[this.menuNodes.length - 1].id === 200) {
|
|
||||||
this.menuNodes.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.sessionService.watchSession()
|
|
||||||
.pipe(takeUntil(this.unSubs[1]))
|
|
||||||
.subscribe(session => {
|
|
||||||
if(session.token) {
|
|
||||||
if (this.menuNodes[this.menuNodes.length - 1].id !== 200) {
|
|
||||||
this.menuNodes.push({id: 200, parentId: 0, name: 'Logout', iconType: 'FA', icon: faEject});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if(this.menuNodes[this.menuNodes.length - 1].id === 200) {
|
|
||||||
this.menuNodes.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
onClick(node) {
|
|
||||||
if (node.name === 'Logout') {
|
|
||||||
this.store.dispatch(new RTLActions.OpenConfirmation({
|
|
||||||
data: { type: AlertTypeEnum.CONFIRM, alertTitle: 'Logout', titleMessage: 'Logout from this device?', noBtnText: 'Cancel', yesBtnText: 'Logout'
|
|
||||||
}}));
|
|
||||||
this.rtlEffects.closeConfirm
|
|
||||||
.pipe(takeUntil(this.unSubs[2]))
|
|
||||||
.subscribe(confirmRes => {
|
|
||||||
if (confirmRes) {
|
|
||||||
this.showLogout = false;
|
|
||||||
this.store.dispatch(new RTLActions.Signout());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onShowPubkey() {
|
|
||||||
this.store.dispatch(new RTLActions.ShowPubkey());
|
|
||||||
}
|
|
||||||
|
|
||||||
onNodeSelectionChange(selNodeValue: ConfigSettingsNode) {
|
|
||||||
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(completeSub => {
|
|
||||||
completeSub.next();
|
|
||||||
completeSub.complete();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -1 +1 @@
|
|||||||
export const VERSION = '0.6.2-beta';
|
export const VERSION = '0.6.4-beta';
|
Loading…
Reference in New Issue