Add commit hash to the bottom of the about page

fixes #102
This commit is contained in:
softsimon 2020-08-10 14:59:29 +07:00
parent cb51b71128
commit 1b9900ccf8
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
4 changed files with 19 additions and 4 deletions

View File

@ -112,6 +112,15 @@
<div [ngbNavOutlet]="nav" class="mt-2"></div> <div [ngbNavOutlet]="nav" class="mt-2"></div>
<br> <br> <br>
<div class="text-small text-center">
Git commit:
<ng-container *ngIf="(mempoolStats$ | async) as mempoolStats">
{{ mempoolStats.gitCommit }}
</ng-container>
</div>
<br>
</div> </div>

View File

@ -1,17 +1,20 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { WebsocketService } from '../../services/websocket.service'; import { WebsocketService } from '../../services/websocket.service';
import { SeoService } from 'src/app/services/seo.service'; import { SeoService } from 'src/app/services/seo.service';
import { StateService } from 'src/app/services/state.service'; import { StateService } from 'src/app/services/state.service';
import { Observable } from 'rxjs';
import { MemPoolState } from 'src/app/interfaces/websocket.interface';
@Component({ @Component({
selector: 'app-about', selector: 'app-about',
templateUrl: './about.component.html', templateUrl: './about.component.html',
styleUrls: ['./about.component.scss'] styleUrls: ['./about.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
}) })
export class AboutComponent implements OnInit { export class AboutComponent implements OnInit {
active = 1; active = 1;
hostname = document.location.hostname; hostname = document.location.hostname;
mempoolStats$: Observable<MemPoolState>;
constructor( constructor(
private websocketService: WebsocketService, private websocketService: WebsocketService,
@ -20,6 +23,7 @@ export class AboutComponent implements OnInit {
) { } ) { }
ngOnInit() { ngOnInit() {
this.mempoolStats$ = this.stateService.mempoolStats$;
this.seoService.setTitle('Contributors'); this.seoService.setTitle('Contributors');
this.websocketService.want(['blocks']); this.websocketService.want(['blocks']);
if (this.stateService.network === 'bisq') { if (this.stateService.network === 'bisq') {

View File

@ -31,6 +31,7 @@ export interface MempoolBlock {
export interface MemPoolState { export interface MemPoolState {
memPoolInfo: MempoolInfo; memPoolInfo: MempoolInfo;
vBytesPerSecond: number; vBytesPerSecond: number;
gitCommit: string;
} }
export interface MempoolInfo { export interface MempoolInfo {

View File

@ -137,6 +137,7 @@ export class WebsocketService {
this.stateService.mempoolStats$.next({ this.stateService.mempoolStats$.next({
memPoolInfo: response.mempoolInfo, memPoolInfo: response.mempoolInfo,
vBytesPerSecond: response.vBytesPerSecond, vBytesPerSecond: response.vBytesPerSecond,
gitCommit: response['git-commit']
}); });
} }