[debug] SERVICES -> GIT_COMMIT_HASH_MEMPOOL_SPACE in env

This commit is contained in:
nymkappa 2023-08-21 08:57:27 +02:00
parent e82b43e340
commit a1e2d2fd74
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04
6 changed files with 25 additions and 20 deletions

View File

@ -4,8 +4,8 @@
<span style="margin-left: auto; margin-right: -20px; margin-bottom: -20px">&reg;</span> <span style="margin-left: auto; margin-right: -20px; margin-bottom: -20px">&reg;</span>
<img class="logo" src="/resources/mempool-logo-bigger.png" /> <img class="logo" src="/resources/mempool-logo-bigger.png" />
<div class="version"> <div class="version">
<span *ngIf="!stateService.env.SERVICES">v{{ packetJsonVersion }} [<a href="https://github.com/mempool/mempool/commit/{{ frontendGitCommitHash }}">{{ frontendGitCommitHash }}</a>]</span> <span *ngIf="!stateService.env.GIT_COMMIT_HASH_MEMPOOL_SPACE">v{{ packetJsonVersion }} [<a href="https://github.com/mempool/mempool/commit/{{ frontendGitCommitHash }}">{{ frontendGitCommitHash }}</a>]</span>
<span *ngIf="stateService.env.SERVICES">v{{ packetJsonVersion }} [<a href="https://github.com/mempool/mempool.space/commit/{{ frontendGitCommitHash }}">{{ frontendGitCommitHash }}</a>]</span> <span *ngIf="stateService.env.GIT_COMMIT_HASH_MEMPOOL_SPACE">v{{ packetJsonVersion }} [<a href="https://github.com/mempool/mempool.space/commit/{{ frontendGitCommitHash }}">{{ stateService.env.GIT_COMMIT_HASH_MEMPOOL_SPACE }}</a>]</span>
</div> </div>
</div> </div>

View File

