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>
<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>

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

View File

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

View File

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