diff --git a/frontend/src/pages/CertificatesPage.tsx b/frontend/src/pages/CertificatesPage.tsx index a3f2640..779c931 100644 --- a/frontend/src/pages/CertificatesPage.tsx +++ b/frontend/src/pages/CertificatesPage.tsx @@ -463,58 +463,70 @@ export default function CertificatesPage() { - {certs.map((cert) => { - const expiring = cert.status === 'active' && isExpiringSoon(cert.expires_at) + {Object.values( + certs.reduce((acc, cert) => { + const groupKey = cert.host_id || 'unassigned' + if (!acc[groupKey]) acc[groupKey] = [] + acc[groupKey].push(cert) + return acc + }, {} as Record) + ).map((group) => { + const primary = group[0] + const isPair = group.length > 1 + const expiring = primary.status === 'active' && isExpiringSoon(primary.expires_at) return ( - + - - {cert.common_name} - + + + {primary.common_name} + + {isPair && } + - {cert.serial_number} + {primary.serial_number} - {statusChip(cert.status)} + {statusChip(primary.status)} - {fmtDate(cert.issued_at)} + {fmtDate(primary.issued_at)} - {fmtDate(cert.expires_at)} + {fmtDate(primary.expires_at)} {expiring && ' ⚠️'} - {cert.host_id ?? Root CA} + {primary.host_id ?? Root CA} {canWrite && ( <> - + - {cert.status === 'active' && ( - + {primary.status === 'active' && ( +