From b0a4b5accde0c3d0bcd4812f17ab06c88951baf8 Mon Sep 17 00:00:00 2001 From: ISA Date: Sat, 10 Aug 2024 11:09:53 +0200 Subject: [PATCH] API sortiert nach IdLD aber noch kein Messwert und Schleifenwert enthalten --- hooks/useLineData.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hooks/useLineData.js b/hooks/useLineData.js index efc77c981..2d2560ff0 100644 --- a/hooks/useLineData.js +++ b/hooks/useLineData.js @@ -89,6 +89,7 @@ const useLineData = (webserviceGisLinesStatusUrl, setLineStatusData) => { return { lineColors, tooltipContents }; }; + //---------------------------------------------------------- // Funktion zum Loggen der gruppierten und aggregierten Daten function logGroupedData(statisList) { @@ -103,15 +104,14 @@ function logGroupedData(statisList) { acc[IdLD][Modul] = { ModulName: ModulName || "Unknown", ModulTyp: ModulTyp || "N/A", - TotalLevel: 0, + TotalLevel: Level, // Use the original Level directly PrioColors: new Set(), PrioNames: new Set(), Messages: [], }; } - // Aggregiere die Level und sammle Prioritätsinformationen und Nachrichten - acc[IdLD][Modul].TotalLevel += Level; + // Speichere die Prioritätsinformationen und Nachrichten acc[IdLD][Modul].PrioColors.add(PrioColor); acc[IdLD][Modul].PrioNames.add(PrioName); if (Message && Message !== "?") { @@ -125,12 +125,12 @@ function logGroupedData(statisList) { const formattedData = {}; Object.entries(grouped).forEach(([stationId, modules]) => { const filteredModules = Object.entries(modules) - .filter(([modulId, data]) => data.ModulName !== "?") + .filter(([modulId, data]) => data.ModulName !== "?") // Filter out modules without names .map(([modulId, data]) => ({ Modul: modulId, ModulName: data.ModulName, ModulTyp: data.ModulTyp, - TotalLevel: data.TotalLevel, + Level: data.TotalLevel, // Use the original Level PrioColors: Array.from(data.PrioColors).join(", "), PrioNames: Array.from(data.PrioNames).join(", "), Messages: data.Messages.join(" | "),