This commit is contained in:
marco committed 2026-10-26 14:56:31 +01:00
1 parent 6baea55216
commit d9962e22b8
15 files changed
+358 -30

No files matched your search

+8 -1
View File
@@ -1,10 +1,17 @@
import { api_visuAggregate } from '@/actions/rk2/api-visu-aggregate';
import VisuAggregateTable from '@/components/rk2/visu-aggregate/visuAggregateTable';
import Breadcrumbs from '@/components/ui/navigation/breadcrumbs';
import { api_viewAggregate_overview } from '@/actions/rk2/api-procon-view-aggregate';
export default async function VisuAggregatePage() {
let rows;
try { rows = await api_visuAggregate(); }
try {
const [aggregates, graphics] = await Promise.all([api_visuAggregate(), api_viewAggregate_overview()]);
const withGraphic = new Set(graphics.filter(aggregate => aggregate.elemente.some(element =>
element.darstellung === 'xaml' && element.varianten.some(variant =>
!!(variant.svg?.trim() || variant.xaml?.trim() || variant.xamlBase64?.trim())))).map(aggregate => aggregate.componentId));
rows = aggregates.map(row => ({ ...row, hasGraphic: withGraphic.has(row.componentId) }));
}
catch {
return <div><h1 className="mb-4 text-xl font-semibold">VisuAggregate</h1>
<p role="alert">Die Tabelle konnte nicht geladen werden. Bitte die Backend-Verbindung und die ausgewählte Anlage prüfen und die Seite neu laden.</p></div>;