mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -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 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"]);
|
||||
|
||||
|
|
|
@ -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],
|
||||
|
|
|
@ -4,8 +4,14 @@
|
|||
<head>
|
||||
<script>
|
||||
|
||||
var base = "/"+ (window.location.pathname.split('/')[1] || '');
|
||||
//document.write("<base href='" + base + "' />");
|
||||
var 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>
|
||||
<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">
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
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
|
||||
declare var __webpack_public_path__: any;
|
||||
|
||||
// declare module "*.json" {
|
||||
// const value: any;
|
||||
// export default value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue