Including gitCommit and version in frontend build. Backend now sending a backendInfo object containing commit, version and hostname. All printed on About page.

This commit is contained in:
softsimon
2021-04-12 22:17:13 +04:00
parent f61e3d8cec
commit 7a4ad0ee2f
12 changed files with 74 additions and 25 deletions

View File

@@ -3,9 +3,13 @@
<br>
<img src="./resources/mempool-logo-bigger.png" height="62.5" width="250">
<br>
<br>
<div class="text-small text-center offset-md-1">
v2.2-dev ({{ gitCommit$ | async }})
<div class="text-small">
Frontend:
v{{ packetJsonVersion }} ({{ frontendGitCommitHash }}) [{{ hostname }}]
<br>
Backend: v{{ (backendInfo$ | async ).version }} ({{ (backendInfo$ | async ).gitCommit | slice:0:8 }}) [{{ (backendInfo$ | async).hostname }}]
</div>
<br>

View File

@@ -7,6 +7,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ApiService } from 'src/app/services/api.service';
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
import { delay, map, retryWhen, switchMap, tap } from 'rxjs/operators';
import { IBackendInfo } from 'src/app/interfaces/websocket.interface';
@Component({
selector: 'app-about',
@@ -14,7 +15,7 @@ import { delay, map, retryWhen, switchMap, tap } from 'rxjs/operators';
styleUrls: ['./about.component.scss'],
})
export class AboutComponent implements OnInit, OnDestroy {
gitCommit$: Observable<string>;
backendInfo$: Observable<IBackendInfo>;
donationForm: FormGroup;
paymentForm: FormGroup;
donationStatus = 1;
@@ -22,6 +23,9 @@ export class AboutComponent implements OnInit, OnDestroy {
contributors$: Observable<any>;
donationObj: any;
sponsorsEnabled = this.stateService.env.OFFICIAL_MEMPOOL_SPACE;
frontendGitCommitHash = this.stateService.env.GIT_COMMIT_HASH.substr(0, 8);
packetJsonVersion = this.stateService.env.PACKAGE_JSON_VERSION;
hostname = document.location.hostname;
sponsors = null;
contributors = null;
requestSubscription: Subscription | undefined;
@@ -36,7 +40,7 @@ export class AboutComponent implements OnInit, OnDestroy {
) { }
ngOnInit() {
this.gitCommit$ = this.stateService.gitCommit$.pipe(map((str) => str.substr(0, 8)));
this.backendInfo$ = this.stateService.backendInfo$;
this.seoService.setTitle($localize`:@@004b222ff9ef9dd4771b777950ca1d0e4cd4348a:About`);
this.websocketService.want(['blocks']);