mirror of
https://github.com/clearml/clearml-web
synced 2025-01-30 22:17:22 +00:00
parent
90c41957d8
commit
ce9a7456a6
7
src/env.js
Normal file
7
src/env.js
Normal file
@ -0,0 +1,7 @@
|
||||
(function (window) {
|
||||
window.__env = window.__env || {};
|
||||
|
||||
// Sub_Path
|
||||
window.__env.subPath = '${CLEARML_SERVER_SUB_PATH}';
|
||||
|
||||
}(this));
|
14
src/main.ts
14
src/main.ts
@ -1,8 +1,8 @@
|
||||
import {enableProdMode} from '@angular/core';
|
||||
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
||||
|
||||
import {AppModule} from './app/app.module';
|
||||
import {ConfigurationService} from './app/webapp-common/shared/services/configuration.service';
|
||||
import {AppModule} from '~/app.module';
|
||||
import {ConfigurationService} from '@common/shared/services/configuration.service';
|
||||
import {updateHttpUrlBaseConstant} from '~/app.constants';
|
||||
const environment = ConfigurationService.globalEnvironment;
|
||||
|
||||
if (environment.production) {
|
||||
@ -10,7 +10,7 @@ if (environment.production) {
|
||||
}
|
||||
|
||||
if (window.navigator && navigator.serviceWorker) {
|
||||
navigator.serviceWorker.getRegistrations().then(function (registrations) {
|
||||
navigator.serviceWorker.getRegistrations().then(registrations => {
|
||||
for (const registration of registrations) {
|
||||
registration.unregister();
|
||||
}
|
||||
@ -31,4 +31,8 @@ if (savedData) {
|
||||
}
|
||||
}
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
(async () => {
|
||||
const baseHref = ( window as any ).__env.subPath || '' as string;
|
||||
updateHttpUrlBaseConstant({...environment, ...(baseHref && !baseHref.startsWith('${') && {apiBaseUrl: baseHref + environment.apiBaseUrl})});
|
||||
await platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user