- Moved `handleSave`, `handleChange`, `handleDisplayEinschalten`, `handleSetDateTime`, `handleClearDatabase`, and `handleReboot` to separate handler files for better modularity and code organization. - Updated imports in `KueModal.jsx` and `SettingsModal.jsx` to use new handler files. - Improved code readability and maintainability by organizing functions into dedicated handler modules.
17 lines
517 B
JavaScript
17 lines
517 B
JavaScript
const handleDisplayEinschalten = (slot) => {
|
|
const url = `/CPL?/kabelueberwachung.html&KSD${slot}=1`;
|
|
fetch(url, { method: "GET" })
|
|
.then((response) => {
|
|
if (response.ok) {
|
|
alert(`Display für Slot ${slot + 1} erfolgreich eingeschaltet!`);
|
|
} else {
|
|
alert("Fehler beim Einschalten des Displays!");
|
|
}
|
|
})
|
|
.catch((error) => {
|
|
console.error("Fehler:", error);
|
|
alert("Fehler beim Einschalten des Displays!");
|
|
});
|
|
};
|
|
export default handleDisplayEinschalten;
|