fix: update fetchDigitalOutputsService.ts to use /api/cpl/digitalOutputsAPIHandler in development
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"use client";
|
||||
"use client"; // /components/main/einausgaenge/DigitalOutputs.tsx
|
||||
import React from "react";
|
||||
import { Icon } from "@iconify/react";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"use client";
|
||||
"use client"; // /compoenents/main/einausgaenge/modals/OutputModal.tsx
|
||||
import React from "react";
|
||||
|
||||
export default function OutputModal({
|
||||
|
||||
@@ -117,7 +117,7 @@ export default function TdrEinstellung({ slot }: Props) {
|
||||
<div className="pt-4 flex justify-end">
|
||||
<button
|
||||
onClick={handleSave}
|
||||
className="bg-blue-600 text-white px-4 py-2 rounded shadow hover:bg-blue-700"
|
||||
className="bg-littwin-blue text-white px-4 py-2 rounded shadow hover:bg-blue-700"
|
||||
>
|
||||
💾 Einstellungen senden
|
||||
</button>
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
||||
|
||||
*/
|
||||
const webVersion = "1.6.281";
|
||||
const webVersion = "1.6.282";
|
||||
export default webVersion;
|
||||
|
||||
@@ -1,33 +1,26 @@
|
||||
"use client";
|
||||
"use client"; // /pages/digitalOutputs.tsx
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { AppDispatch, RootState } from "../redux/store";
|
||||
|
||||
import InputModal from "../components/main/einausgaenge/modals/InputModal";
|
||||
import OutputModal from "../components/main/einausgaenge/modals/OutputModal";
|
||||
|
||||
import { fetchDigitaleEingaengeThunk } from "../redux/thunks/fetchDigitaleEingaengeThunk";
|
||||
import { fetchDigitalOutputsThunk } from "../redux/thunks/fetchDigitalOutputsThunk";
|
||||
|
||||
import DigitalOutputs from "../components/main/einausgaenge/DigitalOutputs";
|
||||
import DigitalInputs from "../components/main/einausgaenge/DigitalInputs";
|
||||
|
||||
const EinAusgaenge: React.FC = () => {
|
||||
const dispatch = useDispatch<AppDispatch>();
|
||||
const digitalInputs = useSelector(
|
||||
(state: RootState) => state.digitalInputsSlice.inputs
|
||||
);
|
||||
|
||||
const digitalOutputs = useSelector(
|
||||
(state: RootState) => state.digitalOutputsSlice.outputs
|
||||
);
|
||||
|
||||
const [selectedInput, setSelectedInput] = useState(null);
|
||||
const [selectedOutput, setSelectedOutput] = useState(null);
|
||||
const [isInputModalOpen, setIsInputModalOpen] = useState(false);
|
||||
const [isOutputModalOpen, setIsOutputModalOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(fetchDigitaleEingaengeThunk());
|
||||
dispatch(fetchDigitalOutputsThunk());
|
||||
|
||||
const interval = setInterval(() => {
|
||||
@@ -38,16 +31,6 @@ const EinAusgaenge: React.FC = () => {
|
||||
return () => clearInterval(interval);
|
||||
}, [dispatch]);
|
||||
|
||||
const openInputModal = (input: any) => {
|
||||
setSelectedInput(input);
|
||||
setIsInputModalOpen(true);
|
||||
};
|
||||
|
||||
const closeInputModal = () => {
|
||||
setSelectedInput(null);
|
||||
setIsInputModalOpen(false);
|
||||
};
|
||||
|
||||
const openOutputModal = (output: any) => {
|
||||
setSelectedOutput(output);
|
||||
setIsOutputModalOpen(true);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// ✅ Service: /services/fetchDigitalOutputsService.ts
|
||||
// /services/fetchDigitalOutputsService.ts
|
||||
|
||||
export const fetchDigitalOutputsService = async () => {
|
||||
if (typeof window === "undefined") return [];
|
||||
@@ -6,7 +6,7 @@ export const fetchDigitalOutputsService = async () => {
|
||||
const scriptSrc =
|
||||
process.env.NEXT_PUBLIC_NODE_ENV === "production"
|
||||
? "/CPL?/CPL/SERVICE/da.js"
|
||||
: "/api/cpl/digitaleAusgaengeAPIHandler";
|
||||
: "/api/cpl/digitalOutputsAPIHandler";
|
||||
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
const script = document.createElement("script");
|
||||
|
||||
Reference in New Issue
Block a user