Port bugfix.

This commit is contained in:
Blaz Kristan 2023-06-08 07:14:03 +02:00
parent daa3200713
commit ccb0d491ed
13 changed files with 2680 additions and 2674 deletions

View File

@ -42,7 +42,7 @@
if (paths.length > 1) {
locproto = l.protocol;
loc = true;
locip = l.hostname+l.port+"/"+paths[0];
locip = l.hostname + (l.port ? ":" + l.port : "") + "/" + paths[0];
}
}
loadJS(getURL('/settings/s.js?p=0'), false); // If we set async false, file is loaded and executed, then next statement is processed

View File

@ -50,7 +50,7 @@
if (paths.length > 2) {
locproto = l.protocol;
loc = true;
locip = l.hostname+l.port+"/"+paths[0];
locip = l.hostname + (l.port ? ":" + l.port : "") + "/" + paths[0];
}
}
loadJS(getURL('/settings/s.js?p=10'), false); // If we set async false, file is loaded and executed, then next statement is processed

View File

@ -69,7 +69,7 @@
if (paths.length > 2) {
locproto = l.protocol;
loc = true;
locip = l.hostname+l.port+"/"+paths[0];
locip = l.hostname + (l.port ? ":" + l.port : "") + "/" + paths[0];
}
}
loadJS(getURL('/settings/s.js?p=7'), false); // If we set async false, file is loaded and executed, then next statement is processed

View File

@ -562,7 +562,7 @@ Length: <input type="number" name="XC${i}" id="xc${i}" class="l" min="1" max="65
if (paths.length > 2) {
locproto = l.protocol;
loc = true;
locip = l.hostname+l.port+"/"+paths[0];
locip = l.hostname + (l.port ? ":" + l.port : "") + "/" + paths[0];
}
}
loadJS(getURL('/settings/s.js?p=2'), false); // If we set async false, file is loaded and executed, then next statement is processed

View File

@ -80,7 +80,7 @@
if (paths.length > 2) {
locproto = l.protocol;
loc = true;
locip = l.hostname+l.port+"/"+paths[0];
locip = l.hostname + (l.port ? ":" + l.port : "") + "/" + paths[0];
}
}
loadJS(getURL('/settings/s.js?p=6'), false); // If we set async false, file is loaded and executed, then next statement is processed

View File

@ -70,7 +70,7 @@
if (paths.length > 2) {
locproto = l.protocol;
loc = true;
locip = l.hostname+l.port+"/"+paths[0];
locip = l.hostname + (l.port ? ":" + l.port : "") + "/" + paths[0];
}
}
loadJS(getURL('/settings/s.js?p=4'), false); // If we set async false, file is loaded and executed, then next statement is processed

View File

@ -48,7 +48,7 @@
if (paths.length > 2) {
locproto = l.protocol;
loc = true;
locip = l.hostname+l.port+"/"+paths[0];
locip = l.hostname + (l.port ? ":" + l.port : "") + "/" + paths[0];
}
}
loadJS(getURL('/settings/s.js?p=5'), false); // If we set async false, file is loaded and executed, then next statement is processed

View File

@ -201,7 +201,7 @@
if (paths.length > 2) {
locproto = l.protocol;
loc = true;
locip = l.hostname+l.port+"/"+paths[0];
locip = l.hostname + (l.port ? ":" + l.port : "") + "/" + paths[0];
}
}
loadJS(getURL('/settings/s.js?p=3'), false); // If we set async false, file is loaded and executed, then next statement is processed

View File

@ -62,7 +62,7 @@
if (paths.length > 2) {
locproto = l.protocol;
loc = true;
locip = l.hostname+l.port+"/"+paths[0];
locip = l.hostname + (l.port ? ":" + l.port : "") + "/" + paths[0];
}
}
ldS();

View File

@ -135,7 +135,7 @@
if (paths.length > 2) {
locproto = l.protocol;
loc = true;
locip = l.hostname+l.port+"/"+paths[0];
locip = l.hostname + (l.port ? ":" + l.port : "") + "/" + paths[0];
}
}
loadJS(getURL('/settings/s.js?p=1'), false); // If we set async false, file is loaded and executed, then next statement is processed

View File

@ -159,22 +159,22 @@ function getURL(path) {
}
async function onLoad()
{
if (window.location.protocol == "file:") {
let l = window.location;
if (l.protocol == "file:") {
loc = true;
locip = localStorage.getItem('locIp');
if (!locip)
{
if (!locip) {
locip = prompt("File Mode. Please enter WLED IP!");
localStorage.setItem('locIp', locip);
}
} else {
// detect reverse proxy and/or HTTPS
let l = window.location;
let pathn = l.pathname;
let paths = pathn.slice(1,pathn.endsWith('/')?-1:undefined).split("/");
//while (paths[0]==="") paths.shift();
locproto = l.protocol;
locip = l.hostname + (l.port ? ":" + l.port : "")
if (paths.length > 1) {
locip = l.hostname + (l.port ? ":" + l.port : "");
if (paths.length > 0 && paths[0]!=="") {
loc = true;
locip += "/" + paths[0];
} else if (locproto==="https:") {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff