refactor: migrating from Telnet to WebSerial for remote logging

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

No files matched your search

+18 -12
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;
}
}
}