TDR-Aktivieren und oder TDR-deaktivieren in Mock datei

This commit is contained in:
Ismail Ali
2025-05-01 14:17:47 +02:00
parent cee2780583
commit acba477fdb
3 changed files with 15 additions and 14 deletions

View File

@@ -110,17 +110,19 @@ export default function TdrEinstellung({ slot }: Props) {
const slotParam = `KTX${slot}=${newState ? 1 : 0}`;
if (isDev) {
fetch(
`/api/cpl/updateTdrSettingsDataAPIHandler?key=win_tdrActive&slot=${slot}&value=${
newState ? 1 : 0
}`
)
const updates = [{ key: "win_tdrActive", slot, value: newState ? 1 : 0 }];
fetch("/api/cpl/updateTdrSettingsDataAPIHandler", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ updates }),
})
.then((res) => res.json())
.then((data) => {
console.log("Mock-Status aktualisiert:", data);
.then(() => {
console.log("TDR-Aktiv-Status gespeichert.");
})
.catch((err) => {
console.error("Fehler in DEV-API:", err);
console.error("Fehler beim Speichern von TDR aktiv:", err);
});
} else {
const url = `${window.location.origin}/CPL?/kabelueberwachung.html&${slotParam}`;