From bf0aa4d95962bfeca9e2471da7f2fd9a98c0c23d Mon Sep 17 00:00:00 2001 From: Yinyin Liu Date: Tue, 9 Jun 2026 10:51:18 +0200 Subject: [PATCH] add link from alarm summary to installation itself --- .../src/content/dashboards/Report/index.tsx | 47 ++++++++++++++----- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/typescript/frontend-marios2/src/content/dashboards/Report/index.tsx b/typescript/frontend-marios2/src/content/dashboards/Report/index.tsx index 170debd52..7669defef 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Report/index.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Report/index.tsx @@ -270,6 +270,39 @@ function Report() { }); }; + // Deep-link to an installation's Log tab (mirrors the Ticket detail navigation). + const openInstallationLog = (product: number, installationId: number) => { + const productRoutes: Record = { + 0: routes.installations, + 1: routes.salidomo_installations, + 2: routes.sodiohome_installations, + 3: routes.sodistore_installations, + 4: routes.sodistoregrid_installations, + 5: routes.sodistorepro_installations + }; + const prefix = productRoutes[product] ?? routes.installations; + navigate(prefix + routes.list + routes.installation + installationId + '/' + routes.log); + }; + + const installationCell = (name: string, product: number, installationId: number) => ( + + openInstallationLog(product, installationId)} + sx={{ + color: 'primary.main', + cursor: 'pointer', + '&:hover': { textDecoration: 'underline' } + }} + > + {name} + + + {productLabel(product)} + + + ); + const severityIcon = (sev: 'error' | 'warning') => sev === 'error' ? ( @@ -640,12 +673,7 @@ function Report() { )} - - {g.installationName} - - {productLabel(g.product)} - - + {installationCell(g.installationName, g.product, g.installationId)} {deviceLabel(g.device)} {alarmDisplayName(g.description)} {severityIcon(g.severity)} @@ -682,12 +710,7 @@ function Report() { )) : rawSorted.map((r) => ( - - {r.installationName} - - {productLabel(r.product)} - - + {installationCell(r.installationName, r.product, r.installationId)} {deviceLabel(r.device)} {alarmDisplayName(r.description)} {severityIcon(r.severity)}