fix: digital inputs status LED
This commit is contained in:
@@ -6,5 +6,5 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
|
||||
NEXT_PUBLIC_EXPORT_STATIC=false
|
||||
NEXT_PUBLIC_USE_CGI=false
|
||||
# App-Versionsnummer
|
||||
NEXT_PUBLIC_APP_VERSION=1.6.428
|
||||
NEXT_PUBLIC_APP_VERSION=1.6.429
|
||||
NEXT_PUBLIC_CPL_MODE=jsmock # json (Entwicklungsumgebung) oder jsmock (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
||||
@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
|
||||
NEXT_PUBLIC_EXPORT_STATIC=true
|
||||
NEXT_PUBLIC_USE_CGI=true
|
||||
# App-Versionsnummer
|
||||
NEXT_PUBLIC_APP_VERSION=1.6.428
|
||||
NEXT_PUBLIC_APP_VERSION=1.6.429
|
||||
NEXT_PUBLIC_CPL_MODE=production
|
||||
@@ -19,6 +19,7 @@ export default function DigitalInputs({ openInputModal, inputRange }: Props) {
|
||||
);
|
||||
|
||||
const inputs = digitalInputs.slice(inputRange.start, inputRange.end);
|
||||
//console.log("DigitalInputs", inputs);
|
||||
|
||||
return (
|
||||
<div className="bg-white shadow-md border border-gray-200 p-3 rounded-lg w-full laptop:p-1 xl:p-1">
|
||||
|
||||
@@ -40,7 +40,7 @@ export default function InputModal({
|
||||
useEffect(() => {
|
||||
if (reduxInput && isInitialLoad) {
|
||||
//reduxInput
|
||||
console.log("📦 reduxInput geladen:", reduxInput);
|
||||
//console.log("📦 reduxInput geladen:", reduxInput);
|
||||
setLabel(reduxInput.label || "");
|
||||
setInvertiert(reduxInput.invert);
|
||||
setTimeFilter(reduxInput.timeFilter);
|
||||
@@ -55,7 +55,7 @@ export default function InputModal({
|
||||
|
||||
const sendCgiUpdate = async (param: string) => {
|
||||
const url = `/CPL?/eingaenge.html&${param}`;
|
||||
console.log("📡 CGI senden:", url);
|
||||
//console.log("📡 CGI senden:", url);
|
||||
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) {
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "cpl-v4",
|
||||
"version": "1.6.428",
|
||||
"version": "1.6.429",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "cpl-v4",
|
||||
"version": "1.6.428",
|
||||
"version": "1.6.429",
|
||||
"dependencies": {
|
||||
"@fontsource/roboto": "^5.1.0",
|
||||
"@iconify-icons/ri": "^1.2.10",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cpl-v4",
|
||||
"version": "1.6.428",
|
||||
"version": "1.6.429",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -4,7 +4,6 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
interface DigitalInput {
|
||||
id: number;
|
||||
label: string;
|
||||
status: number;
|
||||
counter: number;
|
||||
flutter: number;
|
||||
invert: boolean;
|
||||
@@ -12,6 +11,7 @@ interface DigitalInput {
|
||||
weighting: number;
|
||||
zaehlerAktiv: boolean;
|
||||
eingangOffline: boolean;
|
||||
status: boolean;
|
||||
}
|
||||
|
||||
interface DigitalInputsState {
|
||||
|
||||
@@ -29,6 +29,7 @@ export const fetchDigitalInputsService = async () => {
|
||||
weighting: win.win_de_weighting[i],
|
||||
counterActive: !!win.win_de_counter_active[i],
|
||||
eingangOffline: !!win.win_de_offline[i],
|
||||
status: !!win.win_de_state[i],
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -39,7 +40,7 @@ export const fetchDigitalInputsService = async () => {
|
||||
throw new Error("❌ Fehler beim Laden der digitalen Eingänge (json)");
|
||||
|
||||
const data = await res.json();
|
||||
|
||||
console.log("📡 JSON-Daten geladen in service:", data);
|
||||
return data.win_de_state.map((_: any, i: number) => ({
|
||||
id: i + 1,
|
||||
value: data.win_de_state[i],
|
||||
@@ -50,6 +51,7 @@ export const fetchDigitalInputsService = async () => {
|
||||
weighting: data.win_de_weighting[i],
|
||||
counterActive: !!data.win_de_counter_active[i],
|
||||
eingangOffline: !!data.win_de_offline[i],
|
||||
status: !!data.win_de_state[i],
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -60,7 +62,7 @@ export const fetchDigitalInputsService = async () => {
|
||||
throw new Error("❌ Fehler beim Laden der digitalen Eingänge (json)");
|
||||
|
||||
const data = await res.json();
|
||||
//console.log("📡 JSMOCK-Daten geladen in service:", data);
|
||||
console.log("📡 JSMOCK-Daten geladen in service:", data);
|
||||
|
||||
return data.win_de_state.map((_: any, i: number) => ({
|
||||
id: i + 1,
|
||||
@@ -72,6 +74,7 @@ export const fetchDigitalInputsService = async () => {
|
||||
weighting: data.win_de_weighting[i],
|
||||
counterActive: !!data.win_de_counter_active[i],
|
||||
eingangOffline: !!data.win_de_offline[i],
|
||||
status: !!data.win_de_state[i],
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user