feat: Kabelname anzeigen in den modal kueEinstellung.tsx
This commit is contained in:
@@ -133,19 +133,61 @@ var win_kueID = [
|
|||||||
"Kabel 32",
|
"Kabel 32",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Kabelnamen in der Anzeige
|
||||||
|
var win_kueName = [
|
||||||
|
"Kabel 1",
|
||||||
|
"Kabel 2",
|
||||||
|
"Kabel 3",
|
||||||
|
"Kabel 4",
|
||||||
|
"Kabel 5",
|
||||||
|
"Kabel 6",
|
||||||
|
"Kabel 7",
|
||||||
|
"Kabel 8",
|
||||||
|
"Kabel 9",
|
||||||
|
"Kabel 10",
|
||||||
|
"Kabel 11",
|
||||||
|
"Kabel 12",
|
||||||
|
"Kabel 13",
|
||||||
|
"Kabel 14",
|
||||||
|
"Kabel 15",
|
||||||
|
"Kabel 16",
|
||||||
|
"Kabel 17",
|
||||||
|
"Kabel 18",
|
||||||
|
"Kabel 19",
|
||||||
|
"Kabel 20",
|
||||||
|
"Kabel 21",
|
||||||
|
"Kabel 22",
|
||||||
|
"Kabel 23",
|
||||||
|
"Kabel 24",
|
||||||
|
"Kabel 25",
|
||||||
|
"Kabel 26",
|
||||||
|
"Kabel 27",
|
||||||
|
"Kabel 28",
|
||||||
|
"Kabel 29",
|
||||||
|
"Kabel 30",
|
||||||
|
"Kabel 31",
|
||||||
|
"Kabel 32",
|
||||||
|
];
|
||||||
|
|
||||||
//-------------TDR---------------------------------------------------
|
//-------------TDR---------------------------------------------------
|
||||||
var win_tdrActive = [
|
var win_tdrActive = [
|
||||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1,
|
||||||
];
|
];
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
var win_tdrAtten = [
|
var win_tdrAtten = [
|
||||||
11, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0
|
11, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
|
||||||
|
2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
|
||||||
|
2.0,
|
||||||
];
|
];
|
||||||
var win_tdrSpeed = [
|
var win_tdrSpeed = [
|
||||||
112, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100
|
112, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
|
||||||
|
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
|
||||||
|
100, 100,
|
||||||
];
|
];
|
||||||
var win_tdrTrigger = [
|
var win_tdrTrigger = [
|
||||||
102, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80
|
102, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
|
||||||
|
80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
|
||||||
];
|
];
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
var win_tdrPulse = [
|
var win_tdrPulse = [
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ export default function KueEinstellung({
|
|||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const {
|
const {
|
||||||
kueID,
|
kueID,
|
||||||
|
kueName,
|
||||||
kueLimit1,
|
kueLimit1,
|
||||||
kueDelay1,
|
kueDelay1,
|
||||||
kueLimit2Low,
|
kueLimit2Low,
|
||||||
@@ -57,7 +58,8 @@ export default function KueEinstellung({
|
|||||||
const [formData, setFormData] = useState(() => {
|
const [formData, setFormData] = useState(() => {
|
||||||
if (cached) return cached;
|
if (cached) return cached;
|
||||||
return {
|
return {
|
||||||
name: kueID[slot] || "",
|
kueID: kueID[slot] || "",
|
||||||
|
kueName: kueName[slot] || "",
|
||||||
limit1: kueLimit1[slot]?.toString() ?? "",
|
limit1: kueLimit1[slot]?.toString() ?? "",
|
||||||
delay1: kueDelay1[slot]?.toString() ?? "",
|
delay1: kueDelay1[slot]?.toString() ?? "",
|
||||||
limit2Low: kueLimit2Low[slot]?.toString() ?? "",
|
limit2Low: kueLimit2Low[slot]?.toString() ?? "",
|
||||||
@@ -74,9 +76,12 @@ export default function KueEinstellung({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSaveWrapper = () => {
|
const handleSaveWrapper = async () => {
|
||||||
const updatedKueID = [...kueID];
|
const updatedKueID = [...kueID];
|
||||||
updatedKueID[slot] = formData.name;
|
updatedKueID[slot] = formData.kueID;
|
||||||
|
|
||||||
|
const updatedKueName = [...kueName];
|
||||||
|
updatedKueName[slot] = formData.kueName;
|
||||||
|
|
||||||
const updatedLimit1 = [...kueLimit1];
|
const updatedLimit1 = [...kueLimit1];
|
||||||
updatedLimit1[slot] = Number(formData.limit1);
|
updatedLimit1[slot] = Number(formData.limit1);
|
||||||
@@ -93,31 +98,9 @@ export default function KueEinstellung({
|
|||||||
const updatedMemoryInterval = [...memoryInterval];
|
const updatedMemoryInterval = [...memoryInterval];
|
||||||
updatedMemoryInterval[slot] = Number(formData.memoryInterval);
|
updatedMemoryInterval[slot] = Number(formData.memoryInterval);
|
||||||
|
|
||||||
handleSave({
|
|
||||||
ids: updatedKueID,
|
|
||||||
isolationsgrenzwerte: updatedLimit1,
|
|
||||||
verzoegerung: updatedDelay1,
|
|
||||||
untereSchleifenGrenzwerte: updatedLimit2Low,
|
|
||||||
obereSchleifenGrenzwerte: updatedLimit2Low,
|
|
||||||
schleifenintervall: updatedLoopInterval,
|
|
||||||
speicherintervall: updatedMemoryInterval,
|
|
||||||
originalValues: {
|
|
||||||
kueID,
|
|
||||||
isolationsgrenzwerte: kueLimit1,
|
|
||||||
verzoegerung: kueDelay1,
|
|
||||||
untereSchleifenGrenzwerte: kueLimit2Low,
|
|
||||||
obereSchleifenGrenzwerte: kueLimit2Low,
|
|
||||||
schleifenintervall: kueLoopInterval,
|
|
||||||
speicherintervall: memoryInterval,
|
|
||||||
},
|
|
||||||
slot,
|
|
||||||
dispatch,
|
|
||||||
onModulNameChange: onModulNameChange ?? (() => {}),
|
|
||||||
onClose,
|
|
||||||
});
|
|
||||||
|
|
||||||
const newData = {
|
const newData = {
|
||||||
name: updatedKueID[slot],
|
kueID: updatedKueID[slot],
|
||||||
|
kueName: updatedKueName[slot],
|
||||||
limit1: updatedLimit1[slot].toString(),
|
limit1: updatedLimit1[slot].toString(),
|
||||||
delay1: updatedDelay1[slot].toString(),
|
delay1: updatedDelay1[slot].toString(),
|
||||||
limit2Low: updatedLimit2Low[slot].toString(),
|
limit2Low: updatedLimit2Low[slot].toString(),
|
||||||
@@ -126,10 +109,35 @@ export default function KueEinstellung({
|
|||||||
};
|
};
|
||||||
|
|
||||||
setFormData(newData);
|
setFormData(newData);
|
||||||
|
|
||||||
if (typeof window !== "undefined") {
|
if (typeof window !== "undefined") {
|
||||||
window.__kueCache![formCacheKey] = newData;
|
window.__kueCache![`slot_${slot}`] = newData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 🔧 handleSave aufrufen mit allen Daten
|
||||||
|
await handleSave({
|
||||||
|
slot,
|
||||||
|
ids: updatedKueID,
|
||||||
|
kueName: updatedKueName,
|
||||||
|
isolationsgrenzwerte: updatedLimit1,
|
||||||
|
verzoegerung: updatedDelay1,
|
||||||
|
untereSchleifenGrenzwerte: updatedLimit2Low,
|
||||||
|
obereSchleifenGrenzwerte: updatedLimit2Low, // ggf. anpassen, falls du später High-Werte brauchst
|
||||||
|
schleifenintervall: updatedLoopInterval,
|
||||||
|
speicherintervall: updatedMemoryInterval,
|
||||||
|
originalValues: {
|
||||||
|
kueID,
|
||||||
|
kueName,
|
||||||
|
isolationsgrenzwerte: kueLimit1,
|
||||||
|
verzoegerung: kueDelay1,
|
||||||
|
untereSchleifenGrenzwerte: kueLimit2Low,
|
||||||
|
obereSchleifenGrenzwerte: kueLimit2Low,
|
||||||
|
schleifenintervall: kueLoopInterval,
|
||||||
|
speicherintervall: memoryInterval,
|
||||||
|
},
|
||||||
|
dispatch,
|
||||||
|
onModulNameChange,
|
||||||
|
onClose,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -137,11 +145,22 @@ export default function KueEinstellung({
|
|||||||
{/* Kabelbezeichnung */}
|
{/* Kabelbezeichnung */}
|
||||||
<div className="mb-4 grid grid-cols-3 items-center gap-2 w-full">
|
<div className="mb-4 grid grid-cols-3 items-center gap-2 w-full">
|
||||||
<label className="">Kabelbezeichnung:</label>
|
<label className="">Kabelbezeichnung:</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
className="w-full border rounded p-1 bg-gray-100 text-gray-600"
|
||||||
|
value={formData.kueID}
|
||||||
|
readOnly
|
||||||
|
title="Feld kann nicht bearbeitet werden"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{/* Kabelname */}
|
||||||
|
<div className="mb-4 grid grid-cols-3 items-center gap-2 w-full">
|
||||||
|
<label className="">Kabelname:</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className="w-full border rounded p-1"
|
className="w-full border rounded p-1"
|
||||||
value={formData.name}
|
value={formData.kueName}
|
||||||
onChange={(e) => handleChange("name", e.target.value)}
|
onChange={(e) => handleChange("kueName", e.target.value)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/* Speicherintervall */}
|
{/* Speicherintervall */}
|
||||||
@@ -223,7 +242,7 @@ export default function KueEinstellung({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-end gap-2 p-3 rounded">
|
<div className="flex justify-end gap-2 p-0 rounded">
|
||||||
{isAdminLoggedIn && (
|
{isAdminLoggedIn && (
|
||||||
<button
|
<button
|
||||||
onClick={() => firmwareUpdate(slot)}
|
onClick={() => firmwareUpdate(slot)}
|
||||||
|
|||||||
@@ -6,5 +6,5 @@
|
|||||||
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
||||||
|
|
||||||
*/
|
*/
|
||||||
const webVersion = "1.6.404";
|
const webVersion = "1.6.405";
|
||||||
export default webVersion;
|
export default webVersion;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ interface KueDataState {
|
|||||||
//-----------------------
|
//-----------------------
|
||||||
kueOnline: number[];
|
kueOnline: number[];
|
||||||
kueID: string[];
|
kueID: string[];
|
||||||
|
kueName?: string[];
|
||||||
kuePSTmMinus96V: number[];
|
kuePSTmMinus96V: number[];
|
||||||
kueAlarm1: number[];
|
kueAlarm1: number[];
|
||||||
kueAlarm2: number[];
|
kueAlarm2: number[];
|
||||||
@@ -58,6 +59,7 @@ const initialState: KueDataState = {
|
|||||||
//-----------------------
|
//-----------------------
|
||||||
kueOnline: [],
|
kueOnline: [],
|
||||||
kueID: [],
|
kueID: [],
|
||||||
|
kueName: [],
|
||||||
kuePSTmMinus96V: [],
|
kuePSTmMinus96V: [],
|
||||||
kueAlarm1: [],
|
kueAlarm1: [],
|
||||||
kueAlarm2: [],
|
kueAlarm2: [],
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ export const fetchKueDataService = async () => {
|
|||||||
return {
|
return {
|
||||||
kueOnline: win.win_kueOnline || [],
|
kueOnline: win.win_kueOnline || [],
|
||||||
kueID: win.win_kueID || [],
|
kueID: win.win_kueID || [],
|
||||||
|
kueName: win.win_kueName || [],
|
||||||
kuePSTmMinus96V: win.win_kuePSTmMinus96V || [],
|
kuePSTmMinus96V: win.win_kuePSTmMinus96V || [],
|
||||||
kueAlarm1: win.win_kueAlarm1 || [],
|
kueAlarm1: win.win_kueAlarm1 || [],
|
||||||
kueAlarm2: win.win_kueAlarm2 || [],
|
kueAlarm2: win.win_kueAlarm2 || [],
|
||||||
|
|||||||
Reference in New Issue
Block a user