mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
add startup message with version number
This commit is contained in:

committed by
Samuel Cambien

parent
59f9534418
commit
c94e5d0709
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dspace-angular",
|
"name": "dspace-angular",
|
||||||
"version": "0.0.0",
|
"version": "7.4.0-next.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"config:watch": "nodemon",
|
"config:watch": "nodemon",
|
||||||
|
@@ -48,6 +48,7 @@ import { ServerAppModule } from './src/main.server';
|
|||||||
import { buildAppConfig } from './src/config/config.server';
|
import { buildAppConfig } from './src/config/config.server';
|
||||||
import { APP_CONFIG, AppConfig } from './src/config/app-config.interface';
|
import { APP_CONFIG, AppConfig } from './src/config/app-config.interface';
|
||||||
import { extendEnvironmentWithAppConfig } from './src/config/config.util';
|
import { extendEnvironmentWithAppConfig } from './src/config/config.util';
|
||||||
|
import { logStartupMessage } from './startup-message';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set path for the browser application's dist folder
|
* Set path for the browser application's dist folder
|
||||||
@@ -281,6 +282,8 @@ function run() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
|
logStartupMessage(environment);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If SSL is enabled
|
* If SSL is enabled
|
||||||
* - Read credentials from configuration files
|
* - Read credentials from configuration files
|
||||||
|
@@ -143,10 +143,6 @@ export abstract class InitService {
|
|||||||
if (environment.debug) {
|
if (environment.debug) {
|
||||||
console.info(environment);
|
console.info(environment);
|
||||||
}
|
}
|
||||||
|
|
||||||
const env: string = environment.production ? 'Production' : 'Development';
|
|
||||||
const color: string = environment.production ? 'red' : 'green';
|
|
||||||
console.info(`Environment: %c${env}`, `color: ${color}; font-weight: bold;`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -28,6 +28,7 @@ import { StoreAction, StoreActionTypes } from '../../app/store.actions';
|
|||||||
import { coreSelector } from '../../app/core/core.selectors';
|
import { coreSelector } from '../../app/core/core.selectors';
|
||||||
import { find, map } from 'rxjs/operators';
|
import { find, map } from 'rxjs/operators';
|
||||||
import { isNotEmpty } from '../../app/shared/empty.util';
|
import { isNotEmpty } from '../../app/shared/empty.util';
|
||||||
|
import { logStartupMessage } from '../../../startup-message';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs client-side initialization.
|
* Performs client-side initialization.
|
||||||
@@ -79,6 +80,7 @@ export class BrowserInitService extends InitService {
|
|||||||
this.initCorrelationId();
|
this.initCorrelationId();
|
||||||
|
|
||||||
this.checkEnvironment();
|
this.checkEnvironment();
|
||||||
|
logStartupMessage(environment);
|
||||||
|
|
||||||
this.initI18n();
|
this.initI18n();
|
||||||
this.initAngulartics();
|
this.initAngulartics();
|
||||||
|
19
startup-message.ts
Normal file
19
startup-message.ts
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import PACKAGE_JSON from './package.json';
|
||||||
|
import { BuildConfig } from './src/config/build-config.interface';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Log a message at the start of the application containing the version number and the environment.
|
||||||
|
*
|
||||||
|
* @param environment the environment configuration
|
||||||
|
*/
|
||||||
|
export const logStartupMessage = (environment: Partial<BuildConfig>) => {
|
||||||
|
const env: string = environment.production ? 'Production' : 'Development';
|
||||||
|
const color: string = environment.production ? 'red' : 'green';
|
||||||
|
|
||||||
|
console.info('');
|
||||||
|
console.info(`%cdspace-angular`, `font-weight: bold;`);
|
||||||
|
console.info(`Version: %c${PACKAGE_JSON.version}`, `font-weight: bold;`);
|
||||||
|
console.info(`Environment: %c${env}`, `color: ${color}; font-weight: bold;`);
|
||||||
|
console.info('');
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user