mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
did I crack the base href thing? Probably not
This commit is contained in:
parent
6e123f1dc4
commit
94b103f4d4
5 changed files with 18 additions and 9 deletions
|
@ -38,6 +38,7 @@ export class AppComponent implements OnInit {
|
||||||
private checkedForUpdate: boolean;
|
private checkedForUpdate: boolean;
|
||||||
private hubConnected: boolean;
|
private hubConnected: boolean;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@HostBinding('class') public componentCssClass;
|
@HostBinding('class') public componentCssClass;
|
||||||
|
|
||||||
|
@ -54,10 +55,9 @@ export class AppComponent implements OnInit {
|
||||||
private signalrNotification: SignalRNotificationService,
|
private signalrNotification: SignalRNotificationService,
|
||||||
private readonly snackBar: MatSnackBar) {
|
private readonly snackBar: MatSnackBar) {
|
||||||
|
|
||||||
const base = '/' + (window.location.pathname.split('/')[1] || '');
|
|
||||||
if (base.length > 1) {
|
// __webpack_public_path__ = window['base-href']
|
||||||
__webpack_public_path__ = base + "/dist/";
|
|
||||||
}
|
|
||||||
|
|
||||||
this.translate.addLangs(["en", "de", "fr", "da", "es", "it", "nl", "sv", "no", "pl", "pt"]);
|
this.translate.addLangs(["en", "de", "fr", "da", "es", "it", "nl", "sv", "no", "pl", "pt"]);
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,8 @@ const routes: Routes = [
|
||||||
{ loadChildren: () => import("./user-preferences/user-preferences.module").then(m => m.UserPreferencesModule), path: "user-preferences" },
|
{ loadChildren: () => import("./user-preferences/user-preferences.module").then(m => m.UserPreferencesModule), path: "user-preferences" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// AoT requires an exported function for factories
|
// AoT requires an exported function for factories
|
||||||
export function HttpLoaderFactory(http: HttpClient, platformLocation: PlatformLocation) {
|
export function HttpLoaderFactory(http: HttpClient, platformLocation: PlatformLocation) {
|
||||||
// const base = getBaseLocation();
|
// const base = getBaseLocation();
|
||||||
|
@ -181,7 +183,7 @@ export function JwtTokenGetter() {
|
||||||
SignalRNotificationService,
|
SignalRNotificationService,
|
||||||
{
|
{
|
||||||
provide: APP_BASE_HREF,
|
provide: APP_BASE_HREF,
|
||||||
useValue: '/' + (window.location.pathname.split('/')[1] || '')
|
useValue: window["baseHref"]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
|
|
|
@ -4,8 +4,14 @@
|
||||||
<head>
|
<head>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
var base = "/"+ (window.location.pathname.split('/')[1] || '');
|
var base = "/";
|
||||||
//document.write("<base href='" + base + "' />");
|
var locations = window.location.pathname.split('/');
|
||||||
|
if(locations[1] !== 'login' && locations[1] !== 'discover') {
|
||||||
|
base = "/" + locations[1];
|
||||||
|
}
|
||||||
|
document.write("<base href='" + base + "' />");
|
||||||
|
window["baseHref"] = base;
|
||||||
|
console.log(base);
|
||||||
</script>
|
</script>
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
|
||||||
|
|
|
@ -17,7 +17,9 @@ import { AppModule } from "./app/app.module";
|
||||||
|
|
||||||
import { hmrBootstrap } from "./hmr";
|
import { hmrBootstrap } from "./hmr";
|
||||||
declare var module: any;
|
declare var module: any;
|
||||||
|
// declare var __webpack_require__: any;
|
||||||
|
// __webpack_require__.p = '/ombi';
|
||||||
|
// __webpack_require__ = '/ombi';
|
||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
enableProdMode();
|
enableProdMode();
|
||||||
}
|
}
|
||||||
|
|
1
src/Ombi/ClientApp/src/typings/globals.d.ts
vendored
1
src/Ombi/ClientApp/src/typings/globals.d.ts
vendored
|
@ -1,6 +1,5 @@
|
||||||
// Globals
|
// Globals
|
||||||
declare var __webpack_public_path__: any;
|
declare var __webpack_public_path__: any;
|
||||||
|
|
||||||
// declare module "*.json" {
|
// declare module "*.json" {
|
||||||
// const value: any;
|
// const value: any;
|
||||||
// export default value;
|
// export default value;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue