TypeScript kein Syntaxsfehler
This commit is contained in:
9
package-lock.json
generated
9
package-lock.json
generated
@@ -35,9 +35,10 @@
|
||||
"devDependencies": {
|
||||
"@testing-library/jest-dom": "^6.6.3",
|
||||
"@testing-library/react": "^16.2.0",
|
||||
"@types/bcryptjs": "^2.4.6",
|
||||
"@types/cypress": "^1.1.6",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "22.10.10",
|
||||
"@types/node": "^22.10.10",
|
||||
"@types/react": "^18.3.18",
|
||||
"@types/react-dom": "^18.3.5",
|
||||
"@types/react-modal": "^3.16.3",
|
||||
@@ -1595,6 +1596,12 @@
|
||||
"@babel/types": "^7.20.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/bcryptjs": {
|
||||
"version": "2.4.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/bcryptjs/-/bcryptjs-2.4.6.tgz",
|
||||
"integrity": "sha512-9xlo6R2qDs5uixm0bcIqCeMCE6HiQsIyel9KQySStiyqNl2tnj2mP3DX1Nf56MD6KMenNNlBBsy3LJ7gUEQPXQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/cypress": {
|
||||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/cypress/-/cypress-1.1.6.tgz",
|
||||
|
||||
@@ -39,9 +39,10 @@
|
||||
"devDependencies": {
|
||||
"@testing-library/jest-dom": "^6.6.3",
|
||||
"@testing-library/react": "^16.2.0",
|
||||
"@types/bcryptjs": "^2.4.6",
|
||||
"@types/cypress": "^1.1.6",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "22.10.10",
|
||||
"@types/node": "^22.10.10",
|
||||
"@types/react": "^18.3.18",
|
||||
"@types/react-dom": "^18.3.5",
|
||||
"@types/react-modal": "^3.16.3",
|
||||
|
||||
@@ -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() {
|
||||
@@ -26,20 +26,20 @@ export interface VariablesState {
|
||||
de: string | null;
|
||||
counter: number | null;
|
||||
flutter: string | null;
|
||||
kueOnline: string[];
|
||||
kueOnline: string[] | number[];
|
||||
kueID: string[];
|
||||
kueIso: string[];
|
||||
kuePSTmMinus96V: string[];
|
||||
kueAlarm1: string[];
|
||||
kueAlarm2: string[];
|
||||
kueAlarm1: number[];
|
||||
kueAlarm2: number[];
|
||||
kueResidence: string[];
|
||||
kueCableBreak: string[];
|
||||
kueGroundFault: string[];
|
||||
kueCableBreak: number[];
|
||||
kueGroundFault: number[];
|
||||
kueLimit1: number | null;
|
||||
kueLimit2Low: number | null;
|
||||
kueDelay1: number | null;
|
||||
kueLoopInterval: number | null;
|
||||
kueVersion: number[] | null;
|
||||
kueVersion: number[] | string[];
|
||||
tdrAtten: number | null;
|
||||
tdrPulse: number | null;
|
||||
tdrSpeed: number | null;
|
||||
@@ -98,7 +98,7 @@ const initialState: VariablesState = {
|
||||
kueLimit2Low: null,
|
||||
kueDelay1: null,
|
||||
kueLoopInterval: null,
|
||||
kueVersion: null,
|
||||
kueVersion: [],
|
||||
tdrAtten: null,
|
||||
tdrPulse: null,
|
||||
tdrSpeed: null,
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
"noEmit": true,
|
||||
"skipLibCheck": true,
|
||||
"types": [
|
||||
"cypress"
|
||||
"cypress",
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"dom",
|
||||
|
||||
Reference in New Issue
Block a user