feat: fetch-Services für Spannung und Temperatur für Dev- und Prod-Modus angepasst

- fetchSystemspannung5VplusService: Channel 110 (+5V), prod = /cpl?/dashboard.html
- fetchSystemspannung15VplusService: Channel 108 (+15V)
- fetchSystemspannung15VminusService: Channel 114 (-15V)
- fetchSystemspannung98VminusService: Channel 115 (-98V)
- fetchTemperaturAdWandlerService: Channel 116 (Temperatur AD-Wandler)
- fetchTemperaturProzessorService: Channel 117 (Temperatur Prozessor)

→ Dev-Mode verwendet API-Handler (/api/cpl/...)
→ Production-Mode nutzt CGI-kompatible URLs (/cpl?/dashboard.html&...)

Fehlerbehandlung integriert, Struktur für Wiederverwendung vereinheitlicht
This commit is contained in:
ISA
2025-07-03 14:02:16 +02:00
parent b1eb3c46a8
commit 859a8f1d64
12 changed files with 141 additions and 41 deletions

17
public/CPL/js/abfrage.js Normal file
View File

@@ -0,0 +1,17 @@
// window-Funktion, damit sie global im Browser verfügbar ist
window.startAbfrage = function (fromDate, toDate, quelle, typ) {
// Datum formatieren: yyyy;MM;dd
const format = (dateStr) => {
const d = new Date(dateStr);
return `${d.getFullYear()};${d.getMonth() + 1};${d.getDate()}`;
};
const von = format(fromDate);
const bis = format(toDate);
// Beispiel-Kanal: 110 = +5V
const diaURL = `/cpl?/dashboard.html&DIA1=${von};${bis};${quelle};${typ};`;
// Neue Seite öffnen
window.open(diaURL, "_blank");
};