diff --git a/server/private/routers/certificates/getCertificate.ts b/server/private/routers/certificates/getCertificate.ts index d439011a7..fca53e9bb 100644 --- a/server/private/routers/certificates/getCertificate.ts +++ b/server/private/routers/certificates/getCertificate.ts @@ -40,6 +40,8 @@ async function query(domainId: string, domain: string) { throw new Error(`Domain with ID ${domainId} not found`); } + const domainType = domainRecord.type; + let existing: any[] = []; if (domainRecord.type == "ns" || domainRecord.type == "wildcard") { const domainLevelDown = domain.split(".").slice(1).join("."); @@ -98,7 +100,7 @@ async function query(domainId: string, domain: string) { ); } - return existing.length > 0 ? existing[0] : null; + return existing.length > 0 ? { ...existing[0], domainType } : null; } registry.registerPath({ diff --git a/server/routers/certificates/types.ts b/server/routers/certificates/types.ts index bca9412c4..e6aeecdf8 100644 --- a/server/routers/certificates/types.ts +++ b/server/routers/certificates/types.ts @@ -3,6 +3,7 @@ export type GetCertificateResponse = { domain: string; domainId: string; wildcard: boolean; + domainType: string; status: string; // pending, requested, valid, expired, failed expiresAt: string | null; lastRenewalAttempt: Date | null; @@ -10,4 +11,4 @@ export type GetCertificateResponse = { updatedAt: number; errorMessage?: string | null; renewalCount: number; -}; +}; \ No newline at end of file diff --git a/src/components/CertificateStatus.tsx b/src/components/CertificateStatus.tsx index 8271ccb60..9b08aedfe 100644 --- a/src/components/CertificateStatus.tsx +++ b/src/components/CertificateStatus.tsx @@ -12,7 +12,6 @@ type CertificateStatusProps = { autoFetch?: boolean; showLabel?: boolean; className?: string; - disableRestartButton?: boolean; onRefresh?: () => void; polling?: boolean; pollingInterval?: number; @@ -24,7 +23,6 @@ export default function CertificateStatus({ fullDomain, autoFetch = true, showLabel = true, - disableRestartButton = false, className = "", onRefresh, polling = false, @@ -120,6 +118,7 @@ export default function CertificateStatus({ } const isPending = cert.status === "pending"; + const disableRestartButton = cert.domainType === "wildcard"; return (
@@ -133,7 +132,7 @@ export default function CertificateStatus({ variant="ghost" className={`h-auto p-0 text-sm ${getStatusColor(cert.status)}`} onClick={handleRefresh} - disabled={refreshing} + disabled={refreshing || disableRestartButton} title={t("restartCertificate", { defaultValue: "Restart Certificate" })}