From 94b103f4d4a9f7601248af2cf57a0c1cb5b70ea2 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Thu, 18 Jul 2019 22:43:32 +0100 Subject: [PATCH] did I crack the base href thing? Probably not --- src/Ombi/ClientApp/src/app/app.component.ts | 8 ++++---- src/Ombi/ClientApp/src/app/app.module.ts | 4 +++- src/Ombi/ClientApp/src/index.html | 10 ++++++++-- src/Ombi/ClientApp/src/main.ts | 4 +++- src/Ombi/ClientApp/src/typings/globals.d.ts | 1 - 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/app.component.ts b/src/Ombi/ClientApp/src/app/app.component.ts index 918b0aa86..c883208bc 100644 --- a/src/Ombi/ClientApp/src/app/app.component.ts +++ b/src/Ombi/ClientApp/src/app/app.component.ts @@ -38,6 +38,7 @@ export class AppComponent implements OnInit { private checkedForUpdate: boolean; private hubConnected: boolean; + @HostBinding('class') public componentCssClass; @@ -54,10 +55,9 @@ export class AppComponent implements OnInit { private signalrNotification: SignalRNotificationService, private readonly snackBar: MatSnackBar) { - const base = '/' + (window.location.pathname.split('/')[1] || ''); - if (base.length > 1) { - __webpack_public_path__ = base + "/dist/"; - } + + // __webpack_public_path__ = window['base-href'] + this.translate.addLangs(["en", "de", "fr", "da", "es", "it", "nl", "sv", "no", "pl", "pt"]); diff --git a/src/Ombi/ClientApp/src/app/app.module.ts b/src/Ombi/ClientApp/src/app/app.module.ts index e28b16114..6be02a4bc 100644 --- a/src/Ombi/ClientApp/src/app/app.module.ts +++ b/src/Ombi/ClientApp/src/app/app.module.ts @@ -79,6 +79,8 @@ const routes: Routes = [ { loadChildren: () => import("./user-preferences/user-preferences.module").then(m => m.UserPreferencesModule), path: "user-preferences" }, ]; + + // AoT requires an exported function for factories export function HttpLoaderFactory(http: HttpClient, platformLocation: PlatformLocation) { // const base = getBaseLocation(); @@ -181,7 +183,7 @@ export function JwtTokenGetter() { SignalRNotificationService, { provide: APP_BASE_HREF, - useValue: '/' + (window.location.pathname.split('/')[1] || '') + useValue: window["baseHref"] } ], bootstrap: [AppComponent], diff --git a/src/Ombi/ClientApp/src/index.html b/src/Ombi/ClientApp/src/index.html index 12a966d0a..d49c1783c 100644 --- a/src/Ombi/ClientApp/src/index.html +++ b/src/Ombi/ClientApp/src/index.html @@ -4,8 +4,14 @@ diff --git a/src/Ombi/ClientApp/src/main.ts b/src/Ombi/ClientApp/src/main.ts index dd6c96891..b88de5819 100644 --- a/src/Ombi/ClientApp/src/main.ts +++ b/src/Ombi/ClientApp/src/main.ts @@ -17,7 +17,9 @@ import { AppModule } from "./app/app.module"; import { hmrBootstrap } from "./hmr"; declare var module: any; - +// declare var __webpack_require__: any; +// __webpack_require__.p = '/ombi'; +// __webpack_require__ = '/ombi'; if (environment.production) { enableProdMode(); } diff --git a/src/Ombi/ClientApp/src/typings/globals.d.ts b/src/Ombi/ClientApp/src/typings/globals.d.ts index 85fd9e2a0..a52f87871 100644 --- a/src/Ombi/ClientApp/src/typings/globals.d.ts +++ b/src/Ombi/ClientApp/src/typings/globals.d.ts @@ -1,6 +1,5 @@ // Globals declare var __webpack_public_path__: any; - // declare module "*.json" { // const value: any; // export default value;