|
|
|
@ -8,9 +8,9 @@ import { openAlert } from '../../../store/rtl.actions';
|
|
|
|
|
|
|
|
|
|
import { RTLEffects } from '../../../store/rtl.effects';
|
|
|
|
|
import { IsAuthorizedComponent } from '../../components/data-modal/is-authorized/is-authorized.component';
|
|
|
|
|
import { ConfigSettingsNode } from '../../models/RTLconfig';
|
|
|
|
|
import { ConfigSettingsNode, RTLConfiguration } from '../../models/RTLconfig';
|
|
|
|
|
import { RTLState } from '../../../store/rtl.state';
|
|
|
|
|
import { rootSelectedNode } from '../../../store/rtl.selector';
|
|
|
|
|
import { rootAppConfig, rootSelectedNode } from '../../../store/rtl.selector';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'rtl-node-config',
|
|
|
|
@ -21,11 +21,12 @@ export class NodeConfigComponent implements OnInit, OnDestroy {
|
|
|
|
|
|
|
|
|
|
public faTools = faTools;
|
|
|
|
|
public showLnConfig = false;
|
|
|
|
|
public appConfig: RTLConfiguration;
|
|
|
|
|
public selNode: ConfigSettingsNode | any;
|
|
|
|
|
public lnImplementationStr = '';
|
|
|
|
|
public links = [{ link: 'nodesettings', name: 'Node Settings' }, { link: 'pglayout', name: 'Page Layout' }, { link: 'services', name: 'Services' }, { link: 'experimental', name: 'Experimental' }, { link: 'lnconfig', name: this.lnImplementationStr }];
|
|
|
|
|
public activeLink = '';
|
|
|
|
|
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()];
|
|
|
|
|
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject()];
|
|
|
|
|
|
|
|
|
|
constructor(private store: Store<RTLState>, private router: Router, private rtlEffects: RTLEffects, private activatedRoute: ActivatedRoute) { }
|
|
|
|
|
|
|
|
|
@ -39,7 +40,10 @@ export class NodeConfigComponent implements OnInit, OnDestroy {
|
|
|
|
|
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[1])).subscribe((selNode) => {
|
|
|
|
|
this.store.select(rootAppConfig).pipe(takeUntil(this.unSubs[1])).subscribe((appConfig) => {
|
|
|
|
|
this.appConfig = appConfig;
|
|
|
|
|
});
|
|
|
|
|
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[2])).subscribe((selNode) => {
|
|
|
|
|
this.showLnConfig = false;
|
|
|
|
|
this.selNode = selNode;
|
|
|
|
|
switch (this.selNode.lnImplementation?.toUpperCase()) {
|
|
|
|
@ -63,20 +67,25 @@ export class NodeConfigComponent implements OnInit, OnDestroy {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showLnConfigClicked() {
|
|
|
|
|
this.store.dispatch(openAlert({
|
|
|
|
|
payload: {
|
|
|
|
|
maxWidth: '50rem',
|
|
|
|
|
data: {
|
|
|
|
|
component: IsAuthorizedComponent
|
|
|
|
|
if (!this.appConfig.sso.rtlSSO) {
|
|
|
|
|
this.store.dispatch(openAlert({
|
|
|
|
|
payload: {
|
|
|
|
|
maxWidth: '50rem',
|
|
|
|
|
data: {
|
|
|
|
|
component: IsAuthorizedComponent
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}));
|
|
|
|
|
this.rtlEffects.closeAlert.pipe(takeUntil(this.unSubs[1])).subscribe((alertRes) => {
|
|
|
|
|
if (alertRes) {
|
|
|
|
|
this.activeLink = this.links[4].link;
|
|
|
|
|
this.router.navigate(['./' + this.activeLink], { relativeTo: this.activatedRoute });
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}));
|
|
|
|
|
this.rtlEffects.closeAlert.pipe(takeUntil(this.unSubs[3])).subscribe((alertRes) => {
|
|
|
|
|
if (alertRes) {
|
|
|
|
|
this.activeLink = this.links[4].link;
|
|
|
|
|
this.router.navigate(['./' + this.activeLink], { relativeTo: this.activatedRoute });
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.activeLink = this.links[4].link;
|
|
|
|
|
this.router.navigate(['./' + this.activeLink], { relativeTo: this.activatedRoute });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnDestroy() {
|
|
|
|
|