From 4880b6473ec0339d67615fb7a08989cf3401b21d Mon Sep 17 00:00:00 2001 From: ISA Date: Sun, 29 Sep 2024 17:35:15 +0200 Subject: [PATCH] dashboard ohne Scrollbalken --- app/dashboard/page.jsx | 106 +++++++++++---------- app/layout.js | 8 +- components/Footer.jsx | 2 +- components/Navigation.jsx | 2 +- components/modulesStatus/Access1Status.jsx | 8 +- components/modulesStatus/Access2Status.jsx | 8 +- components/modulesStatus/CPLStatus.jsx | 8 +- components/modulesStatus/Kue705_FO.jsx | 8 +- 8 files changed, 77 insertions(+), 73 deletions(-) diff --git a/app/dashboard/page.jsx b/app/dashboard/page.jsx index 9d77117..2e0b962 100644 --- a/app/dashboard/page.jsx +++ b/app/dashboard/page.jsx @@ -82,58 +82,65 @@ function Dashboard() { const renderBaugruppentraeger = () => { const baugruppen = []; - // Es gibt 4 Baugruppenträger, jeder mit 8 Slots - for (let i = 0; i < 4; i++) { + // Dynamisch berechnen, wie viele Baugruppenträger benötigt werden, basierend auf der Länge von kueVersion + const numBaugruppen = Math.ceil(kueVersion.length / 8); + + for (let i = 0; i < numBaugruppen; i++) { const slots = kueVersion.slice(i * 8, (i + 1) * 8); - baugruppen.push( -
-
- {slots.map((version, index) => { - const slotNumber = i * 8 + index + 1; - return version !== 0 ? ( - - ) : ( -
- Leer -
- ); - })} -
-
+ // Prüfen, ob der Baugruppenträger überhaupt Zahlen oder "0" enthält + const containsNumbersOrZero = slots.some( + (version) => version !== "" && version !== null && version !== undefined ); + + if (containsNumbersOrZero) { + baugruppen.push( +
+
+ {slots.map((version, index) => { + const slotNumber = i * 8 + index + 1; + return version !== 0 ? ( + + ) : ( +
+ Leer +
+ ); + })} +
+
+ ); + } } return baugruppen; }; return ( -
+
{/* Letzte Meldungen - Titel und Icon Bereich */} -
-
+
+
-

Letzten 20 Meldungen

-
-
+
{/* Meldungen Liste */} -
+
@@ -154,18 +161,23 @@ function Dashboard() { - + {last20Messages.length > 0 ? ( last20Messages.map((columns, index) => ( - - - - - + + + + + )) ) : ( @@ -180,7 +192,7 @@ function Dashboard() { {/* Sidebar mit Informationen */} -
+
{/* Versionsinformationen */}

@@ -196,24 +208,22 @@ function Dashboard() {

{/* Beispiel für Geräteanzeige */} -
-
+
+
-
-
- {loading ? ( -

Lädt...

- ) : error ? ( -

{error}

- ) : ( - renderBaugruppentraeger() - )} -
+
+ {loading ? ( +

Lädt...

+ ) : error ? ( +

{error}

+ ) : ( + renderBaugruppentraeger() + )}
@@ -221,8 +231,8 @@ function Dashboard() {
- {/* Footer Informationen */} -
+ {/* IP, Subnet und Gateway Informationen */} +
IP Address
diff --git a/app/layout.js b/app/layout.js index 8341698..b45ff9b 100644 --- a/app/layout.js +++ b/app/layout.js @@ -14,13 +14,13 @@ export default function RootLayout({ children }) { {/* Hier das Layout mit Header, Navigation und Footer */} -
-
+
+
-
{children}
+
{children}
-
+
diff --git a/components/Footer.jsx b/components/Footer.jsx index 20e75a7..22a2404 100644 --- a/components/Footer.jsx +++ b/components/Footer.jsx @@ -3,7 +3,7 @@ import React from "react"; function Footer() { return ( -
+

Littwin Systemtechnik GmbH & Co. KG

diff --git a/components/Navigation.jsx b/components/Navigation.jsx index bb4b034..c0a0e76 100644 --- a/components/Navigation.jsx +++ b/components/Navigation.jsx @@ -24,7 +24,7 @@ function Navigation() { return (
{columns[0]}{columns[1]}{columns[2]}{columns[3]}{columns[4]}{columns[0]}{columns[1]} +
+ {columns[2].split(" ")[0]} + {columns[2].split(" ")[1]} +
+
{columns[3]}{columns[4]}