mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
!wip
This commit is contained in:
parent
0ad8eccbdf
commit
09144aa080
2 changed files with 9 additions and 15 deletions
|
@ -83,9 +83,6 @@ export function HttpLoaderFactory(http: HttpClient, platformLocation: PlatformLo
|
|||
}
|
||||
return new TranslateHttpLoader(http, "/translations/", `.json?v=${version}`);
|
||||
}
|
||||
export function baseurlFact() {
|
||||
return "/" + localStorage.getItem("baseUrl");
|
||||
}
|
||||
|
||||
export function JwtTokenGetter() {
|
||||
const token = localStorage.getItem("id_token");
|
||||
|
@ -171,10 +168,7 @@ export function JwtTokenGetter() {
|
|||
PlexTvService,
|
||||
SearchService,
|
||||
SearchV2Service,
|
||||
{
|
||||
provide: APP_BASE_HREF,
|
||||
useFactory: baseurlFact
|
||||
} ],
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
})
|
||||
export class AppModule { }
|
||||
|
|
|
@ -5,17 +5,18 @@
|
|||
|
||||
<script>
|
||||
|
||||
// TODO change to fetch and reload page
|
||||
const existingBaseUrl = window.localStorage.getItem("baseUrl");
|
||||
const existingBaseUrl = window.localStorage.getItem("baseUrl");
|
||||
if (existingBaseUrl) {
|
||||
document.write('<base href="/' + existingBaseUrl + '" />');
|
||||
document.write(" <link rel=\"stylesheet\" href='" + existingBaseUrl + "/loading.css'/>")
|
||||
} else {
|
||||
// Work out the base URL
|
||||
// Need to find the baseUrl.txt file
|
||||
let url = window.location.href;
|
||||
let hasFile = false;
|
||||
|
||||
var xmlhttp = new XMLHttpRequest();
|
||||
debugger;
|
||||
|
||||
xmlhttp.open("GET", url + "api/v1/Settings/baseurl", false);
|
||||
xmlhttp.send();
|
||||
while (xmlhttp.status === 404) {
|
||||
|
@ -24,14 +25,14 @@
|
|||
tryGetBaseUrl(xmlhttp, url);
|
||||
}
|
||||
const data = JSON.parse(xmlhttp.responseText);
|
||||
hasFile = true;
|
||||
debugger;
|
||||
document.write('<base href="/' + data + '" />');
|
||||
document.write(" <link rel=\"stylesheet\" href=" + data + "/loading.css\"/>")
|
||||
window.localStorage.setItem("baseUrl", data);
|
||||
|
||||
|
||||
function tryGetBaseUrl(xmlhttp, url) {
|
||||
debugger;
|
||||
xmlhttp.open("GET", url + "/api/v1/Settings/baseurl", false);
|
||||
function tryGetBaseUrl(xmlhttp, url) {
|
||||
xmlhttp.open("GET", url + "api/v1/Settings/baseurl", false);
|
||||
xmlhttp.send();
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +46,6 @@
|
|||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/loading.css" />
|
||||
<script src="//maps.google.com/maps/api/js?libraries=visualization&key=AIzaSyBDar8LXU5vbURGTMcNLI0f9AsoSnpiV3I" async
|
||||
defer></script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue