Merge branch 'master' into simon/bisq-dashboard

# Conflicts:
#	frontend/package-lock.json
#	frontend/src/app/components/master-page/master-page.component.html
This commit is contained in:
softsimon
2021-04-23 15:35:35 +04:00
32 changed files with 358 additions and 64 deletions

View File

@@ -1,20 +1,24 @@
import * as fs from 'fs';
import * as os from 'os';
import logger from '../logger';
import { IBackendInfo } from '../mempool.interfaces';
class BackendInfo {
gitCommitHash = '';
hostname = '';
private gitCommitHash = '';
private hostname = '';
private version = '';
constructor() {
this.setLatestCommitHash();
this.setVersion();
this.hostname = os.hostname();
}
public getBackendInfo() {
public getBackendInfo(): IBackendInfo {
return {
'hostname': this.hostname,
'git-commit': this.gitCommitHash,
hostname: this.hostname,
gitCommit: this.gitCommitHash,
version: this.version,
};
}
@@ -29,6 +33,15 @@ class BackendInfo {
logger.err('Could not load git commit info: ' + e.message || e);
}
}
private setVersion(): void {
try {
const packageJson = fs.readFileSync('package.json').toString();
this.version = JSON.parse(packageJson).version;
} catch (e) {
throw new Error(e);
}
}
}
export default new BackendInfo();

View File

@@ -169,7 +169,7 @@ class Mempool {
if (!this.inSync && transactions.length === Object.keys(this.mempoolCache).length) {
this.inSync = true;
logger.info('The mempool is now in sync!');
logger.notice('The mempool is now in sync!');
loadingIndicators.setProgress('mempool', 100);
}

View File

@@ -167,8 +167,7 @@ class WebsocketHandler {
'conversions': fiatConversion.getConversionRates(),
'mempool-blocks': mempoolBlocks.getMempoolBlocks(),
'transactions': memPool.getLatestTransactions(),
'git-commit': backendInfo.gitCommitHash,
'hostname': backendInfo.hostname,
'backendInfo': backendInfo.getBackendInfo(),
'loadingIndicators': loadingIndicators.getLoadingIndicators(),
...this.extraInitProperties
};