Files
CPLv4.0/components/modales/handlers/handleReboot.js

20 lines
501 B
JavaScript

// 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;