fix intermediary.html for url with parameters

(cherry picked from commit 2cc5eaf)
This commit is contained in:
MoonshineSG authored and Gina Häußge committed 2016-07-06 13:15:34 +02:00
1 parent 5eefee3a4d
commit bfecb5fadf
1 file changed
+8 -1
+8 -1
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;