diff --git a/messages/en-US.json b/messages/en-US.json index 48103b04..61ff3ca6 100644 --- a/messages/en-US.json +++ b/messages/en-US.json @@ -1161,7 +1161,7 @@ "selectDomainTypeNsDescription": "This domain and all its subdomains. Use this when you want to control an entire domain zone.", "selectDomainTypeCnameName": "Single Domain (CNAME)", "selectDomainTypeCnameDescription": "Just this specific domain. Use this for individual subdomains or specific domain entries.", - "selectDomainTypeWildcardName": "Wildcard Domain (CNAME)", + "selectDomainTypeWildcardName": "Wildcard Domain", "selectDomainTypeWildcardDescription": "This domain and its first level of subdomains.", "domainDelegation": "Single Domain", "selectType": "Select a type", diff --git a/server/routers/domain/listDomains.ts b/server/routers/domain/listDomains.ts index cb968854..fe51cde6 100644 --- a/server/routers/domain/listDomains.ts +++ b/server/routers/domain/listDomains.ts @@ -42,6 +42,7 @@ async function queryDomains(orgId: string, limit: number, offset: number) { type: domains.type, failed: domains.failed, tries: domains.tries, + configManaged: domains.configManaged }) .from(orgDomains) .where(eq(orgDomains.orgId, orgId)) diff --git a/src/app/[orgId]/settings/domains/DomainsTable.tsx b/src/app/[orgId]/settings/domains/DomainsTable.tsx index 1f73d5ae..cb26b357 100644 --- a/src/app/[orgId]/settings/domains/DomainsTable.tsx +++ b/src/app/[orgId]/settings/domains/DomainsTable.tsx @@ -23,6 +23,7 @@ export type DomainRow = { verified: boolean; failed: boolean; tries: number; + configManaged: boolean; }; type Props = { @@ -36,7 +37,9 @@ export default function DomainsTable({ domains }: Props) { null ); const [isRefreshing, setIsRefreshing] = useState(false); - const [restartingDomains, setRestartingDomains] = useState>(new Set()); + const [restartingDomains, setRestartingDomains] = useState>( + new Set() + ); const api = createApiClient(useEnvContext()); const router = useRouter(); const t = useTranslations(); @@ -46,6 +49,7 @@ export default function DomainsTable({ domains }: Props) { const refreshData = async () => { setIsRefreshing(true); try { + await new Promise((resolve) => setTimeout(resolve, 200)); router.refresh(); } catch (error) { toast({ @@ -77,12 +81,14 @@ export default function DomainsTable({ domains }: Props) { }; const restartDomain = async (domainId: string) => { - setRestartingDomains(prev => new Set(prev).add(domainId)); + setRestartingDomains((prev) => new Set(prev).add(domainId)); try { await api.post(`/org/${org.org.orgId}/domain/${domainId}/restart`); toast({ title: t("success"), - description: t("domainRestartedDescription", { fallback: "Domain verification restarted successfully" }) + description: t("domainRestartedDescription", { + fallback: "Domain verification restarted successfully" + }) }); refreshData(); } catch (e) { @@ -92,7 +98,7 @@ export default function DomainsTable({ domains }: Props) { variant: "destructive" }); } finally { - setRestartingDomains(prev => { + setRestartingDomains((prev) => { const newSet = new Set(prev); newSet.delete(domainId); return newSet; @@ -172,7 +178,11 @@ export default function DomainsTable({ domains }: Props) { if (verified) { return {t("verified")}; } else if (failed) { - return {t("failed", { fallback: "Failed" })}; + return ( + + {t("failed", { fallback: "Failed" })} + + ); } else { return {t("pending")}; } @@ -183,7 +193,7 @@ export default function DomainsTable({ domains }: Props) { cell: ({ row }) => { const domain = row.original; const isRestarting = restartingDomains.has(domain.domainId); - + return (
{domain.failed && ( @@ -193,19 +203,25 @@ export default function DomainsTable({ domains }: Props) { onClick={() => restartDomain(domain.domainId)} disabled={isRestarting} > - {isRestarting ? t("restarting", { fallback: "Restarting..." }) : t("restart", { fallback: "Restart" })} + {isRestarting + ? t("restarting", { + fallback: "Restarting..." + }) + : t("restart", { fallback: "Restart" })} + + )} + {!domain.configManaged && ( + )} -
); } diff --git a/src/app/[orgId]/settings/sites/SitesTable.tsx b/src/app/[orgId]/settings/sites/SitesTable.tsx index da84b75b..668c57ba 100644 --- a/src/app/[orgId]/settings/sites/SitesTable.tsx +++ b/src/app/[orgId]/settings/sites/SitesTable.tsx @@ -26,7 +26,6 @@ import { toast } from "@app/hooks/useToast"; import { formatAxiosError } from "@app/lib/api"; import { createApiClient } from "@app/lib/api"; import { useEnvContext } from "@app/hooks/useEnvContext"; -import CreateSiteFormModal from "./CreateSiteModal"; import { useTranslations } from "next-intl"; import { parseDataSize } from "@app/lib/dataSize"; import { Badge } from "@app/components/ui/badge"; @@ -68,8 +67,10 @@ export default function SitesTable({ sites, orgId }: SitesTableProps) { }, [sites]); const refreshData = async () => { + console.log("Data refreshed"); setIsRefreshing(true); try { + await new Promise((resolve) => setTimeout(resolve, 200)); router.refresh(); } catch (error) { toast({ diff --git a/src/components/ui/data-table.tsx b/src/components/ui/data-table.tsx index 75a37e58..6b22ddfe 100644 --- a/src/components/ui/data-table.tsx +++ b/src/components/ui/data-table.tsx @@ -111,9 +111,10 @@ export function DataTable({ variant="outline" onClick={onRefresh} disabled={isRefreshing} - loading={isRefreshing} > - + {t("refresh")} )}