- 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
18 lines
535 B
JavaScript
18 lines
535 B
JavaScript
// 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");
|
|
};
|