TypeScript kein Syntaxsfehler
This commit is contained in:
@@ -8,24 +8,39 @@ import CPLStatus from "../components/modulesStatus/CPLStatus";
|
||||
import KabelModulStatus from "../components/modulesStatus/KabelModulStatus";
|
||||
import { Icon } from "@iconify/react";
|
||||
import { useSelector } from "react-redux";
|
||||
import { RootState } from "../store/store";
|
||||
|
||||
function Dashboard() {
|
||||
const router = useRouter();
|
||||
|
||||
// Redux-Variablen abrufen
|
||||
const rawLast20Messages = useSelector(
|
||||
(state) => state.variables.last20Messages
|
||||
(state: RootState) => state.variables.last20Messages
|
||||
);
|
||||
const ip = useSelector((state: RootState) => state.variables.ip);
|
||||
const subnet = useSelector((state: RootState) => state.variables.subnet);
|
||||
const gateway = useSelector((state: RootState) => state.variables.gateway);
|
||||
const appVersion = useSelector(
|
||||
(state: RootState) => state.variables.appVersion
|
||||
);
|
||||
const kueCableBreak = useSelector(
|
||||
(state: RootState) => state.variables.kueCableBreak
|
||||
);
|
||||
const kueOnline = useSelector(
|
||||
(state: RootState) => state.variables.kueOnline
|
||||
);
|
||||
const kueVersion = useSelector(
|
||||
(state: RootState) => state.variables.kueVersion
|
||||
);
|
||||
const kueAlarm1 = useSelector(
|
||||
(state: RootState) => state.variables.kueAlarm1
|
||||
);
|
||||
const kueAlarm2 = useSelector(
|
||||
(state: RootState) => state.variables.kueAlarm2
|
||||
);
|
||||
const kueGroundFault = useSelector(
|
||||
(state: RootState) => state.variables.kueGroundFault
|
||||
);
|
||||
const ip = useSelector((state) => state.variables.ip);
|
||||
const subnet = useSelector((state) => state.variables.subnet);
|
||||
const gateway = useSelector((state) => state.variables.gateway);
|
||||
const appVersion = useSelector((state) => state.variables.appVersion);
|
||||
const kueCableBreak = useSelector((state) => state.variables.kueCableBreak);
|
||||
const kueOnline = useSelector((state) => state.variables.kueOnline);
|
||||
const kueVersion = useSelector((state) => state.variables.kueVersion);
|
||||
const kueAlarm1 = useSelector((state) => state.variables.kueAlarm1);
|
||||
const kueAlarm2 = useSelector((state) => state.variables.kueAlarm2);
|
||||
const kueGroundFault = useSelector((state) => state.variables.kueGroundFault);
|
||||
|
||||
// Hilfsfunktion zum Parsen der Nachrichten
|
||||
const parseMessages = (messages) => {
|
||||
@@ -54,7 +69,7 @@ function Dashboard() {
|
||||
};
|
||||
|
||||
const renderBaugruppentraeger = () => {
|
||||
const baugruppen = [];
|
||||
const baugruppen: JSX.Element[] = [];
|
||||
const numBaugruppen = Math.ceil(kueOnline.length / 8);
|
||||
|
||||
for (let i = 0; i < numBaugruppen; i++) {
|
||||
@@ -157,7 +172,7 @@ function Dashboard() {
|
||||
))
|
||||
) : (
|
||||
<tr>
|
||||
<td className="px-4 text-center" colSpan="5">
|
||||
<td className="px-4 text-center" colSpan={5}>
|
||||
Keine Meldungen verfügbar.
|
||||
</td>
|
||||
</tr>
|
||||
@@ -211,6 +226,7 @@ function Dashboard() {
|
||||
<p className="text-sm font-medium text-gray-700">{ip}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center space-x-4">
|
||||
<img
|
||||
src="/images/subnet-mask.svg"
|
||||
@@ -229,6 +245,13 @@ function Dashboard() {
|
||||
<p className="text-sm font-medium text-gray-700">{gateway}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center space-x-4">
|
||||
<img src="/images/IP-icon.svg" alt="IP Address" className="w-6 " />
|
||||
<div>
|
||||
<p className="text-xs text-gray-500">OPCUA Status</p>
|
||||
<p className="text-sm font-medium text-gray-700">{ip}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// pages/generate-hash.js
|
||||
import React from "react";
|
||||
|
||||
import bcrypt from "bcryptjs";
|
||||
|
||||
export default function GenerateHash() {
|
||||
Reference in New Issue
Block a user