You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/src/Ombi/ClientApp/src/index.html

73 lines
2.1 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<script>
const existingBaseUrl = window.localStorage.getItem("baseUrl");
if (existingBaseUrl && existingBaseUrl.length === 0) {
document.write('<base href="/' + existingBaseUrl + '" />');
if (existingBaseUrl.length === 0) {
document.write("<link rel=\"stylesheet\" href='/loading.css'/>")
} else {
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();
xmlhttp.open("GET", url + "api/v1/Settings/baseurl", false);
xmlhttp.send();
while (xmlhttp.status === 404) {
// try again
url = url.slice(0, url.lastIndexOf("/"));
tryGetBaseUrl(xmlhttp, url);
}
const data = JSON.parse(xmlhttp.responseText);
hasFile = true;
document.write('<base href="/' + data + '" />');
document.write("<link rel=\"stylesheet\" href=" + data + "/loading.css\"/>")
window.localStorage.setItem("baseUrl", data);
function tryGetBaseUrl(xmlhttp, url) {
if (endsWith(url, "/")) {
xmlhttp.open("GET", url + "api/v1/Settings/baseurl", false);
} else {
xmlhttp.open("GET", url + "/api/v1/Settings/baseurl", false);
}
xmlhttp.send();
}
function endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
}
</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">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Ombi</title>
<script src="//maps.google.com/maps/api/js?libraries=visualization&key=AIzaSyBDar8LXU5vbURGTMcNLI0f9AsoSnpiV3I" async
defer></script>
</head>
<body>
<app-ombi>
<p class="loading">Loading<span>.</span><span>.</span><span>.</span></p>
</app-ombi>
</body>
</html>