Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI for Block Explorer Configuration #1385

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/controllers/shared/RTLConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export const updateSelectedNode = (req, res, next) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'RTLConf', msg: 'Updating Selected Node..' });
const selNodeIndex = req.params.currNodeIndex ? +req.params.currNodeIndex : common.selectedNode ? +common.selectedNode.index : 1;
req.session.selectedNode = common.findNode(selNodeIndex);
common.selectedNode = req.session.selectedNode;
if (req.headers && req.headers.authorization && req.headers.authorization !== '') {
wsServer.updateLNWSClientDetails(req.session.id, +req.session.selectedNode.index, +req.params.prevNodeIndex);
if (req.params.prevNodeIndex !== '-1') {
Expand Down
2 changes: 1 addition & 1 deletion frontend/index.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/main.6a8227167750bd90.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/main.8b675cfcbcee9061.js

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions server/controllers/shared/RTLConf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const updateSelectedNode = (req, res, next) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'RTLConf', msg: 'Updating Selected Node..' });
const selNodeIndex = req.params.currNodeIndex ? +req.params.currNodeIndex : common.selectedNode ? +common.selectedNode.index : 1;
req.session.selectedNode = common.findNode(selNodeIndex);
common.selectedNode = req.session.selectedNode;
if (req.headers && req.headers.authorization && req.headers.authorization !== '') {
wsServer.updateLNWSClientDetails(req.session.id, +req.session.selectedNode.index, +req.params.prevNodeIndex);
if (req.params.prevNodeIndex !== '-1') {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
<div fxLayout="column" fxFlex="100" fxLayoutAlign="start stretch" [perfectScrollbar]>
<form #form="ngForm" fxLayout="column" fxLayoutAlign="start stretch" class="settings-container page-sub-title-container">
<mat-accordion displayMode="flat" multi="false">
<mat-expansion-panel fxLayout="column" class="flat-expansion-panel mt-1">
<mat-expansion-panel-header>
<mat-panel-title>
<fa-icon class="page-title-img mr-1" [icon]="faBarsStaggered" />
<span class="page-title">Block Explorer</span>
</mat-panel-title>
</mat-expansion-panel-header>
<div fxLayout="column" fxLayoutAlign="start stretch">
<div fxFlex="100" class="alert alert-warn">
<fa-icon class="mr-1 alert-icon" [icon]="faExclamationTriangle" />
<span>Configure your own blockchain explorer url or <strong><a href="https://mempool.space/" target="blank">mempool.space</a></strong> will be used.</span>
</div>
<div fxLayout="row wrap" fxLayoutAlign="start center">
<mat-form-field fxLayout="column" fxFlex="100">
<mat-label>Block Explorer URL</mat-label>
<input matInput name="blockExplorerUrl" [(ngModel)]="selNode.settings.blockExplorerUrl">
<mat-hint>Blockchain explorer URL, eg. https://mempool.space or https://blockstream.info</mat-hint>
</mat-form-field>
</div>
</div>
</mat-expansion-panel>
<mat-expansion-panel fxLayout="column" class="flat-expansion-panel mt-1">
<mat-expansion-panel-header>
<mat-panel-title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { DomSanitizer } from '@angular/platform-browser';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { faMoneyBillAlt, faPaintBrush, faInfoCircle, faExclamationTriangle, faEyeSlash } from '@fortawesome/free-solid-svg-icons';
import { faMoneyBillAlt, faPaintBrush, faInfoCircle, faExclamationTriangle, faEyeSlash, faBarsStaggered } from '@fortawesome/free-solid-svg-icons';

import { UserPersonaEnum, ScreenSizeEnum, FIAT_CURRENCY_UNITS, NODE_SETTINGS, UI_MESSAGES } from '../../../services/consts-enums-functions';
import { Node, Settings } from '../../../models/RTLconfig';
Expand All @@ -20,6 +20,7 @@ import { updateNodeSettings, setSelectedNode } from '../../../../store/rtl.actio
})
export class NodeSettingsComponent implements OnInit, OnDestroy {

public faBarsStaggered = faBarsStaggered;
public faExclamationTriangle = faExclamationTriangle;
public faMoneyBillAlt = faMoneyBillAlt;
public faPaintBrush = faPaintBrush;
Expand Down Expand Up @@ -87,6 +88,7 @@ export class NodeSettingsComponent implements OnInit, OnDestroy {
if (this.selNode.settings.fiatConversion && !this.selNode.settings.currencyUnit) {
return true;
}
this.selNode.settings.blockExplorerUrl = this.selNode.settings.blockExplorerUrl.replace(/\/$/, '');
this.logger.info(this.selNode.settings);
this.store.dispatch(updateNodeSettings({ payload: this.selNode }));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div *ngIf="selNode.lnImplementation !== 'ECL'" tabindex="2" role="tab" mat-tab-link class="mat-tab-label" [active]="activeLink === links[1].link" routerLink="{{links[1].link}}" (click)="setActiveLink(links[1].link)">{{links[1].name}}</div>
<!-- <div *ngIf="selNode?.settings?.enablePeerswap" tabindex="3" role="tab" mat-tab-link class="mat-tab-label" [active]="activeLink === links[2].link" routerLink="{{links[2].link}}" (click)="activeLink = links[2].link">{{links[2].name}}</div> -->
<!-- <div *ngIf="selNode?.settings?.swapServerUrl?.trim() === '' && selNode?.settings?.boltzServerUrl?.trim() === '' && !selNode?.settings?.enablePeerswap" tabindex="4" role="tab" mat-tab-link class="mat-tab-label" [active]="activeLink === links[3].link" routerLink="{{links[3].link}}" (click)="setActiveLink(links[3].link)">{{links[3].name}}</div> -->
<div *ngIf="selNode?.settings?.swapServerUrl?.trim() === '' && selNode?.settings?.boltzServerUrl?.trim() === ''" tabindex="3" role="tab" mat-tab-link class="mat-tab-label" [active]="activeLink === links[2].link" routerLink="{{links[2].link}}" (click)="setActiveLink(links[2].link)">{{links[2].name}}</div>
<div *ngIf="selNode.lnImplementation === 'ECL'" tabindex="3" role="tab" mat-tab-link class="mat-tab-label" [active]="activeLink === links[2].link" routerLink="{{links[2].link}}" (click)="setActiveLink(links[2].link)">{{links[2].name}}</div>
</nav>
<mat-tab-nav-panel #tabPanel />
<div fxLayout="column" fxFlex="100" fxLayoutAlign="space-between stretch" class="mat-tab-body-wrapper">
Expand Down
Loading