refactor: migrating from Telnet to WebSerial for remote logging

This commit is contained in:
Yurii
2025-11-06 13:29:59 +03:00
parent 192f4ee18b
commit 1d7f85f462
17 changed files with 75 additions and 130 deletions

View File

@@ -313,19 +313,25 @@ const setupRestoreBackupForm = (formSelector) => {
console.log("Backup: ", data);
if (data.settings != undefined) {
let response = await fetch(url, {
method: "POST",
cache: "no-cache",
credentials: "include",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({"settings": data.settings})
});
for (var key in data.settings) {
let response = await fetch(url, {
method: "POST",
cache: "no-cache",
credentials: "include",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"settings": {
[key]: data.settings[key]
}
})
});
if (!response.ok) {
onFailed();
return;
if (!response.ok) {
onFailed();
return;
}
}
}