handleReboot, handleSetDateTime und handleClearDatabase in separate Datei einfügen

This commit is contained in:
ISA
2024-11-09 15:26:05 +01:00
parent 675843b3b3
commit 44e8323e3c
4 changed files with 94 additions and 97 deletions

View File

@@ -0,0 +1,19 @@
// handlers/handleReboot.js
const handleReboot = () => {
if (
window.confirm("Sind Sie sicher, dass Sie den CPL neu starten möchten?")
) {
let currentPath = window.location.pathname;
if (!currentPath.endsWith(".html")) {
currentPath += ".html";
}
const url = `${window.location.origin}/CPL?${currentPath}&BOOT=1`;
console.log(url);
fetch(url, { method: "GET" }).finally(() => {
window.location.href = `/wait`;
});
}
};
export default handleReboot;