diff --git a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx index ba5ea41..db1abf3 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopChartActionBar.tsx @@ -4,6 +4,8 @@ import { useDispatch } from "react-redux"; import { setChartData } from "../../../../../../redux/slices/chartDataSlice"; const LoopChartActionBar: React.FC = () => { + const isolationswiderstand = 3; + const schleifenwiderstand = 4; const dispatch = useDispatch(); const [showChart, setShowChart] = useState(false); @@ -12,7 +14,7 @@ const LoopChartActionBar: React.FC = () => { const apiUrl = process.env.NODE_ENV === "development" ? "/mockData.json" - : "/CPL?seite.ACP&DIA1=2025;01;01;2025;07;31;2;4"; + : `/CPL?seite.ACP&DIA1=2025;01;01;2025;07;31;${slotIndex};${schleifenwiderstand}`; const response = await fetch(apiUrl); const data = await response.json(); diff --git a/components/main/kabelueberwachung/kue705FO/Kue705FO.tsx b/components/main/kabelueberwachung/kue705FO/Kue705FO.tsx index 297863c..6b54379 100644 --- a/components/main/kabelueberwachung/kue705FO/Kue705FO.tsx +++ b/components/main/kabelueberwachung/kue705FO/Kue705FO.tsx @@ -23,6 +23,7 @@ import ChartSwitcher from "./Charts/ChartSwitcher"; import { setActiveMode } from "../../../../redux/slices/chartDataSlice"; import LoopMeasurementChart from "./Charts/LoopMeasurementChart/LoopMeasurementChart"; import TDRChart from "./Charts/TDRChart/TDRChart"; +import handleButtonClick from "./kue705FO-Funktionen/handleButtonClick"; const Kue705FO: React.FC = ({ isolationswert, @@ -100,24 +101,6 @@ const Kue705FO: React.FC = ({ } }; - const handleButtonClick = (button: "Schleife" | "TDR") => { - if (button === "Schleife") { - setActiveButton("Schleife"); - setloopTitleText("Schleifenwiderstand [kOhm]"); - setLoopDisplayValue(schleifenwiderstand); // Setze den Wert auf schleifenwiderstand - dispatch(setActiveMode("Schleife")); // đŸ”„ Speichert den Modus in Redux - } else if (button === "TDR") { - setActiveButton("TDR"); - setloopTitleText("Entfernung [Km]"); - setLoopDisplayValue( - tdrLocation && tdrLocation[slotIndex] !== undefined - ? tdrLocation[slotIndex] - : "0" - ); // Setze den Wert auf tdrLocation oder "0" als Fallback - dispatch(setActiveMode("TDR")); // đŸ”„ Speichert den Modus in Redux - } - }; - // Funktion aufrufen in handleRefreshClick const handleRefreshClick = () => { if (activeButton === "Schleife") { diff --git a/components/main/kabelueberwachung/kue705FO/kue705FO-Funktionen/handleButtonClick.ts b/components/main/kabelueberwachung/kue705FO/kue705FO-Funktionen/handleButtonClick.ts new file mode 100644 index 0000000..22d2038 --- /dev/null +++ b/components/main/kabelueberwachung/kue705FO/kue705FO-Funktionen/handleButtonClick.ts @@ -0,0 +1,32 @@ +// components/main/kabelueberwachung/kue705FO/kue705FO-Funktionen/handleButtonClick.ts +import { Dispatch } from "react"; +import { setActiveMode } from "../../../../../redux/slices/chartDataSlice"; + +const handleButtonClick = ( + button: "Schleife" | "TDR", + setActiveButton: Dispatch>, + setLoopTitleText: Dispatch>, + setLoopDisplayValue: Dispatch>, + schleifenwiderstand: number, + tdrLocation: number[] | undefined, + slotIndex: number, + dispatch: Dispatch +) => { + if (button === "Schleife") { + setActiveButton("Schleife"); + setLoopTitleText("Schleifenwiderstand [kOhm]"); + setLoopDisplayValue(schleifenwiderstand); + dispatch(setActiveMode("Schleife")); + } else if (button === "TDR") { + setActiveButton("TDR"); + setLoopTitleText("Entfernung [Km]"); + setLoopDisplayValue( + tdrLocation && tdrLocation[slotIndex] !== undefined + ? tdrLocation[slotIndex] + : "0" + ); + dispatch(setActiveMode("TDR")); + } +}; + +export default handleButtonClick; diff --git a/pages/access.tsx b/components/main/zutrittskontrolle/Zutrittskontrolle.tsx similarity index 97% rename from pages/access.tsx rename to components/main/zutrittskontrolle/Zutrittskontrolle.tsx index a619568..a4a1d6e 100644 --- a/pages/access.tsx +++ b/components/main/zutrittskontrolle/Zutrittskontrolle.tsx @@ -1,7 +1,7 @@ -"use client"; +"use client"; // pages/access.tsx import React from "react"; -function Access() { +function Zutrittskontrolle() { return (
@@ -130,4 +130,4 @@ function Access() { ); } -export default Access; +export default Zutrittskontrolle; diff --git a/components/navigation/Navigation.tsx b/components/navigation/Navigation.tsx index ded9ecb..ad366f9 100644 --- a/components/navigation/Navigation.tsx +++ b/components/navigation/Navigation.tsx @@ -26,8 +26,10 @@ const Navigation: React.FC = ({ className }) => { { name: "KabelĂŒberwachung", path: "/kabelueberwachung" }, { name: "Ein- und AusgĂ€nge", path: "/einausgaenge" }, { name: "Analoge EingĂ€nge", path: "/analogeEingaenge" }, - { name: "Meldungen", path: "/messages" }, - { name: "Einstellungen", path: "/settings" }, + { name: "Meldungen", path: "/meldungen" }, + { name: "Einstellungen", path: "/einstellungen" }, + //{ name: "Zutriffskontrolle", path: "/zutrittskontrolle" }, + // Weitere MenĂŒpunkte hier ]; diff --git a/pages/generate-hash.tsx b/components/tools/generate-hash.tsx similarity index 100% rename from pages/generate-hash.tsx rename to components/tools/generate-hash.tsx diff --git a/config/webVersion.ts b/config/webVersion.ts index 5e33d1d..3e82155 100644 --- a/config/webVersion.ts +++ b/config/webVersion.ts @@ -6,5 +6,5 @@ 2: Patch oder Hotfix (Bugfixes oder kleine Änderungen). */ -const webVersion = "1.6.49"; +const webVersion = "1.6.50"; export default webVersion; diff --git a/pages/settings.tsx b/pages/einstellungen.tsx similarity index 100% rename from pages/settings.tsx rename to pages/einstellungen.tsx diff --git a/pages/meldungen.tsx b/pages/meldungen.tsx index ab238f9..c13a9f0 100644 --- a/pages/meldungen.tsx +++ b/pages/meldungen.tsx @@ -1,135 +1,5 @@ -"use client"; -import React, { useState } from "react"; +import React from "react"; -function Meldungen() { - const [rowsPerPage, setRowsPerPage] = useState(25); - const [filter, setFilter] = useState(""); - const [selectedMonth, setSelectedMonth] = useState("01"); - const [selectedYear, setSelectedYear] = useState("23"); - const [selectedDay, setSelectedDay] = useState(""); - - // Platzhalter fĂŒr Meldungen - const messages = Array.from({ length: 50 }, (_, i) => ({ - date: `2023-01-${String(i + 1).padStart(2, "0")}`, - message: `Meldung ${i + 1}`, - })); - - const filteredMessages = messages.filter((msg) => { - const dayMatch = selectedDay - ? msg.date.split("-")[2] === selectedDay.padStart(2, "0") - : true; - const monthMatch = msg.date.split("-")[1] === selectedMonth; - const yearMatch = msg.date.split("-")[0].substring(2) === selectedYear; - const filterMatch = msg.message - .toLowerCase() - .includes(filter.toLowerCase()); - return dayMatch && monthMatch && yearMatch && filterMatch; - }); - - return ( -
- {/* Filterleiste */} -
-
- Interner Meldungsspeicher - - - setSelectedDay(e.target.value)} - min="1" - max="31" - placeholder="Tag" - className="bg-white text-black p-1 rounded" - /> -
-
- setFilter(e.target.value)} - placeholder="Filter" - className="bg-white text-black p-1 rounded" - /> - -
-
- - {/* Meldungen Tabelle */} -
- - - - - - - - - {filteredMessages.slice(0, rowsPerPage).map((msg, index) => ( - - - - - ))} - -
DatumMeldung
{msg.date}{msg.message}
-
- - {/* Pagination */} -
-
    - {Array.from( - { length: Math.ceil(filteredMessages.length / rowsPerPage) }, - (_, i) => ( -
  • - {i + 1} -
  • - ) - )} -
-
-
- ); +export default function Messages() { + return
Messages
; } - -export default Meldungen; diff --git a/pages/messages.tsx b/pages/messages.tsx deleted file mode 100644 index c13a9f0..0000000 --- a/pages/messages.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; - -export default function Messages() { - return
Messages
; -} diff --git a/pages/zutrittskontrolle.tsx b/pages/zutrittskontrolle.tsx new file mode 100644 index 0000000..3634019 --- /dev/null +++ b/pages/zutrittskontrolle.tsx @@ -0,0 +1,9 @@ +"use client"; + +import React from "react"; +import Zutrittskontrolle from "../components/main/zutrittskontrolle/Zutrittskontrolle"; // Neuer Name + +export default function zutrittskontrollePage() { + // Klein geschrieben, falls du das willst + return ; +}