feat: TDR starten Button in KÜ Chart

This commit is contained in:
ISA
2025-07-31 10:13:33 +02:00
parent 86b35e9925
commit b68eb10ad4
7 changed files with 57 additions and 8 deletions

View File

@@ -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.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) NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)

View File

@@ -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.659 NEXT_PUBLIC_APP_VERSION=1.6.660
NEXT_PUBLIC_CPL_MODE=production NEXT_PUBLIC_CPL_MODE=production

View File

@@ -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 ## [1.6.659] 2025-07-31
- feat: Display und Chart für KÜs - feat: Display und Chart für KÜs

View File

@@ -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 // 📥 Beim Slot-Wechsel TDM-Liste + letzte ID laden
useEffect(() => { useEffect(() => {
if (selectedSlot !== null) { if (selectedSlot !== null) {
@@ -119,6 +146,15 @@ const TDRChartActionBar: React.FC = () => {
</button> </button>
)} )}
{/* 🚀 TDR starten */}
<button
onClick={handleStartTDR}
className="px-4 py-1 bg-littwin-blue text-white rounded text-sm whitespace-nowrap "
disabled={selectedSlot === null}
>
TDR starten
</button>
{/* 🔽 Dropdown für Messungen */} {/* 🔽 Dropdown für Messungen */}
<div className="flex items-center space-x-2"> <div className="flex items-center space-x-2">
<Listbox <Listbox
@@ -131,9 +167,9 @@ const TDRChartActionBar: React.FC = () => {
}} }}
disabled={idsForSlot.length === 0} disabled={idsForSlot.length === 0}
> >
<div className="relative w-72"> <div className="relative w-96">
<Listbox.Button className="w-full border px-2 py-1 rounded text-left bg-white flex justify-between items-center text-sm"> <Listbox.Button className="w-full border px-2 py-1 rounded text-left bg-white flex justify-between items-center text-sm">
<span> <span className="whitespace-nowrap overflow-hidden text-ellipsis">
{selectedId {selectedId
? (() => { ? (() => {
const selected = idsForSlot.find( const selected = idsForSlot.find(
@@ -172,7 +208,7 @@ const TDRChartActionBar: React.FC = () => {
key={entry.id} key={entry.id}
value={entry.id} value={entry.id}
className={({ selected, active }) => className={({ selected, active }) =>
`px-4 py-1 cursor-pointer ${ `px-4 py-1 cursor-pointer whitespace-nowrap overflow-hidden text-ellipsis ${
selected selected
? "bg-littwin-blue text-white" ? "bg-littwin-blue text-white"
: active : active

View File

@@ -31,6 +31,12 @@ const UserManagementSettings: React.FC = () => {
); );
}; };
const handleKeyDown = (e: React.KeyboardEvent) => {
if (e.key === "Enter") {
handleLogin();
}
};
return ( return (
<div className="p-6 md:p-3 bg-gray-100 max-w-5xl mr-auto"> <div className="p-6 md:p-3 bg-gray-100 max-w-5xl mr-auto">
<h2 className="text-sm md:text-md font-bold mb-4">Login Admin-Bereich</h2> <h2 className="text-sm md:text-md font-bold mb-4">Login Admin-Bereich</h2>
@@ -54,6 +60,7 @@ const UserManagementSettings: React.FC = () => {
className="border border-gray-300 rounded h-8 p-1 w-full text-xs" className="border border-gray-300 rounded h-8 p-1 w-full text-xs"
value={username} value={username}
onChange={(e) => setUsername(e.target.value)} onChange={(e) => setUsername(e.target.value)}
onKeyDown={handleKeyDown}
/> />
<input <input
type="password" type="password"
@@ -61,6 +68,7 @@ const UserManagementSettings: React.FC = () => {
className="border border-gray-300 rounded h-8 p-1 w-full text-xs" className="border border-gray-300 rounded h-8 p-1 w-full text-xs"
value={password} value={password}
onChange={(e) => setPassword(e.target.value)} onChange={(e) => setPassword(e.target.value)}
onKeyDown={handleKeyDown}
/> />
<button <button
type="button" type="button"

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "cpl-v4", "name": "cpl-v4",
"version": "1.6.659", "version": "1.6.660",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "cpl-v4", "name": "cpl-v4",
"version": "1.6.659", "version": "1.6.660",
"dependencies": { "dependencies": {
"@fontsource/roboto": "^5.1.0", "@fontsource/roboto": "^5.1.0",
"@headlessui/react": "^2.2.4", "@headlessui/react": "^2.2.4",

View File

@@ -1,6 +1,6 @@
{ {
"name": "cpl-v4", "name": "cpl-v4",
"version": "1.6.659", "version": "1.6.660",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",