TypeScript kein Syntaxsfehler
This commit is contained in:
9
package-lock.json
generated
9
package-lock.json
generated
@@ -35,9 +35,10 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@testing-library/jest-dom": "^6.6.3",
|
"@testing-library/jest-dom": "^6.6.3",
|
||||||
"@testing-library/react": "^16.2.0",
|
"@testing-library/react": "^16.2.0",
|
||||||
|
"@types/bcryptjs": "^2.4.6",
|
||||||
"@types/cypress": "^1.1.6",
|
"@types/cypress": "^1.1.6",
|
||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^29.5.14",
|
||||||
"@types/node": "22.10.10",
|
"@types/node": "^22.10.10",
|
||||||
"@types/react": "^18.3.18",
|
"@types/react": "^18.3.18",
|
||||||
"@types/react-dom": "^18.3.5",
|
"@types/react-dom": "^18.3.5",
|
||||||
"@types/react-modal": "^3.16.3",
|
"@types/react-modal": "^3.16.3",
|
||||||
@@ -1595,6 +1596,12 @@
|
|||||||
"@babel/types": "^7.20.7"
|
"@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": {
|
"node_modules/@types/cypress": {
|
||||||
"version": "1.1.6",
|
"version": "1.1.6",
|
||||||
"resolved": "https://registry.npmjs.org/@types/cypress/-/cypress-1.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/cypress/-/cypress-1.1.6.tgz",
|
||||||
|
|||||||
@@ -39,9 +39,10 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@testing-library/jest-dom": "^6.6.3",
|
"@testing-library/jest-dom": "^6.6.3",
|
||||||
"@testing-library/react": "^16.2.0",
|
"@testing-library/react": "^16.2.0",
|
||||||
|
"@types/bcryptjs": "^2.4.6",
|
||||||
"@types/cypress": "^1.1.6",
|
"@types/cypress": "^1.1.6",
|
||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^29.5.14",
|
||||||
"@types/node": "22.10.10",
|
"@types/node": "^22.10.10",
|
||||||
"@types/react": "^18.3.18",
|
"@types/react": "^18.3.18",
|
||||||
"@types/react-dom": "^18.3.5",
|
"@types/react-dom": "^18.3.5",
|
||||||
"@types/react-modal": "^3.16.3",
|
"@types/react-modal": "^3.16.3",
|
||||||
|
|||||||
@@ -8,24 +8,39 @@ import CPLStatus from "../components/modulesStatus/CPLStatus";
|
|||||||
import KabelModulStatus from "../components/modulesStatus/KabelModulStatus";
|
import KabelModulStatus from "../components/modulesStatus/KabelModulStatus";
|
||||||
import { Icon } from "@iconify/react";
|
import { Icon } from "@iconify/react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
import { RootState } from "../store/store";
|
||||||
|
|
||||||
function Dashboard() {
|
function Dashboard() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
// Redux-Variablen abrufen
|
// Redux-Variablen abrufen
|
||||||
const rawLast20Messages = useSelector(
|
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
|
// Hilfsfunktion zum Parsen der Nachrichten
|
||||||
const parseMessages = (messages) => {
|
const parseMessages = (messages) => {
|
||||||
@@ -54,7 +69,7 @@ function Dashboard() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderBaugruppentraeger = () => {
|
const renderBaugruppentraeger = () => {
|
||||||
const baugruppen = [];
|
const baugruppen: JSX.Element[] = [];
|
||||||
const numBaugruppen = Math.ceil(kueOnline.length / 8);
|
const numBaugruppen = Math.ceil(kueOnline.length / 8);
|
||||||
|
|
||||||
for (let i = 0; i < numBaugruppen; i++) {
|
for (let i = 0; i < numBaugruppen; i++) {
|
||||||
@@ -157,7 +172,7 @@ function Dashboard() {
|
|||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
<tr>
|
<tr>
|
||||||
<td className="px-4 text-center" colSpan="5">
|
<td className="px-4 text-center" colSpan={5}>
|
||||||
Keine Meldungen verfügbar.
|
Keine Meldungen verfügbar.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -211,6 +226,7 @@ function Dashboard() {
|
|||||||
<p className="text-sm font-medium text-gray-700">{ip}</p>
|
<p className="text-sm font-medium text-gray-700">{ip}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center space-x-4">
|
<div className="flex items-center space-x-4">
|
||||||
<img
|
<img
|
||||||
src="/images/subnet-mask.svg"
|
src="/images/subnet-mask.svg"
|
||||||
@@ -229,6 +245,13 @@ function Dashboard() {
|
|||||||
<p className="text-sm font-medium text-gray-700">{gateway}</p>
|
<p className="text-sm font-medium text-gray-700">{gateway}</p>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
// pages/generate-hash.js
|
// pages/generate-hash.js
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
import bcrypt from "bcryptjs";
|
import bcrypt from "bcryptjs";
|
||||||
|
|
||||||
export default function GenerateHash() {
|
export default function GenerateHash() {
|
||||||
@@ -26,20 +26,20 @@ export interface VariablesState {
|
|||||||
de: string | null;
|
de: string | null;
|
||||||
counter: number | null;
|
counter: number | null;
|
||||||
flutter: string | null;
|
flutter: string | null;
|
||||||
kueOnline: string[];
|
kueOnline: string[] | number[];
|
||||||
kueID: string[];
|
kueID: string[];
|
||||||
kueIso: string[];
|
kueIso: string[];
|
||||||
kuePSTmMinus96V: string[];
|
kuePSTmMinus96V: string[];
|
||||||
kueAlarm1: string[];
|
kueAlarm1: number[];
|
||||||
kueAlarm2: string[];
|
kueAlarm2: number[];
|
||||||
kueResidence: string[];
|
kueResidence: string[];
|
||||||
kueCableBreak: string[];
|
kueCableBreak: number[];
|
||||||
kueGroundFault: string[];
|
kueGroundFault: number[];
|
||||||
kueLimit1: number | null;
|
kueLimit1: number | null;
|
||||||
kueLimit2Low: number | null;
|
kueLimit2Low: number | null;
|
||||||
kueDelay1: number | null;
|
kueDelay1: number | null;
|
||||||
kueLoopInterval: number | null;
|
kueLoopInterval: number | null;
|
||||||
kueVersion: number[] | null;
|
kueVersion: number[] | string[];
|
||||||
tdrAtten: number | null;
|
tdrAtten: number | null;
|
||||||
tdrPulse: number | null;
|
tdrPulse: number | null;
|
||||||
tdrSpeed: number | null;
|
tdrSpeed: number | null;
|
||||||
@@ -98,7 +98,7 @@ const initialState: VariablesState = {
|
|||||||
kueLimit2Low: null,
|
kueLimit2Low: null,
|
||||||
kueDelay1: null,
|
kueDelay1: null,
|
||||||
kueLoopInterval: null,
|
kueLoopInterval: null,
|
||||||
kueVersion: null,
|
kueVersion: [],
|
||||||
tdrAtten: null,
|
tdrAtten: null,
|
||||||
tdrPulse: null,
|
tdrPulse: null,
|
||||||
tdrSpeed: null,
|
tdrSpeed: null,
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"types": [
|
"types": [
|
||||||
"cypress"
|
"cypress",
|
||||||
|
"node"
|
||||||
],
|
],
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
|
|||||||
Reference in New Issue
Block a user