From 22752ffcb16a5ce2a9222d53d71bc7fc86f7d633 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Fri, 10 Apr 2026 19:04:16 +0200 Subject: [PATCH] fix: polish CertificatesPage layout - Truncate fingerprint with hover tooltip - Remove duplicate warning icon in stale banner - Style file inputs to match design system - Bump grid min-width for better card spacing Co-Authored-By: Claude Opus 4.6 (1M context) --- ui/src/pages/vendor/CertificatesPage.tsx | 65 +++++++++++++++--------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/ui/src/pages/vendor/CertificatesPage.tsx b/ui/src/pages/vendor/CertificatesPage.tsx index 37eb9f3..a2c0dfb 100644 --- a/ui/src/pages/vendor/CertificatesPage.tsx +++ b/ui/src/pages/vendor/CertificatesPage.tsx @@ -7,7 +7,7 @@ import { Spinner, useToast, } from '@cameleer/design-system'; -import { Upload, ShieldCheck, RotateCcw, Trash2, AlertTriangle } from 'lucide-react'; +import { Upload, ShieldCheck, RotateCcw, Trash2 } from 'lucide-react'; import { useVendorCertificates, useStageCertificate, @@ -35,6 +35,12 @@ function expiryColor(iso: string | null | undefined): string | undefined { return undefined; } +function shortenFingerprint(fp: string | null | undefined): string { + if (!fp) return '—'; + // Show first 23 chars (8 hex pairs) + ellipsis + return fp.length > 23 ? fp.slice(0, 23) + '...' : fp; +} + function CertCard({ cert, title, @@ -68,8 +74,8 @@ function CertCard({
Fingerprint - - {cert.fingerprint} + + {shortenFingerprint(cert.fingerprint)}
@@ -94,6 +100,34 @@ function CertCard({ ); } +function FileField({ label, inputRef, accept }: { + label: string; + inputRef: React.RefObject; + accept: string; +}) { + return ( +
+ + +
+ ); +} + export function CertificatesPage() { const { toast } = useToast(); const { data, isLoading, isError } = useVendorCertificates(); @@ -143,7 +177,6 @@ export function CertificatesPage() { const result = await stageMutation.mutateAsync(formData); if (result.valid) { toast({ title: 'Certificate staged successfully', variant: 'success' }); - // Clear file inputs if (certInputRef.current) certInputRef.current.value = ''; if (keyInputRef.current) keyInputRef.current.value = ''; if (caInputRef.current) caInputRef.current.value = ''; @@ -192,13 +225,12 @@ export function CertificatesPage() { {data.staleTenantCount > 0 && ( - {data.staleTenantCount} tenant{data.staleTenantCount > 1 ? 's' : ''} need a restart to pick up the updated CA bundle. )} -
+
{data.active && ( )} @@ -251,24 +283,9 @@ export function CertificatesPage() { {/* Upload card */}
-
- - -
-
- - -
-
- - -
+ + +