diff --git a/.env.development b/.env.development index 9b3577b..5cf06d0 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.692 +NEXT_PUBLIC_APP_VERSION=1.6.694 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 ddd7cc1..afa3de2 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.692 +NEXT_PUBLIC_APP_VERSION=1.6.694 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1165a05..a9f9a64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [1.6.694] – 2025-08-12 + +- feat: RSL starten in Dev mode 15 Sek. und in prod. 120 Sek. + +--- +## [1.6.693] – 2025-08-12 + +- feat: RSL starten in Dev mode 15 Sek. und in prod. 120 Sek. + +--- ## [1.6.692] – 2025-08-12 - PlayWright Test diff --git a/components/main/kabelueberwachung/kue705FO/Charts/IsoMeasurementChart/IsoChartActionBar.tsx b/components/main/kabelueberwachung/kue705FO/Charts/IsoMeasurementChart/IsoChartActionBar.tsx index b84c1b6..6801c12 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/IsoMeasurementChart/IsoChartActionBar.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/IsoMeasurementChart/IsoChartActionBar.tsx @@ -11,6 +11,7 @@ import { setLoading, } from "@/redux/slices/kabelueberwachungChartSlice"; import { setBrushRange } from "@/redux/slices/brushSlice"; +import { getMessagesThunk } from "@/redux/thunks/getMessagesThunk"; import { Listbox } from "@headlessui/react"; //-----------------------------------------------------------------------------------useIsoChartLoader @@ -174,22 +175,31 @@ const IsoChartActionBar: React.FC = () => { const { vonDatum, bisDatum, selectedMode, slotNumber, chartTitle } = useSelector((state: RootState) => state.kabelueberwachungChartSlice); + // Aus DateRangePicker-Slice kommen die Werte, die der User im UI wählt + const { vonDatum: pickerVonDatum, bisDatum: pickerBisDatum } = useSelector( + (state: RootState) => state.dateRangePicker + ); const formatDate = (dateString: string) => { const [year, month, day] = dateString.split("-"); return `${year};${month};${day}`; }; - const getApiUrl = (mode: "DIA0" | "DIA1" | "DIA2", slotNumber: number) => { + const getApiUrl = ( + mode: "DIA0" | "DIA1" | "DIA2", + slotNumber: number, + fromDate: string, + toDate: string + ) => { const type = 3; // Fest auf Isolationswiderstand gesetzt const typeFolder = "isolationswiderstand"; const baseUrl = process.env.NODE_ENV === "development" - ? `/api/cpl/slotDataAPIHandler?slot=${slotNumber}&messart=${typeFolder}&dia=${mode}&vonDatum=${vonDatum}&bisDatum=${bisDatum}` + ? `/api/cpl/slotDataAPIHandler?slot=${slotNumber}&messart=${typeFolder}&dia=${mode}&vonDatum=${fromDate}&bisDatum=${toDate}` : `${window.location.origin}/CPL?seite.ACP&${mode}=${formatDate( - vonDatum - )};${formatDate(bisDatum)};${slotNumber};${type};`; + fromDate + )};${formatDate(toDate)};${slotNumber};${type};`; console.log("baseUrl", baseUrl); return baseUrl; @@ -200,8 +210,26 @@ const IsoChartActionBar: React.FC = () => { alert("⚠️ Bitte zuerst einen KÜ auswählen!"); return; } + // Wenn Meldungen-Ansicht aktiv ist, dann Meldungen laden + if (chartTitle === "Meldungen") { + try { + dispatch(setLoading(true)); + const fromDate = pickerVonDatum ?? vonDatum; + const toDate = pickerBisDatum ?? bisDatum; + await dispatch(getMessagesThunk({ fromDate, toDate })).unwrap(); + } catch (err) { + console.error("❌ Fehler beim Laden der Meldungen:", err); + alert("❌ Fehler beim Laden der Meldungen."); + } finally { + dispatch(setLoading(false)); + } + return; + } - const apiUrl = getApiUrl(selectedMode, slotNumber); + // Messkurve (ISO) laden + const fromDate = pickerVonDatum ?? vonDatum; + const toDate = pickerBisDatum ?? bisDatum; + const apiUrl = getApiUrl(selectedMode, slotNumber, fromDate, toDate); if (!apiUrl) return; dispatch(setLoading(true)); @@ -227,8 +255,8 @@ const IsoChartActionBar: React.FC = () => { console.log("▶️ Lade Isolationswiderstand-Daten für:"); console.log(" Slot:", slotNumber); console.log(" Modus:", selectedMode); - console.log(" Von:", vonDatum); - console.log(" Bis:", bisDatum); + console.log(" Von:", fromDate); + console.log(" Bis:", toDate); console.log(" URL:", apiUrl); console.log(" Daten:", jsonData); @@ -257,12 +285,8 @@ const IsoChartActionBar: React.FC = () => {