- handleSave in separate Datei handle-save.js ausgelagert, um KueModal-Komponente modularer und wartbarer zu gestalten - handleSaveWrapper in KueModal hinzugefügt, um Parameter an handleSave zu übergeben - KueModal umgestaltet, um Funktionen und Redux-Dispatch klarer zu organisieren - Konsistente Verwendung von Parametern und State-Updates für sauberen Codefluss
20 lines
520 B
JavaScript
20 lines
520 B
JavaScript
// components/modales/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;
|