From 1b9900ccf82eaf334808f635c34a4c86c2d2d0b1 Mon Sep 17 00:00:00 2001 From: softsimon Date: Mon, 10 Aug 2020 14:59:29 +0700 Subject: [PATCH] Add commit hash to the bottom of the about page fixes #102 --- .../src/app/components/about/about.component.html | 11 ++++++++++- frontend/src/app/components/about/about.component.ts | 10 +++++++--- frontend/src/app/interfaces/websocket.interface.ts | 1 + frontend/src/app/services/websocket.service.ts | 1 + 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/components/about/about.component.html b/frontend/src/app/components/about/about.component.html index f7c1c27de..7d0ef72d1 100644 --- a/frontend/src/app/components/about/about.component.html +++ b/frontend/src/app/components/about/about.component.html @@ -112,6 +112,15 @@
-

+
+ +
+ Git commit: + + {{ mempoolStats.gitCommit }} + +
+ +
diff --git a/frontend/src/app/components/about/about.component.ts b/frontend/src/app/components/about/about.component.ts index 9b2f31adf..ee7453bc1 100644 --- a/frontend/src/app/components/about/about.component.ts +++ b/frontend/src/app/components/about/about.component.ts @@ -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; 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') { diff --git a/frontend/src/app/interfaces/websocket.interface.ts b/frontend/src/app/interfaces/websocket.interface.ts index abab7acf0..c51b2a451 100644 --- a/frontend/src/app/interfaces/websocket.interface.ts +++ b/frontend/src/app/interfaces/websocket.interface.ts @@ -31,6 +31,7 @@ export interface MempoolBlock { export interface MemPoolState { memPoolInfo: MempoolInfo; vBytesPerSecond: number; + gitCommit: string; } export interface MempoolInfo { diff --git a/frontend/src/app/services/websocket.service.ts b/frontend/src/app/services/websocket.service.ts index 134cd47b4..c01391d02 100644 --- a/frontend/src/app/services/websocket.service.ts +++ b/frontend/src/app/services/websocket.service.ts @@ -137,6 +137,7 @@ export class WebsocketService { this.stateService.mempoolStats$.next({ memPoolInfo: response.mempoolInfo, vBytesPerSecond: response.vBytesPerSecond, + gitCommit: response['git-commit'] }); }