fix intermediary.html for url with parameters
This commit is contained in:
1 parent
7d3440b744
commit
2cc5eaf911
1 file changed
+8
-1
@@ -141,14 +141,21 @@
|
|||||||
var timeout = 1500;
|
var timeout = 1500;
|
||||||
|
|
||||||
var baseUrl = window.location.href;
|
var baseUrl = window.location.href;
|
||||||
|
var reloadUrl = window.location.href;
|
||||||
if (baseUrl.indexOf("#") > -1) {
|
if (baseUrl.indexOf("#") > -1) {
|
||||||
baseUrl = baseUrl.substring(0, baseUrl.indexOf("#"));
|
baseUrl = baseUrl.substring(0, baseUrl.indexOf("#"));
|
||||||
|
reloadUrl = baseUrl;
|
||||||
|
}
|
||||||
|
if (baseUrl.indexOf("?") > -1) {
|
||||||
|
baseUrl = baseUrl.substring(0, baseUrl.indexOf("?"));
|
||||||
}
|
}
|
||||||
if (baseUrl.indexOf("/static") > -1) {
|
if (baseUrl.indexOf("/static") > -1) {
|
||||||
baseUrl = baseUrl.substring(0, baseUrl.indexOf("/static"));
|
baseUrl = baseUrl.substring(0, baseUrl.indexOf("/static"));
|
||||||
|
reloadUrl = baseUrl;
|
||||||
}
|
}
|
||||||
if (baseUrl[baseUrl.length - 1] != "/") {
|
if (baseUrl[baseUrl.length - 1] != "/") {
|
||||||
baseUrl += "/";
|
baseUrl += "/";
|
||||||
|
reloadUrl = baseUrl;
|
||||||
}
|
}
|
||||||
var serverOnlineUrl = baseUrl + "online.gif";
|
var serverOnlineUrl = baseUrl + "online.gif";
|
||||||
var backendOnlineUrl = baseUrl + "intermediary.gif";
|
var backendOnlineUrl = baseUrl + "intermediary.gif";
|
||||||
@@ -164,7 +171,7 @@
|
|||||||
serverIsOnline = true;
|
serverIsOnline = true;
|
||||||
message.className = "pulsate1 green";
|
message.className = "pulsate1 green";
|
||||||
message.innerText = "OctoPrint server online, reloading page...";
|
message.innerText = "OctoPrint server online, reloading page...";
|
||||||
window.location = baseUrl;
|
window.location = reloadUrl;
|
||||||
} else {
|
} else {
|
||||||
// online.gif still not available, let's look at
|
// online.gif still not available, let's look at
|
||||||
var interval = 15;
|
var interval = 15;
|
||||||
|
|||||||
Reference in new issue
Block a user