From 0b7542488e2f85507c60747a5cf62299dbf76fb0 Mon Sep 17 00:00:00 2001 From: ISA Date: Fri, 1 Aug 2025 12:10:12 +0200 Subject: [PATCH] fix: link in console --- .env.development | 2 +- .env.production | 2 +- CHANGELOG.md | 5 ++ components/main/system/DetailModal.tsx | 82 ++++++++----------- package-lock.json | 4 +- package.json | 2 +- .../fetchSystemspannung15VminusService.ts | 1 + services/fetchSystemspannung15VplusService.ts | 1 + services/fetchSystemspannung5VplusService.ts | 1 + .../fetchSystemspannung98VminusService.ts | 1 + services/fetchTemperaturAdWandlerService.ts | 1 + services/fetchTemperaturProzessorService.ts | 1 + 12 files changed, 49 insertions(+), 54 deletions(-) diff --git a/.env.development b/.env.development index feeb491..3969689 100644 --- a/.env.development +++ b/.env.development @@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false NEXT_PUBLIC_EXPORT_STATIC=false NEXT_PUBLIC_USE_CGI=false # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.6.675 +NEXT_PUBLIC_APP_VERSION=1.6.676 NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter) diff --git a/.env.production b/.env.production index 36b0e95..e7a4531 100644 --- a/.env.production +++ b/.env.production @@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL NEXT_PUBLIC_EXPORT_STATIC=true NEXT_PUBLIC_USE_CGI=true # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.6.675 +NEXT_PUBLIC_APP_VERSION=1.6.676 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d76cee8..cc2a3e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.6.676] – 2025-08-01 + +- fix: richtige Link in system fetch service + +--- ## [1.6.675] – 2025-08-01 - feat: fetchSystemData.mjs erweitert und optimiert diff --git a/components/main/system/DetailModal.tsx b/components/main/system/DetailModal.tsx index ebd2085..dc5ea89 100644 --- a/components/main/system/DetailModal.tsx +++ b/components/main/system/DetailModal.tsx @@ -2,8 +2,8 @@ // /components/main/system/DetailModal.tsx import React, { useEffect, useRef, useState } from "react"; import { Line } from "react-chartjs-2"; -import { useSelector, useDispatch } from "react-redux"; -import { RootState } from "@/redux/store"; +import { useSelector } from "react-redux"; +import { RootState, useAppDispatch } from "@/redux/store"; import { Listbox } from "@headlessui/react"; import { setFullScreen } from "@/redux/slices/kabelueberwachungChartSlice"; import DateRangePicker from "@/components/common/DateRangePicker"; @@ -12,6 +12,14 @@ import { setBisDatum, } from "@/redux/slices/kabelueberwachungChartSlice"; +// Import Thunks +import { getSystemspannung5VplusThunk } from "@/redux/thunks/getSystemspannung5VplusThunk"; +import { getSystemspannung15VplusThunk } from "@/redux/thunks/getSystemspannung15VplusThunk"; +import { getSystemspannung15VminusThunk } from "@/redux/thunks/getSystemspannung15VminusThunk"; +import { getSystemspannung98VminusThunk } from "@/redux/thunks/getSystemspannung98VminusThunk"; +import { getTemperaturAdWandlerThunk } from "@/redux/thunks/getTemperaturAdWandlerThunk"; +import { getTemperaturProzessorThunk } from "@/redux/thunks/getTemperaturProzessorThunk"; + import { Chart as ChartJS, LineElement, @@ -158,7 +166,7 @@ export const DetailModal = ({ const isFullScreen = useSelector( (state: RootState) => state.kabelueberwachungChartSlice.isFullScreen ); - const dispatch = useDispatch(); + const dispatch = useAppDispatch(); const toggleFullScreen = () => { dispatch(setFullScreen(!isFullScreen)); @@ -186,55 +194,31 @@ export const DetailModal = ({ loadZoomPlugin(); }, []); + // API-Request beim Klick auf "Daten laden" const handleFetchData = () => { setIsLoading(true); - let sortedData = [...reduxData].reverse(); - - if (vonDatum && bisDatum) { - const vonDate = new Date(vonDatum); - const bisDate = new Date(bisDatum); - sortedData = sortedData.filter((entry) => { - const entryDate = new Date(entry.t); - return entryDate >= vonDate && entryDate <= bisDate; - }); + switch (selectedKey) { + case "+5V": + dispatch(getSystemspannung5VplusThunk(zeitraum)); + break; + case "+15V": + dispatch(getSystemspannung15VplusThunk(zeitraum)); + break; + case "-15V": + dispatch(getSystemspannung15VminusThunk(zeitraum)); + break; + case "-98V": + dispatch(getSystemspannung98VminusThunk(zeitraum)); + break; + case "ADC Temp": + dispatch(getTemperaturAdWandlerThunk(zeitraum)); + break; + case "CPU Temp": + dispatch(getTemperaturProzessorThunk(zeitraum)); + break; + default: + break; } - - setFilteredData(sortedData); - - setChartData({ - datasets: [ - { - label: "Minimum", - data: sortedData.map((p) => ({ x: new Date(p.t), y: p.i })), - borderColor: "lightgrey", - backgroundColor: "rgba(211,211,211,0.3)", - borderWidth: 2, - pointRadius: 0, - tension: 0.1, - }, - { - label: "Maximum", - data: sortedData.map((p) => ({ x: new Date(p.t), y: p.a })), - borderColor: "lightgrey", - backgroundColor: "rgba(211,211,211,0.3)", - borderWidth: 2, - pointRadius: 0, - tension: 0.1, - }, - { - label: zeitraum === "DIA0" ? "Messwert" : "Durchschnitt", - data: sortedData.map((p) => ({ - x: new Date(p.t), - y: zeitraum === "DIA0" ? p.m : p.g, - })), - borderColor: "rgba(59,130,246,1)", - backgroundColor: "rgba(59,130,246,0.3)", - borderWidth: 2, - pointRadius: 0, - tension: 0.1, - }, - ], - }); }; useEffect(() => { diff --git a/package-lock.json b/package-lock.json index dbf6c8d..d4cc638 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cpl-v4", - "version": "1.6.675", + "version": "1.6.676", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cpl-v4", - "version": "1.6.675", + "version": "1.6.676", "dependencies": { "@fontsource/roboto": "^5.1.0", "@headlessui/react": "^2.2.4", diff --git a/package.json b/package.json index 714496a..6aaa0d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cpl-v4", - "version": "1.6.675", + "version": "1.6.676", "private": true, "scripts": { "dev": "next dev", diff --git a/services/fetchSystemspannung15VminusService.ts b/services/fetchSystemspannung15VminusService.ts index f6d6cbf..a793dea 100644 --- a/services/fetchSystemspannung15VminusService.ts +++ b/services/fetchSystemspannung15VminusService.ts @@ -26,6 +26,7 @@ export const fetchSystemspannung15VminusService = async ( ? `/api/cpl/getSystemspannung15VminusHandler?typ=${type}` : `/CPL?seite.ACP&${type}=${fromParts.y};${fromParts.m};${fromParts.d};${toParts.y};${toParts.m};${toParts.d};${channel};1`; + console.log("[Service] fetchSystemspannung15VminusService", path); const res = await fetch(path); if (!res.ok) throw new Error("❌ Fehler beim Abrufen der -15V-Daten"); diff --git a/services/fetchSystemspannung15VplusService.ts b/services/fetchSystemspannung15VplusService.ts index 6fa0f50..f266f82 100644 --- a/services/fetchSystemspannung15VplusService.ts +++ b/services/fetchSystemspannung15VplusService.ts @@ -27,6 +27,7 @@ export const fetchSystemspannung15VplusService = async ( ? `/api/cpl/getSystemspannung15VplusHandler?typ=${type}` : `/CPL?seite.ACP&${type}=${fromParts.y};${fromParts.m};${fromParts.d};${toParts.y};${toParts.m};${toParts.d};${channel};1`; + console.log("[Service] fetchSystemspannung15VplusService", path); const res = await fetch(path); if (!res.ok) throw new Error("❌ Fehler beim Abrufen der +15V-Daten"); diff --git a/services/fetchSystemspannung5VplusService.ts b/services/fetchSystemspannung5VplusService.ts index ffc7c1a..15f0fcd 100644 --- a/services/fetchSystemspannung5VplusService.ts +++ b/services/fetchSystemspannung5VplusService.ts @@ -28,6 +28,7 @@ export const fetchSystemspannung5VplusService = async ( ? `/api/cpl/getSystemspannung5VplusHandler?typ=${type}` : `/CPL?seite.ACP&${type}=${fromParts.y};${fromParts.m};${fromParts.d};${toParts.y};${toParts.m};${toParts.d};${channel};1`; + console.log("[Service] fetchSystemspannung5VplusService", path); const res = await fetch(path); if (!res.ok) throw new Error("❌ Fehler beim Abrufen der +5V-Daten"); diff --git a/services/fetchSystemspannung98VminusService.ts b/services/fetchSystemspannung98VminusService.ts index cebb830..b9a0d32 100644 --- a/services/fetchSystemspannung98VminusService.ts +++ b/services/fetchSystemspannung98VminusService.ts @@ -26,6 +26,7 @@ export const fetchSystemspannung98VminusService = async ( ? `/api/cpl/getSystemspannung98VminusHandler?typ=${type}` : `/CPL?seite.ACP&${type}=${fromParts.y};${fromParts.m};${fromParts.d};${toParts.y};${toParts.m};${toParts.d};${channel};1`; + console.log("[Service] fetchSystemspannung98VminusService", path); const res = await fetch(path); if (!res.ok) throw new Error("❌ Fehler beim Abrufen der -98V-Daten"); diff --git a/services/fetchTemperaturAdWandlerService.ts b/services/fetchTemperaturAdWandlerService.ts index 699fa9f..2a47b15 100644 --- a/services/fetchTemperaturAdWandlerService.ts +++ b/services/fetchTemperaturAdWandlerService.ts @@ -26,6 +26,7 @@ export const fetchTemperaturAdWandlerService = async ( ? `/api/cpl/getTemperaturAdWandlerHandler?typ=${type}` : `/CPL?seite.ACP&${type}=${fromParts.y};${fromParts.m};${fromParts.d};${toParts.y};${toParts.m};${toParts.d};${channel};1`; + console.log("[Service] fetchTemperaturAdWandlerService", path); const res = await fetch(path); if (!res.ok) throw new Error( diff --git a/services/fetchTemperaturProzessorService.ts b/services/fetchTemperaturProzessorService.ts index 85affff..2415698 100644 --- a/services/fetchTemperaturProzessorService.ts +++ b/services/fetchTemperaturProzessorService.ts @@ -26,6 +26,7 @@ export const fetchTemperaturProzessorService = async ( ? `/api/cpl/getTemperaturProzessorHandler?typ=${type}` : `/CPL?seite.ACP&${type}=${fromParts.y};${fromParts.m};${fromParts.d};${toParts.y};${toParts.m};${toParts.d};${channel};1`; + console.log("[Service] fetchTemperaturProzessorService", path); const res = await fetch(path); if (!res.ok) throw new Error("❌ Fehler beim Abrufen der Temperaturdaten (Prozessor)");