eeprom read write

This commit is contained in:
2025-01-21 21:59:16 +01:00
parent 1ce4d74a65
commit 8cc967cf68
6 changed files with 186 additions and 21 deletions

View File

@@ -138,6 +138,17 @@ export class Controller {
controller.firmWareView.setVersion(versionInfo);
})
}
getBackupConfig() {
controller.progressview.addIndeterminate("get_backup_config", "Downloading Backup")
fetch(PUBLIC_URL + "/get_backup_config")
.then(response => response.json())
.then(loaded => {
controller.progressview.removeProgress("get_config")
alert(loaded)
})
}
downloadConfig() {
controller.progressview.addIndeterminate("get_config", "Downloading Config")
fetch(PUBLIC_URL + "/get_config")
@@ -166,6 +177,16 @@ export class Controller {
//load from remote to be clean
controller.downloadConfig()
}
backupConfig(json: string, statusCallback: (status: string) => void) {
controller.progressview.addIndeterminate("backup_config", "Backingup Config")
fetch(PUBLIC_URL + "/backup_config", {
method: "POST",
body: json,
})
.then(response => response.text())
.then(text => statusCallback(text))
controller.progressview.removeProgress("backup_config")
}
syncRTCFromBrowser() {
controller.progressview.addIndeterminate("write_rtc", "Writing RTC")
var value: SetTime = {