API sortiert nach IdLD aber noch kein Messwert und Schleifenwert enthalten
This commit is contained in:
@@ -89,6 +89,7 @@ const useLineData = (webserviceGisLinesStatusUrl, setLineStatusData) => {
|
|||||||
|
|
||||||
return { lineColors, tooltipContents };
|
return { lineColors, tooltipContents };
|
||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
// Funktion zum Loggen der gruppierten und aggregierten Daten
|
// Funktion zum Loggen der gruppierten und aggregierten Daten
|
||||||
function logGroupedData(statisList) {
|
function logGroupedData(statisList) {
|
||||||
@@ -103,15 +104,14 @@ function logGroupedData(statisList) {
|
|||||||
acc[IdLD][Modul] = {
|
acc[IdLD][Modul] = {
|
||||||
ModulName: ModulName || "Unknown",
|
ModulName: ModulName || "Unknown",
|
||||||
ModulTyp: ModulTyp || "N/A",
|
ModulTyp: ModulTyp || "N/A",
|
||||||
TotalLevel: 0,
|
TotalLevel: Level, // Use the original Level directly
|
||||||
PrioColors: new Set(),
|
PrioColors: new Set(),
|
||||||
PrioNames: new Set(),
|
PrioNames: new Set(),
|
||||||
Messages: [],
|
Messages: [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Aggregiere die Level und sammle Prioritätsinformationen und Nachrichten
|
// Speichere die Prioritätsinformationen und Nachrichten
|
||||||
acc[IdLD][Modul].TotalLevel += Level;
|
|
||||||
acc[IdLD][Modul].PrioColors.add(PrioColor);
|
acc[IdLD][Modul].PrioColors.add(PrioColor);
|
||||||
acc[IdLD][Modul].PrioNames.add(PrioName);
|
acc[IdLD][Modul].PrioNames.add(PrioName);
|
||||||
if (Message && Message !== "?") {
|
if (Message && Message !== "?") {
|
||||||
@@ -125,12 +125,12 @@ function logGroupedData(statisList) {
|
|||||||
const formattedData = {};
|
const formattedData = {};
|
||||||
Object.entries(grouped).forEach(([stationId, modules]) => {
|
Object.entries(grouped).forEach(([stationId, modules]) => {
|
||||||
const filteredModules = Object.entries(modules)
|
const filteredModules = Object.entries(modules)
|
||||||
.filter(([modulId, data]) => data.ModulName !== "?")
|
.filter(([modulId, data]) => data.ModulName !== "?") // Filter out modules without names
|
||||||
.map(([modulId, data]) => ({
|
.map(([modulId, data]) => ({
|
||||||
Modul: modulId,
|
Modul: modulId,
|
||||||
ModulName: data.ModulName,
|
ModulName: data.ModulName,
|
||||||
ModulTyp: data.ModulTyp,
|
ModulTyp: data.ModulTyp,
|
||||||
TotalLevel: data.TotalLevel,
|
Level: data.TotalLevel, // Use the original Level
|
||||||
PrioColors: Array.from(data.PrioColors).join(", "),
|
PrioColors: Array.from(data.PrioColors).join(", "),
|
||||||
PrioNames: Array.from(data.PrioNames).join(", "),
|
PrioNames: Array.from(data.PrioNames).join(", "),
|
||||||
Messages: data.Messages.join(" | "),
|
Messages: data.Messages.join(" | "),
|
||||||
|
|||||||
Reference in New Issue
Block a user