From e7d120c4774688abe87787f8dd19f904299f7419 Mon Sep 17 00:00:00 2001 From: ISA Date: Mon, 11 Aug 2025 16:45:56 +0200 Subject: [PATCH] =?UTF-8?q?RSL-Progress=20(120s=20Overlay=20mit=20Balken?= =?UTF-8?q?=20+=20Blockierung)=20ist=20implementiert:=20Button=20zeigt=20R?= =?UTF-8?q?SL=20l=C3=A4uft=E2=80=A6,=20Daten=20laden=20ist=20gesperrt,=20O?= =?UTF-8?q?verlay=20mit=20Restsekunden=20und=20Fortschritt.=20Countdown=20?= =?UTF-8?q?endet=20automatisch.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.production | 2 +- CHANGELOG.md | 5 ++ .../LoopChartActionBar.tsx | 54 +++++++++++++++++-- docs/TODO.md | 10 +++- package-lock.json | 4 +- package.json | 2 +- 7 files changed, 69 insertions(+), 10 deletions(-) diff --git a/.env.development b/.env.development index a18fdde..2ac661d 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.689 +NEXT_PUBLIC_APP_VERSION=1.6.690 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 2560032..78633ce 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.689 +NEXT_PUBLIC_APP_VERSION=1.6.690 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e84ab0..f04e820 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.6.690] – 2025-08-11 + +- Globales Auto-Highlight wurde eingefügt + +--- ## [1.6.689] – 2025-08-11 - playwright recording and testing diff --git a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx index b49f10e..89b9a81 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx @@ -1,6 +1,6 @@ "use client"; // /components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx -import React from "react"; +import React, { useEffect, useState } from "react"; import DateRangePicker from "@/components/common/DateRangePicker"; import { useDispatch, useSelector } from "react-redux"; import { RootState } from "@/redux/store"; @@ -93,6 +93,34 @@ export const useLoopChartLoader = () => { //-----------------------------------------------------------------------------------LoopChartActionBar const LoopChartActionBar: React.FC = () => { const dispatch = useDispatch(); + // RSL Progress State (120s künstlicher Countdown) + const TOTAL_DURATION = 120; // Sekunden + const [rslRunning, setRslRunning] = useState(false); + const [rslProgress, setRslProgress] = useState(0); + + // Fortschritt aktualisieren + useEffect(() => { + if (!rslRunning) return; + setRslProgress(0); + const startedAt = Date.now(); + const interval = setInterval(() => { + const elapsed = Math.floor((Date.now() - startedAt) / 1000); + if (elapsed >= TOTAL_DURATION) { + setRslProgress(TOTAL_DURATION); + setRslRunning(false); + clearInterval(interval); + // Optional automatische Daten-Nachladung anstoßen + } else { + setRslProgress(elapsed); + } + }, 1000); + return () => clearInterval(interval); + }, [rslRunning]); + + const startRslProgress = () => { + setRslRunning(true); + setRslProgress(0); + }; const { vonDatum, @@ -147,7 +175,8 @@ const LoopChartActionBar: React.FC = () => { } console.log("✅ RSL Messung gestartet für Slot", slotNumber); - alert(`✅ RSL Messung für Slot ${slotNumber + 1} gestartet`); + // Start der lokalen Progress-Anzeige (ca. 120s) + startRslProgress(); } catch (err) { console.error("❌ Fehler beim Starten der RSL Messung:", err); alert("❌ Fehler beim Starten der RSL Messung."); @@ -306,18 +335,35 @@ const LoopChartActionBar: React.FC = () => { + {rslRunning && ( +
+
+

RSL Messung läuft

+

+ Bitte warten… (noch {TOTAL_DURATION - rslProgress}s) +

+
+
+
+
+
+ )}
); }; diff --git a/docs/TODO.md b/docs/TODO.md index 7cf4609..1ba4fe1 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -56,4 +56,12 @@ Beispiel: ISO: 100 MOHm der beim Abliech: ISO: Abgleich in Rot, wenn Schleifenfehler ansteht -Beispiel:: RSL: 1,7 kOhm oder wenn Schleifenmessung aktiv: RSL: Messung +## Beispiel:: RSL: 1,7 kOhm oder wenn Schleifenmessung aktiv: RSL: Messung + +## 11.08.2025 + +- [ ] TODO: Bei Schleife starten messen wie lange es dauert, dann entsprechend progress balken einbauen +- [ ] TODO: Kalibrieren auch so +- [ ] TODO: Abgleich auch so +- [ ] TODO: Benutzer passwort ändern +- [ ] TODO: PlayWright diff --git a/package-lock.json b/package-lock.json index b454399..2f61dd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cpl-v4", - "version": "1.6.689", + "version": "1.6.690", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cpl-v4", - "version": "1.6.689", + "version": "1.6.690", "dependencies": { "@fontsource/roboto": "^5.1.0", "@headlessui/react": "^2.2.4", diff --git a/package.json b/package.json index 7ac0e2a..71bdd04 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cpl-v4", - "version": "1.6.689", + "version": "1.6.690", "private": true, "scripts": { "dev": "next dev",