Digitale Eingänge auslagern von einausgaenge.tsx
This commit is contained in:
@@ -2,45 +2,65 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Icon } from "@iconify/react";
|
import { Icon } from "@iconify/react";
|
||||||
|
|
||||||
export default function DigitalInputs({ digitalInputs, openInputModal }) {
|
export default function DigitalInputs({
|
||||||
|
inputsGroup1,
|
||||||
|
inputsGroup2,
|
||||||
|
openInputModal,
|
||||||
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className="bg-white shadow-md rounded-lg border border-gray-200 p-4 w-3/5 flex-grow flex flex-col">
|
<div className="bg-white shadow-md rounded-lg border border-gray-200 p-4 w-3/5 flex-grow flex flex-col">
|
||||||
<h2 className="text-md font-bold mb-4 flex items-center">
|
<h2 className="text-md font-bold mb-4 flex items-center">
|
||||||
<Icon icon="mdi:input" className="text-blue-500 mr-2 text-2xl" />
|
<Icon icon="mdi:input" className="text-blue-500 mr-2 text-2xl" />
|
||||||
Digitale Eingänge
|
Digitale Eingänge
|
||||||
</h2>
|
</h2>
|
||||||
<table className="w-full text-sm border-collapse bg-white rounded-lg">
|
<div className="grid grid-cols-2 gap-4">
|
||||||
<thead className="bg-gray-100 border-b">
|
{[inputsGroup1, inputsGroup2].map((group, index) => (
|
||||||
<tr>
|
<div key={index} className="flex-grow">
|
||||||
<th className="px-2 py-1 text-left">Eingang</th>
|
<table className="w-full text-sm border-collapse bg-white rounded-lg">
|
||||||
<th className="px-2 py-1 text-left">Zustand</th>
|
<thead className="bg-gray-100 border-b">
|
||||||
<th className="px-2 py-1 text-left">Bezeichnung</th>
|
<tr>
|
||||||
<th className="px-2 py-1 text-left">Aktion</th>
|
<th className="px-2 py-1 text-left">Eingang</th>
|
||||||
</tr>
|
<th className="px-2 py-1 text-left">Zustand</th>
|
||||||
</thead>
|
<th className="px-2 py-1 text-left">Bezeichnung</th>
|
||||||
<tbody>
|
<th className="px-2 py-1 text-left">Aktion</th>
|
||||||
{digitalInputs.map((input) => (
|
</tr>
|
||||||
<tr key={input.id} className="border-b">
|
</thead>
|
||||||
<td className="flex items-center p-2">
|
<tbody>
|
||||||
<Icon
|
{group.map((input) => (
|
||||||
icon="mdi:input"
|
<tr key={input.id} className="border-b">
|
||||||
className="text-black-500 mr-2 text-xl"
|
<td className="flex items-center p-2 xl:py-0 2xl:p-1">
|
||||||
/>
|
<Icon
|
||||||
{input.id}
|
icon="mdi:input"
|
||||||
</td>
|
className="text-black-500 mr-2 text-xl"
|
||||||
<td className="p-2">{input.status === "active" ? "●" : "⨉"}</td>
|
/>
|
||||||
<td className="p-2">{input.description}</td>
|
{input.id}
|
||||||
<td className="p-2">
|
</td>
|
||||||
<Icon
|
<td className="p-2 xl:py-0">
|
||||||
icon="mdi:settings"
|
<span
|
||||||
className="text-gray-400 text-lg cursor-pointer"
|
className={
|
||||||
onClick={() => openInputModal(input)}
|
input.status === "active"
|
||||||
/>
|
? "text-green-500"
|
||||||
</td>
|
: "text-red-500"
|
||||||
</tr>
|
}
|
||||||
))}
|
>
|
||||||
</tbody>
|
{input.status === "active" ? "●" : "⨉"}
|
||||||
</table>
|
</span>
|
||||||
|
</td>
|
||||||
|
<td className="p-2 xl:py-0">{input.description}</td>
|
||||||
|
<td className="p-2 xl:py-0">
|
||||||
|
<Icon
|
||||||
|
icon="mdi:settings"
|
||||||
|
className="text-gray-400 text-lg cursor-pointer"
|
||||||
|
onClick={() => openInputModal(input)}
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,5 +6,5 @@
|
|||||||
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
||||||
|
|
||||||
*/
|
*/
|
||||||
const webVersion = "1.6.51";
|
const webVersion = "1.6.52";
|
||||||
export default webVersion;
|
export default webVersion;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { Icon } from "@iconify/react";
|
import { Icon } from "@iconify/react";
|
||||||
import DigitalOutputs from "../components/main/einausgaenge/DigitalOutputs";
|
import DigitalOutputs from "../components/main/einausgaenge/DigitalOutputs";
|
||||||
|
import DigitalInputs from "../components/main/einausgaenge/DigitalInputs";
|
||||||
|
|
||||||
function EinAusgaenge() {
|
function EinAusgaenge() {
|
||||||
const [mockData, setMockData] = useState({
|
const [mockData, setMockData] = useState({
|
||||||
@@ -111,60 +112,11 @@ function EinAusgaenge() {
|
|||||||
<h1 className="text-lg font-semibold mb-4">Ein- und Ausgänge</h1>
|
<h1 className="text-lg font-semibold mb-4">Ein- und Ausgänge</h1>
|
||||||
<div className="flex gap-4">
|
<div className="flex gap-4">
|
||||||
{/* Digitale Eingänge */}
|
{/* Digitale Eingänge */}
|
||||||
<div className="bg-white shadow-md rounded-lg border border-gray-200 p-4 w-3/5 flex-grow flex flex-col">
|
<DigitalInputs
|
||||||
<h2 className="text-md font-bold mb-4 flex items-center">
|
inputsGroup1={inputsGroup1}
|
||||||
<Icon icon="mdi:input" className="text-blue-500 mr-2 text-2xl" />
|
inputsGroup2={inputsGroup2}
|
||||||
Digitale Eingänge
|
openInputModal={openInputModal}
|
||||||
</h2>
|
/>
|
||||||
<div className="grid grid-cols-2 gap-4">
|
|
||||||
{[inputsGroup1, inputsGroup2].map((group, index) => (
|
|
||||||
<div key={index} className="flex-grow">
|
|
||||||
<table className="w-full text-sm border-collapse bg-white rounded-lg">
|
|
||||||
<thead className="bg-gray-100 border-b">
|
|
||||||
<tr>
|
|
||||||
<th className="px-2 py-1 text-left">Eingang</th>
|
|
||||||
<th className="px-2 py-1 text-left">Zustand</th>
|
|
||||||
<th className="px-2 py-1 text-left">Bezeichnung</th>
|
|
||||||
<th className="px-2 py-1 text-left">Aktion</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{group.map((input) => (
|
|
||||||
<tr key={input.id} className="border-b">
|
|
||||||
<td className="flex items-center p-2 xl:py-0 2xl:p-1">
|
|
||||||
<Icon
|
|
||||||
icon="mdi:input"
|
|
||||||
className="text-black-500 mr-2 text-xl"
|
|
||||||
/>
|
|
||||||
{input.id}
|
|
||||||
</td>
|
|
||||||
<td className="p-2 xl:py-0">
|
|
||||||
<span
|
|
||||||
className={
|
|
||||||
input.status === "active"
|
|
||||||
? "text-green-500"
|
|
||||||
: "text-red-500"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{input.status === "active" ? "●" : "⨉"}
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td className="p-2 xl:py-0">{input.description}</td>
|
|
||||||
<td className="p-2 xl:py-0">
|
|
||||||
<Icon
|
|
||||||
icon="mdi:settings"
|
|
||||||
className="text-gray-400 text-lg cursor-pointer"
|
|
||||||
onClick={() => openInputModal(input)}
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Digitale Ausgänge */}
|
{/* Digitale Ausgänge */}
|
||||||
<DigitalOutputs
|
<DigitalOutputs
|
||||||
|
|||||||
Reference in New Issue
Block a user