@ -4,6 +4,7 @@ import { ApiService } from '../../services/api.service';
import { MenuGroup } from '../../interfaces/services.interface'; import { MenuGroup } from '../../interfaces/services.interface';
import { StorageService } from '../../services/storage.service'; import { StorageService } from '../../services/storage.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { StateService } from '../../services/state.service';
@Component({ @Component({
selector: 'app-menu', selector: 'app-menu',
@ -17,20 +18,23 @@ export class MenuComponent implements OnInit {
navOpen: boolean = false; navOpen: boolean = false;
userMenuGroups$: Observable<MenuGroup[]> | undefined; userMenuGroups$: Observable<MenuGroup[]> | undefined;
userAuth: any | undefined; userAuth: any | undefined;
isServices = false; isServicesPage = false;
constructor( constructor(
private apiService: ApiService, private apiService: ApiService,
private storageService: StorageService, private storageService: StorageService,
private router: Router private router: Router,
private stateService: StateService
) {} ) {}
ngOnInit(): void { ngOnInit(): void {
this.userAuth = this.storageService.getAuth(); this.userAuth = this.storageService.getAuth();
this.userMenuGroups$ = this.apiService.getUserMenuGroups$(); if (this.stateService.env.GIT_COMMIT_HASH_MEMPOOL_SPACE) {
this.userMenuGroups$ = this.apiService.getUserMenuGroups$();
}
this.isServices = this.router.url.includes('/services/'); this.isServicesPage = this.router.url.includes('/services/');
this.navOpen = this.isServices && !this.isSmallScreen(); this.navOpen = this.isServicesPage && !this.isSmallScreen();
} }
isSmallScreen() { isSmallScreen() {
@ -43,7 +47,7 @@ export class MenuComponent implements OnInit {
} }
onLinkClick() { onLinkClick() {
if (!this.isServices || this.isSmallScreen()) { if (!this.isServicesPage || this.isSmallScreen()) {
this.navOpen = false; this.navOpen = false;
} }
} }
@ -54,7 +58,7 @@ export class MenuComponent implements OnInit {
@HostListener('window:resize', ['$event']) @HostListener('window:resize', ['$event'])
onResize(event) { onResize(event) {
if (this.isServices) { if (this.isServicesPage) {
this.navOpen = !this.isSmallScreen(); this.navOpen = !this.isSmallScreen();
} }
} }

View File

@ -37,9 +37,11 @@ export class ApiService {
this.apiBasePath = network ? '/' + network : ''; this.apiBasePath = network ? '/' + network : '';
}); });
this.getServicesBackendInfo$().subscribe(version => { if (this.stateService.env.GIT_COMMIT_HASH_MEMPOOL_SPACE) {
this.stateService.servicesBackendInfo$.next(version); this.getServicesBackendInfo$().subscribe(version => {
}) this.stateService.servicesBackendInfo$.next(version);
})
}
} }
list2HStatistics$(): Observable<OptimizedMempoolStats[]> { list2HStatistics$(): Observable<OptimizedMempoolStats[]> {

View File

@ -49,7 +49,7 @@ export interface Env {
SIGNET_BLOCK_AUDIT_START_HEIGHT: number; SIGNET_BLOCK_AUDIT_START_HEIGHT: number;
HISTORICAL_PRICE: boolean; HISTORICAL_PRICE: boolean;
ACCELERATOR: boolean; ACCELERATOR: boolean;
SERVICES: boolean; GIT_COMMIT_HASH_MEMPOOL_SPACE?: string;
} }
const defaultEnv: Env = { const defaultEnv: Env = {
@ -81,7 +81,6 @@ const defaultEnv: Env = {
'SIGNET_BLOCK_AUDIT_START_HEIGHT': 0, 'SIGNET_BLOCK_AUDIT_START_HEIGHT': 0,
'HISTORICAL_PRICE': true, 'HISTORICAL_PRICE': true,
'ACCELERATOR': false, 'ACCELERATOR': false,
'SERVICES': false,
}; };
@Injectable({ @Injectable({

View File

@ -73,12 +73,12 @@
<a href="https://mempool.chat" target="_blank"><svg fill="#fff" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Matrix</title><path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.481.314.448.208.785.582 1.02 1.108.254-.374.6-.706 1.034-.992.434-.287.95-.43 1.546-.43.453 0 .872.056 1.26.167.388.11.716.286.993.53.276.245.489.559.646.951.152.392.23.863.23 1.417v5.728h-2.349V11.52c0-.286-.01-.559-.032-.812a1.755 1.755 0 0 0-.18-.66 1.106 1.106 0 0 0-.438-.448c-.194-.11-.457-.166-.785-.166-.332 0-.6.064-.803.189a1.38 1.38 0 0 0-.48.499 1.946 1.946 0 0 0-.231.696 5.56 5.56 0 0 0-.06.785v4.768h-2.35v-4.8c0-.254-.004-.503-.018-.752a2.074 2.074 0 0 0-.143-.688 1.052 1.052 0 0 0-.415-.503c-.194-.125-.476-.19-.854-.19-.111 0-.259.024-.439.074-.18.051-.36.143-.53.282-.171.138-.319.337-.439.595-.12.259-.18.6-.18 1.02v4.966H5.46V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg></a> <a href="https://mempool.chat" target="_blank"><svg fill="#fff" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Matrix</title><path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.481.314.448.208.785.582 1.02 1.108.254-.374.6-.706 1.034-.992.434-.287.95-.43 1.546-.43.453 0 .872.056 1.26.167.388.11.716.286.993.53.276.245.489.559.646.951.152.392.23.863.23 1.417v5.728h-2.349V11.52c0-.286-.01-.559-.032-.812a1.755 1.755 0 0 0-.18-.66 1.106 1.106 0 0 0-.438-.448c-.194-.11-.457-.166-.785-.166-.332 0-.6.064-.803.189a1.38 1.38 0 0 0-.48.499 1.946 1.946 0 0 0-.231.696 5.56 5.56 0 0 0-.06.785v4.768h-2.35v-4.8c0-.254-.004-.503-.018-.752a2.074 2.074 0 0 0-.143-.688 1.052 1.052 0 0 0-.415-.503c-.194-.125-.476-.19-.854-.19-.111 0-.259.024-.439.074-.18.051-.36.143-.53.282-.171.138-.319.337-.439.595-.12.259-.18.6-.18 1.02v4.966H5.46V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z"/></svg></a>
</div> </div>
</div> </div>
<div class="row version" [style]="{'padding-left': addPadding ? '250px !important' : '', 'background-color': isServices ? '#1d1f31' : ''}"> <div class="row version" [style]="{'padding-left': addPadding ? '250px !important' : '', 'background-color': isServicesPage ? '#1d1f31' : ''}">
<div class="col-sm-12" *ngIf="!isServices"> <div class="col-sm-12" *ngIf="!isServicesPage">
<p *ngIf="officialMempoolSpace">{{ (backendInfo$ | async)?.hostname }} (v{{ (backendInfo$ | async )?.version }}) [<a target="_blank" href="https://github.com/mempool/mempool/commit/{{ (backendInfo$ | async )?.gitCommit | slice:0:8 }}">{{ (backendInfo$ | async )?.gitCommit | slice:0:8 }}</a>]</p> <p *ngIf="officialMempoolSpace">{{ (backendInfo$ | async)?.hostname }} (v{{ (backendInfo$ | async )?.version }}) [<a target="_blank" href="https://github.com/mempool/mempool/commit/{{ (backendInfo$ | async )?.gitCommit | slice:0:8 }}">{{ (backendInfo$ | async )?.gitCommit | slice:0:8 }}</a>]</p>
<p *ngIf="!officialMempoolSpace">v{{ packetJsonVersion }} [<a target="_blank" href="https://github.com/mempool/mempool/commit/{{ frontendGitCommitHash }}">{{ frontendGitCommitHash }}</a>]</p> <p *ngIf="!officialMempoolSpace">v{{ packetJsonVersion }} [<a target="_blank" href="https://github.com/mempool/mempool/commit/{{ frontendGitCommitHash }}">{{ frontendGitCommitHash }}</a>]</p>
</div> </div>
<div class="col-sm-12" *ngIf="isServices"> <div class="col-sm-12" *ngIf="isServicesPage">
<p>{{ (servicesBackendInfo$ | async)?.hostname }} (v{{ (servicesBackendInfo$ | async )?.version }}) [<a target="_blank" href="https://github.com/mempool/mempool.space/commit/{{ (servicesBackendInfo$ | async )?.gitCommit | slice:0:8 }}">{{ (servicesBackendInfo$ | async )?.gitCommit | slice:0:8 }}</a>]</p> <p>{{ (servicesBackendInfo$ | async)?.hostname }} (v{{ (servicesBackendInfo$ | async )?.version }}) [<a target="_blank" href="https://github.com/mempool/mempool.space/commit/{{ (servicesBackendInfo$ | async )?.gitCommit | slice:0:8 }}">{{ (servicesBackendInfo$ | async )?.gitCommit | slice:0:8 }}</a>]</p>
</div> </div>
</div> </div>

View File

@ -31,7 +31,7 @@ export class GlobalFooterComponent implements OnInit {
username = null; username = null;
urlSubscription: Subscription; urlSubscription: Subscription;
addPadding = false; addPadding = false;
isServices = false; isServicesPage = false;
constructor( constructor(
public stateService: StateService, public stateService: StateService,
@ -46,8 +46,8 @@ export class GlobalFooterComponent implements OnInit {
) {} ) {}
ngOnInit(): void { ngOnInit(): void {
this.isServices = this.router.url.includes('/services/'); this.isServicesPage = this.router.url.includes('/services/');
this.addPadding = this.isServices && !this.isSmallScreen(); this.addPadding = this.isServicesPage && !this.isSmallScreen();
this.env = this.stateService.env; this.env = this.stateService.env;
this.backendInfo$ = this.stateService.backendInfo$; this.backendInfo$ = this.stateService.backendInfo$;