From e173f59d89357dce6841674a5212fb19533f1080 Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Wed, 29 Apr 2026 13:44:35 -0700 Subject: [PATCH] visual improvements --- src/components/ClientResourcesTable.tsx | 14 +- .../PrivateResourceCertAccessIndicator.tsx | 148 ++---------------- src/components/ResourceSitesStatusCell.tsx | 8 +- 3 files changed, 27 insertions(+), 143 deletions(-) diff --git a/src/components/ClientResourcesTable.tsx b/src/components/ClientResourcesTable.tsx index 2bb0c6f27..9d2c46106 100644 --- a/src/components/ClientResourcesTable.tsx +++ b/src/components/ClientResourcesTable.tsx @@ -453,6 +453,13 @@ export default function ClientResourcesTable({ return (
+
+ +
{did ? ( ) : null} -
- -
); } diff --git a/src/components/PrivateResourceCertAccessIndicator.tsx b/src/components/PrivateResourceCertAccessIndicator.tsx index 92748abc4..8b06721a5 100644 --- a/src/components/PrivateResourceCertAccessIndicator.tsx +++ b/src/components/PrivateResourceCertAccessIndicator.tsx @@ -1,6 +1,6 @@ "use client"; -import { Button } from "@app/components/ui/button"; +import CertificateStatus from "@app/components/CertificateStatus"; import { Popover, PopoverAnchor, @@ -8,12 +8,7 @@ import { } from "@app/components/ui/popover"; import { useCertificate } from "@app/hooks/useCertificate"; import { cn } from "@app/lib/cn"; -import { - CheckCircle2, - Clock, - RotateCw, - XCircle -} from "lucide-react"; +import { CheckCircle2, Clock, XCircle } from "lucide-react"; import { useTranslations } from "next-intl"; import { useCallback, useEffect, useRef, useState } from "react"; @@ -53,16 +48,6 @@ function getStatusIcon(status: string) { } } -function shouldShowRefreshButton(status: string, updatedAt: number) { - return ( - status === "failed" || - status === "expired" || - (status === "requested" && - updatedAt && - new Date(updatedAt * 1000).getTime() < Date.now() - 5 * 60 * 1000) - ); -} - export function PrivateResourceCertAccessIndicator({ orgId, domainId, @@ -72,13 +57,12 @@ export function PrivateResourceCertAccessIndicator({ const [open, setOpen] = useState(false); const closeTimerRef = useRef | null>(null); - const { cert, certLoading, certError, refreshing, refreshCert } = - useCertificate({ - orgId, - domainId, - fullDomain, - autoFetch: true - }); + const { cert, certLoading, certError } = useCertificate({ + orgId, + domainId, + fullDomain, + autoFetch: true + }); const clearCloseTimer = useCallback(() => { if (closeTimerRef.current != null) { @@ -101,10 +85,6 @@ export function PrivateResourceCertAccessIndicator({ return () => clearCloseTimer(); }, [clearCloseTimer]); - const handleRefresh = async () => { - await refreshCert(); - }; - if (certLoading) { return (
e.preventDefault()} > -
-
- {t("certificateStatus")} -
- {certError ? ( - - - {certError} - - ) : !cert ? ( - - - {t("none", { defaultValue: "None" })} - - ) : ( - <> - {isPending && !disableWildcard ? ( - - ) : ( - - - {(() => { - const StatusIcon = getStatusIcon( - cert.status - ); - return ( - - ); - })()} - {cert.status.charAt(0).toUpperCase() + - cert.status.slice(1)} - {shouldShowRefreshButton( - cert.status, - cert.updatedAt - ) && !disableWildcard ? ( - - ) : null} - - - )} - {cert.errorMessage && - (cert.status === "failed" || - cert.status === "expired") ? ( -

- {cert.errorMessage} -

- ) : null} - {cert.expiresAt && cert.status === "valid" ? ( -

- {t("expiresAt")}:{" "} - {new Date( - cert.expiresAt - ).toLocaleDateString()} -

- ) : null} - - )} -
+
); diff --git a/src/components/ResourceSitesStatusCell.tsx b/src/components/ResourceSitesStatusCell.tsx index 8a33c284d..4560c2f26 100644 --- a/src/components/ResourceSitesStatusCell.tsx +++ b/src/components/ResourceSitesStatusCell.tsx @@ -52,7 +52,7 @@ function aggregateStatusDotClass(status: AggregateSitesStatus): string { return "bg-neutral-500"; case "unknown": default: - return "bg-transparent"; + return "border border-muted-foreground/50 bg-transparent"; } } @@ -107,10 +107,10 @@ export function ResourceSitesStatusCell({ className={cn( "h-2 w-2 shrink-0 rounded-full", !hasKnownStatus - ? "bg-transparent" + ? "border border-muted-foreground/50 bg-transparent" : isOnline - ? "bg-green-500" - : "bg-neutral-500" + ? "bg-green-500" + : "bg-neutral-500" )} />