pgaes Verzeichnis Struktur verbessert

This commit is contained in:
Ismail Ali
2025-02-14 18:43:53 +01:00
parent 0910a36371
commit b1b4837968
11 changed files with 56 additions and 163 deletions

View File

@@ -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();

View File

@@ -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<Kue705FOProps> = ({
isolationswert,
@@ -100,24 +101,6 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
}
};
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") {

View File

@@ -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<React.SetStateAction<"Schleife" | "TDR">>,
setLoopTitleText: Dispatch<React.SetStateAction<string>>,
setLoopDisplayValue: Dispatch<React.SetStateAction<number | string>>,
schleifenwiderstand: number,
tdrLocation: number[] | undefined,
slotIndex: number,
dispatch: Dispatch<any>
) => {
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;

View File

@@ -0,0 +1,133 @@
"use client"; // pages/access.tsx
import React from "react";
function Zutrittskontrolle() {
return (
<div className="bg-gray-100 min-h-screen p-8">
<div className="bg-white rounded-lg shadow p-6 mb-8">
<h2 className="text-xl font-bold text-blue-500 mb-4">
Zutrittskontrolle 1
</h2>
<div className="flex justify-between">
<div className="w-full lg:w-1/2 p-4">
<table className="min-w-full text-sm">
<tbody>
<tr>
<td className="py-3 px-4">
<b>Betrieb</b>
</td>
<td className="py-3 px-4">Status: ...</td>
</tr>
<tr>
<td className="py-3 px-4">
<b>Status</b>
</td>
<td className="py-3 px-4">...</td>
</tr>
<tr>
<td className="py-3 px-4">Letzte Chip-ID</td>
<td className="py-3 px-4">...</td>
</tr>
<tr>
<td className="py-3 px-4">Zeitstempel</td>
<td className="py-3 px-4">...</td>
</tr>
<tr>
<td className="py-3 px-4">Access Typ</td>
<td className="py-3 px-4">...</td>
</tr>
</tbody>
</table>
</div>
<div className="w-full lg:w-1/2 p-4">
<table className="min-w-full text-sm">
<thead className="bg-gray-200">
<tr>
<th className="py-3 px-4 text-center">Eingang</th>
<th className="py-3 px-4 text-center">Zustand</th>
<th className="py-3 px-4">Bezeichnung</th>
</tr>
</thead>
<tbody>
<tr>
<td className="py-3 px-4 text-center">1</td>
<td className="py-3 px-4 text-center">...</td>
<td className="py-3 px-4">...</td>
</tr>
<tr>
<td className="py-3 px-4 text-center">2</td>
<td className="py-3 px-4 text-center">...</td>
<td className="py-3 px-4">...</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
{/* Zutrittskontrolle 2 */}
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-xl font-bold text-blue-500 mb-4">
Zutrittskontrolle 2
</h2>
<div className="flex justify-between">
<div className="w-full lg:w-1/2 p-4">
<table className="min-w-full text-sm">
<tbody>
<tr>
<td className="py-3 px-4">
<b>Betrieb</b>
</td>
<td className="py-3 px-4">Status: ...</td>
</tr>
<tr>
<td className="py-3 px-4">
<b>Status</b>
</td>
<td className="py-3 px-4">...</td>
</tr>
<tr>
<td className="py-3 px-4">Letzte Chip-ID</td>
<td className="py-3 px-4">...</td>
</tr>
<tr>
<td className="py-3 px-4">Zeitstempel</td>
<td className="py-3 px-4">...</td>
</tr>
<tr>
<td className="py-3 px-4">Access Typ</td>
<td className="py-3 px-4">...</td>
</tr>
</tbody>
</table>
</div>
<div className="w-full lg:w-1/2 p-4">
<table className="min-w-full text-sm">
<thead className="bg-gray-200">
<tr>
<th className="py-3 px-4 text-center">Eingang</th>
<th className="py-3 px-4 text-center">Zustand</th>
<th className="py-3 px-4">Bezeichnung</th>
</tr>
</thead>
<tbody>
<tr>
<td className="py-3 px-4 text-center">1</td>
<td className="py-3 px-4 text-center">...</td>
<td className="py-3 px-4">...</td>
</tr>
<tr>
<td className="py-3 px-4 text-center">2</td>
<td className="py-3 px-4 text-center">...</td>
<td className="py-3 px-4">...</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
);
}
export default Zutrittskontrolle;

View File

@@ -26,8 +26,10 @@ const Navigation: React.FC<NavigationProps> = ({ 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
];

View File

@@ -0,0 +1,25 @@
// pages/generate-hash.js
import React from "react";
import bcrypt from "bcryptjs";
export default function GenerateHash() {
const password = "Littwin"; // Das Passwort, das du hashen möchtest
const saltRounds = 10; // Die Anzahl der Salt-Runden
// Hash generieren
const hash = bcrypt.hashSync(password, saltRounds);
return (
<div style={{ padding: "20px", fontFamily: "Arial" }}>
<h1>Hash-Generator</h1>
<p>
<strong>Passwort:</strong> {password}
</p>
<p>
<strong>Generierter Hash:</strong> {hash}
</p>
<p>Kopiere den Hash und speichere ihn in deinem Projekt.</p>
</div>
);
}