From b68eb10ad43990a018595f629ecb65814e42963e Mon Sep 17 00:00:00 2001 From: ISA Date: Thu, 31 Jul 2025 10:13:33 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20TDR=20starten=20Button=20in=20K=C3=9C?= =?UTF-8?q?=20Chart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.production | 2 +- CHANGELOG.md | 5 +++ .../Charts/TDRChart/TDRChartActionBar.tsx | 42 +++++++++++++++++-- .../UserManagementSettings.tsx | 8 ++++ package-lock.json | 4 +- package.json | 2 +- 7 files changed, 57 insertions(+), 8 deletions(-) diff --git a/.env.development b/.env.development index 676983f..53add08 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.659 +NEXT_PUBLIC_APP_VERSION=1.6.660 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 5bc7909..813d111 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.659 +NEXT_PUBLIC_APP_VERSION=1.6.660 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7de33b6..8bf72f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [1.6.660] – 2025-07-31 + +- fix: Schleifenwiderstand (TDR) Messung starten Button auf der Produktion + +--- ## [1.6.659] – 2025-07-31 - feat: Display und Chart für KÜs diff --git a/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartActionBar.tsx b/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartActionBar.tsx index f60ec07..6724d5f 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartActionBar.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/TDRChart/TDRChartActionBar.tsx @@ -82,6 +82,33 @@ const TDRChartActionBar: React.FC = () => { } }; + // 📌 TDR Messung starten + const handleStartTDR = async () => { + if (selectedSlot === null) { + alert("⚠️ Bitte zuerst einen KÜ auswählen!"); + return; + } + + const cgiUrl = `${window.location.origin}/CPL?kabelueberwachung.html&KTT${selectedSlot}=1`; + + try { + console.log("🚀 Starte TDR Messung für Slot:", selectedSlot); + console.log("📡 CGI URL:", cgiUrl); + + const response = await fetch(cgiUrl); + + if (!response.ok) { + throw new Error(`CGI-Fehler: ${response.status}`); + } + + console.log("✅ TDR Messung gestartet für Slot", selectedSlot); + alert(`✅ TDR Messung für Slot ${selectedSlot + 1} gestartet`); + } catch (err) { + console.error("❌ Fehler beim Starten der TDR Messung:", err); + alert("❌ Fehler beim Starten der TDR Messung."); + } + }; + // 📥 Beim Slot-Wechsel TDM-Liste + letzte ID laden useEffect(() => { if (selectedSlot !== null) { @@ -119,6 +146,15 @@ const TDRChartActionBar: React.FC = () => { )} + {/* 🚀 TDR starten */} + + {/* 🔽 Dropdown für Messungen */}
{ }} disabled={idsForSlot.length === 0} > -
+
- + {selectedId ? (() => { const selected = idsForSlot.find( @@ -172,7 +208,7 @@ const TDRChartActionBar: React.FC = () => { key={entry.id} value={entry.id} className={({ selected, active }) => - `px-4 py-1 cursor-pointer ${ + `px-4 py-1 cursor-pointer whitespace-nowrap overflow-hidden text-ellipsis ${ selected ? "bg-littwin-blue text-white" : active diff --git a/components/main/settingsPageComponents/UserManagementSettings.tsx b/components/main/settingsPageComponents/UserManagementSettings.tsx index fe6327b..e6912f8 100644 --- a/components/main/settingsPageComponents/UserManagementSettings.tsx +++ b/components/main/settingsPageComponents/UserManagementSettings.tsx @@ -31,6 +31,12 @@ const UserManagementSettings: React.FC = () => { ); }; + const handleKeyDown = (e: React.KeyboardEvent) => { + if (e.key === "Enter") { + handleLogin(); + } + }; + return (

Login Admin-Bereich

@@ -54,6 +60,7 @@ const UserManagementSettings: React.FC = () => { className="border border-gray-300 rounded h-8 p-1 w-full text-xs" value={username} onChange={(e) => setUsername(e.target.value)} + onKeyDown={handleKeyDown} /> { className="border border-gray-300 rounded h-8 p-1 w-full text-xs" value={password} onChange={(e) => setPassword(e.target.value)} + onKeyDown={handleKeyDown} />