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:
@@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
|
|||||||
NEXT_PUBLIC_EXPORT_STATIC=false
|
NEXT_PUBLIC_EXPORT_STATIC=false
|
||||||
NEXT_PUBLIC_USE_CGI=false
|
NEXT_PUBLIC_USE_CGI=false
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.6.537
|
NEXT_PUBLIC_APP_VERSION=1.6.538
|
||||||
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
|
|||||||
NEXT_PUBLIC_EXPORT_STATIC=true
|
NEXT_PUBLIC_EXPORT_STATIC=true
|
||||||
NEXT_PUBLIC_USE_CGI=true
|
NEXT_PUBLIC_USE_CGI=true
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.6.537
|
NEXT_PUBLIC_APP_VERSION=1.6.538
|
||||||
NEXT_PUBLIC_CPL_MODE=production
|
NEXT_PUBLIC_CPL_MODE=production
|
||||||
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,3 +1,13 @@
|
|||||||
|
## [1.6.538] – 2025-07-03
|
||||||
|
|
||||||
|
- feat: Detailansicht auf dynamische Redux-Datenquellen umgestellt
|
||||||
|
|
||||||
|
- DetailModal.tsx überarbeitet, um Redux-Daten je nach ausgewähltem Key (+5V, +15V, -15V, -98V, ADC Temp, CPU Temp) anzuzeigen
|
||||||
|
- Zeitraum-Auswahl (DIA0, DIA1, DIA2) wird berücksichtigt und löst passenden Thunk aus
|
||||||
|
- Redux-State-Struktur vollständig integriert für Systemspannungen und Temperaturen
|
||||||
|
- Chart-Anzeige jetzt dynamisch und erweiterbar
|
||||||
|
|
||||||
|
---
|
||||||
## [1.6.537] – 2025-07-03
|
## [1.6.537] – 2025-07-03
|
||||||
|
|
||||||
- feat: APIs erstellt für Systemspannungen
|
- feat: APIs erstellt für Systemspannungen
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.537",
|
"version": "1.6.538",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.537",
|
"version": "1.6.538",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/roboto": "^5.1.0",
|
"@fontsource/roboto": "^5.1.0",
|
||||||
"@iconify-icons/ri": "^1.2.10",
|
"@iconify-icons/ri": "^1.2.10",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.537",
|
"version": "1.6.538",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|||||||
17
public/CPL/js/abfrage.js
Normal file
17
public/CPL/js/abfrage.js
Normal 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");
|
||||||
|
};
|
||||||
@@ -1,11 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* Holt Messwerte für -15V aus der passenden JSON-Datei über die API
|
||||||
|
* @param type - Typ der Daten: DIA0 = alle, DIA1 = stündlich, DIA2 = täglich
|
||||||
|
*/
|
||||||
export const fetchSystemspannung15VminusService = async (
|
export const fetchSystemspannung15VminusService = async (
|
||||||
typ: "DIA0" | "DIA1" | "DIA2"
|
type: "DIA0" | "DIA1" | "DIA2"
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
const isDev = process.env.NODE_ENV === "development";
|
||||||
`/api/cpl/getSystemspannung15VminusHandler?typ=${typ}`
|
|
||||||
);
|
const channel = 114; // 114 = -15V laut Spezifikation
|
||||||
if (!res.ok) throw new Error("Fehler beim Abrufen");
|
const from = "2025;01;01";
|
||||||
|
const to = "2025;07;31";
|
||||||
|
|
||||||
|
const path = isDev
|
||||||
|
? `/api/cpl/getSystemspannung15VminusHandler?typ=${type}`
|
||||||
|
: `/cpl?/dashboard.html&${type}=${from};${to};${channel};1;`;
|
||||||
|
|
||||||
|
const res = await fetch(path);
|
||||||
|
if (!res.ok) throw new Error("❌ Fehler beim Abrufen der -15V-Daten");
|
||||||
|
|
||||||
return await res.json();
|
return await res.json();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("❌ Fehler in fetchSystemspannung15VminusService:", err);
|
console.error("❌ Fehler in fetchSystemspannung15VminusService:", err);
|
||||||
|
|||||||
@@ -1,11 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* Holt Messwerte für +15V aus der passenden JSON-Datei über die API
|
||||||
|
* @param type - Typ der Daten: DIA0 = alle, DIA1 = stündlich, DIA2 = täglich
|
||||||
|
*/
|
||||||
export const fetchSystemspannung15VplusService = async (
|
export const fetchSystemspannung15VplusService = async (
|
||||||
typ: "DIA0" | "DIA1" | "DIA2"
|
type: "DIA0" | "DIA1" | "DIA2"
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
const isDev = process.env.NODE_ENV === "development";
|
||||||
`/api/cpl/getSystemspannung15VplusHandler?typ=${typ}`
|
|
||||||
);
|
const channel = 108; // 108 = +15V laut Spezifikation
|
||||||
if (!res.ok) throw new Error("Fehler beim Abrufen");
|
const from = "2025;01;01";
|
||||||
|
const to = "2025;07;31";
|
||||||
|
|
||||||
|
const path = isDev
|
||||||
|
? `/api/cpl/getSystemspannung15VplusHandler?typ=${type}`
|
||||||
|
: `/cpl?/dashboard.html&${type}=${from};${to};${channel};1;`;
|
||||||
|
|
||||||
|
const res = await fetch(path);
|
||||||
|
if (!res.ok) throw new Error("❌ Fehler beim Abrufen der +15V-Daten");
|
||||||
|
|
||||||
return await res.json();
|
return await res.json();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("❌ Fehler in fetchSystemspannung15VplusService:", err);
|
console.error("❌ Fehler in fetchSystemspannung15VplusService:", err);
|
||||||
|
|||||||
@@ -1,23 +1,27 @@
|
|||||||
// services/fetchSystemspannung5VplusService.ts
|
// services/fetchSystemspannung5VplusService.ts
|
||||||
|
|
||||||
type Typ = "DIA0" | "DIA1" | "DIA2";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holt Messwerte für +5V aus der passenden JSON-Datei über die API
|
* Holt Messwerte für +5V aus der passenden JSON-Datei über die API
|
||||||
* @param typ - Typ der Daten: DIA0 = alle, DIA1 = stündlich, DIA2 = täglich
|
* @param typ - Typ der Daten: DIA0 = alle, DIA1 = stündlich, DIA2 = täglich
|
||||||
*/
|
*/
|
||||||
export const fetchSystemspannung5VplusService = async (typ: Typ) => {
|
export const fetchSystemspannung5VplusService = async (
|
||||||
|
type: "DIA0" | "DIA1" | "DIA2"
|
||||||
|
) => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
const isDev = process.env.NODE_ENV === "development";
|
||||||
`/api/cpl/getSystemspannung5VplusHandler?typ=${typ}`
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!res.ok) {
|
const channel = 110; // 110 = +5V
|
||||||
throw new Error(`Fehler beim Abrufen: ${res.status}`);
|
const from = "2025;01;01";
|
||||||
}
|
const to = "2025;07;31";
|
||||||
|
|
||||||
const data = await res.json();
|
const path = isDev
|
||||||
return data;
|
? `/api/cpl/getSystemspannung5VplusHandler?typ=${type}`
|
||||||
|
: `/cpl?/dashboard.html&${type}=${from};${to};${channel};1;`;
|
||||||
|
|
||||||
|
const res = await fetch(path);
|
||||||
|
if (!res.ok) throw new Error("❌ Fehler beim Abrufen der +5V-Daten");
|
||||||
|
|
||||||
|
return await res.json();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("❌ Fehler in fetchSystemspannung5VplusService:", err);
|
console.error("❌ Fehler in fetchSystemspannung5VplusService:", err);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -1,11 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* Holt Messwerte für -98V aus der passenden JSON-Datei über die API
|
||||||
|
* @param type - Typ der Daten: DIA0 = alle, DIA1 = stündlich, DIA2 = täglich
|
||||||
|
*/
|
||||||
export const fetchSystemspannung98VminusService = async (
|
export const fetchSystemspannung98VminusService = async (
|
||||||
typ: "DIA0" | "DIA1" | "DIA2"
|
type: "DIA0" | "DIA1" | "DIA2"
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
const isDev = process.env.NODE_ENV === "development";
|
||||||
`/api/cpl/getSystemspannung98VminusHandler?typ=${typ}`
|
|
||||||
);
|
const channel = 115; // 115 = -98V laut Spezifikation
|
||||||
if (!res.ok) throw new Error("Fehler beim Abrufen");
|
const from = "2025;01;01";
|
||||||
|
const to = "2025;07;31";
|
||||||
|
|
||||||
|
const path = isDev
|
||||||
|
? `/api/cpl/getSystemspannung98VminusHandler?typ=${type}`
|
||||||
|
: `/cpl?/dashboard.html&${type}=${from};${to};${channel};1;`;
|
||||||
|
|
||||||
|
const res = await fetch(path);
|
||||||
|
if (!res.ok) throw new Error("❌ Fehler beim Abrufen der -98V-Daten");
|
||||||
|
|
||||||
return await res.json();
|
return await res.json();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("❌ Fehler in fetchSystemspannung98VminusService:", err);
|
console.error("❌ Fehler in fetchSystemspannung98VminusService:", err);
|
||||||
|
|||||||
@@ -1,11 +1,27 @@
|
|||||||
|
/**
|
||||||
|
* Holt Temperaturwerte vom AD-Wandler aus der passenden JSON-Datei über die API
|
||||||
|
* @param type - Typ der Daten: DIA0 = alle, DIA1 = stündlich, DIA2 = täglich
|
||||||
|
*/
|
||||||
export const fetchTemperaturAdWandlerService = async (
|
export const fetchTemperaturAdWandlerService = async (
|
||||||
typ: "DIA0" | "DIA1" | "DIA2"
|
type: "DIA0" | "DIA1" | "DIA2"
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
const isDev = process.env.NODE_ENV === "development";
|
||||||
`/api/cpl/getTemperaturAdWandlerHandler?typ=${typ}`
|
|
||||||
);
|
const channel = 116; // 116 = Temperatur AD-Wandler laut Spezifikation
|
||||||
if (!res.ok) throw new Error("Fehler beim Abrufen");
|
const from = "2025;01;01";
|
||||||
|
const to = "2025;07;31";
|
||||||
|
|
||||||
|
const path = isDev
|
||||||
|
? `/api/cpl/getTemperaturAdWandlerHandler?typ=${type}`
|
||||||
|
: `/cpl?/dashboard.html&${type}=${from};${to};${channel};1;`;
|
||||||
|
|
||||||
|
const res = await fetch(path);
|
||||||
|
if (!res.ok)
|
||||||
|
throw new Error(
|
||||||
|
"❌ Fehler beim Abrufen der Temperaturdaten (AD-Wandler)"
|
||||||
|
);
|
||||||
|
|
||||||
return await res.json();
|
return await res.json();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("❌ Fehler in fetchTemperaturAdWandlerService:", err);
|
console.error("❌ Fehler in fetchTemperaturAdWandlerService:", err);
|
||||||
|
|||||||
@@ -1,11 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* Holt Temperaturwerte vom Prozessor aus der passenden JSON-Datei über die API
|
||||||
|
* @param type - Typ der Daten: DIA0 = alle, DIA1 = stündlich, DIA2 = täglich
|
||||||
|
*/
|
||||||
export const fetchTemperaturProzessorService = async (
|
export const fetchTemperaturProzessorService = async (
|
||||||
typ: "DIA0" | "DIA1" | "DIA2"
|
type: "DIA0" | "DIA1" | "DIA2"
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
const isDev = process.env.NODE_ENV === "development";
|
||||||
`/api/cpl/getTemperaturProzessorHandler?typ=${typ}`
|
|
||||||
);
|
const channel = 117; // 117 = Temperatur Prozessor laut Spezifikation
|
||||||
if (!res.ok) throw new Error("Fehler beim Abrufen");
|
const from = "2025;01;01";
|
||||||
|
const to = "2025;07;31";
|
||||||
|
|
||||||
|
const path = isDev
|
||||||
|
? `/api/cpl/getTemperaturProzessorHandler?typ=${type}`
|
||||||
|
: `/cpl?/dashboard.html&${type}=${from};${to};${channel};1;`;
|
||||||
|
|
||||||
|
const res = await fetch(path);
|
||||||
|
if (!res.ok)
|
||||||
|
throw new Error("❌ Fehler beim Abrufen der Temperaturdaten (Prozessor)");
|
||||||
|
|
||||||
return await res.json();
|
return await res.json();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("❌ Fehler in fetchTemperaturProzessorService:", err);
|
console.error("❌ Fehler in fetchTemperaturProzessorService:", err);
|
||||||
|
|||||||
Reference in New Issue
Block a user