Letzte TDR-Messung Button erstellen

This commit is contained in:
Ismail Ali
2025-03-24 20:18:23 +01:00
parent 24306c3df8
commit 4d97252556
2 changed files with 36 additions and 23 deletions

View File

@@ -31,31 +31,44 @@ const TDRChartActionBar: React.FC = () => {
if (!data) return;
dispatch(setTDRChartDataById({ id, data }));
dispatch(setSelectedTDRId(id)); // 👉 wichtig!
dispatch(setSelectedTDRId(id));
};
const handleReset = () => {
setSelectedId(null);
dispatch(setSelectedTDRId(null));
};
return (
<div className="flex flex-wrap justify-end items-center p-2 bg-gray-100 rounded-lg space-x-2">
{idsForSlot.length > 0 && (
<>
<label htmlFor="tdrIdSelect" className="text-sm font-semibold">
Messung ID
</label>
<select
id="tdrIdSelect"
value={selectedId ?? ""}
onChange={handleSelectChange}
className="border rounded px-2 py-1 text-sm"
>
<option value="">-- Wähle Messung --</option>
{idsForSlot.map((entry) => (
<option key={entry.id} value={entry.id}>
ID {entry.id} {entry.t}
</option>
))}
</select>
</>
)}
<div className="flex justify-between items-center p-2 bg-gray-100 rounded-lg space-x-4">
{/* 🔵 Linke Seite: Reset-Button */}
<button
className="border border-gray-300 bg-white rounded px-3 py-1 text-sm hover:bg-gray-200"
onClick={handleReset}
>
Letzte Messung
</button>
{/* 🔵 Rechte Seite: Dropdown */}
<div className="flex items-center space-x-2">
<label htmlFor="tdrIdSelect" className="text-sm font-semibold">
Messung ID
</label>
<select
id="tdrIdSelect"
value={selectedId ?? ""}
onChange={handleSelectChange}
className="border rounded px-2 py-1 text-sm"
disabled={idsForSlot.length === 0}
>
<option value="">-- Wähle Messung --</option>
{idsForSlot.map((entry) => (
<option key={entry.id} value={entry.id}>
ID {entry.id} {entry.t}
</option>
))}
</select>
</div>
</div>
);
};

View File

@@ -6,5 +6,5 @@
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
*/
const webVersion = "1.6.153";
const webVersion = "1.6.154";
export default webVersion;