fix intermediary.html for url with parameters

(cherry picked from commit 2cc5eaf)
This commit is contained in:
MoonshineSG 2016-06-23 04:12:54 +02:00 committed by Gina Häußge
parent 5eefee3a4d
commit bfecb5fadf

View file

@ -136,14 +136,21 @@
var timeout = 1500;
var baseUrl = window.location.href;
var reloadUrl = window.location.href;
if (baseUrl.indexOf("#") > -1) {
baseUrl = baseUrl.substring(0, baseUrl.indexOf("#"));
reloadUrl = baseUrl;
}
if (baseUrl.indexOf("?") > -1) {
baseUrl = baseUrl.substring(0, baseUrl.indexOf("?"));
}
if (baseUrl.indexOf("/static") > -1) {
baseUrl = baseUrl.substring(0, baseUrl.indexOf("/static"));
reloadUrl = baseUrl;
}
if (baseUrl[baseUrl.length - 1] != "/") {
baseUrl += "/";
reloadUrl = baseUrl;
}
var serverOnlineUrl = baseUrl + "online.gif";
var backendOnlineUrl = baseUrl + "intermediary.gif";
@ -159,7 +166,7 @@
serverIsOnline = true;
message.className = "pulsate1 green";
message.innerText = "OctoPrint server online, reloading page...";
window.location = baseUrl;
window.location = reloadUrl;
} else {
// online.gif still not available, let's look at
var interval = 15;