mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-09 21:17:06 +03:00
Using named cookies to get a correct redirect (#1492)
* Using named cookies
* Prevent from deleting wlan.ini file
* Missed "
* Revert "Prevent from deleting wlan.ini file"
This reverts commit 901b6998b6.
Co-authored-by: Pär Hedberg <par.hedberg@nordicmedtest.se>
This commit is contained in:
@@ -28,6 +28,22 @@
|
||||
el.style.visibility = 'visible';
|
||||
});
|
||||
}
|
||||
|
||||
function getCookie(cname) {
|
||||
let name = cname + "=";
|
||||
let decodedCookie = decodeURIComponent(document.cookie);
|
||||
let ca = decodedCookie.split(';');
|
||||
for(let i = 0; i <ca.length; i++) {
|
||||
let c = ca[i];
|
||||
while (c.charAt(0) == ' ') {
|
||||
c = c.substring(1);
|
||||
}
|
||||
if (c.indexOf(name) == 0) {
|
||||
return c.substring(name.length, c.length);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
@@ -88,11 +104,11 @@
|
||||
LoadFwVersion();
|
||||
LoadWebUiVersion();
|
||||
|
||||
if (document.cookie == "" || document.cookie == "reboot_page.html") {
|
||||
document.cookie = "overview.html";
|
||||
if (getCookie("page") == "" || getCookie("page") == "reboot_page.html") {
|
||||
document.cookie = "page=overview.html";
|
||||
}
|
||||
console.log("Loading page: " + document.cookie);
|
||||
document.getElementById('maincontent').src = document.cookie;
|
||||
console.log("Loading page: " + getCookie("page"));
|
||||
document.getElementById('maincontent').src = getCookie("page");
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -210,7 +210,7 @@ function extract() {
|
||||
document.getElementById("status").innerText = "Status: Update completed!";
|
||||
document.getElementById("doUpdate").disabled = true;
|
||||
document.getElementById("newfile").disabled = false;
|
||||
document.cookie = "overview.html"; // Make sure after the reboot we go to the overview page
|
||||
document.cookie = "page=overview.html"; // Make sure after the reboot we go to the overview page
|
||||
|
||||
if (xhttp.responseText.startsWith("reboot"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user