diff --git a/client/src/components/domain/domain-table.tsx b/client/src/components/domain/domain-table.tsx index e3d5240..e9ac1fb 100644 --- a/client/src/components/domain/domain-table.tsx +++ b/client/src/components/domain/domain-table.tsx @@ -44,30 +44,35 @@ export function DomainTable({ onManageDomain, onDeleteDomain, onAddDomain }: Dom }); const getProviderName = (providerId: string | null | undefined) => { - // Special debugging logs - console.log("Provider ID:", providerId); - console.log("Available providers:", providers); - - if (!providerId) return "None"; + // Handle completely empty providerId cases + if (!providerId || providerId === "") { + return "None"; + } // Check if the provider exists in our providers list + // The providerId from the database will be a string UUID const provider = providers.find(p => p.id === providerId); if (provider) { - console.log("Found provider:", provider); return provider.name; } else { - console.log("Provider not found for ID:", providerId); - return "Unknown"; + // If we have a providerId but can't find the provider (might be deleted) + return "Unknown Provider"; } }; const getProviderIcon = (providerId: string | null | undefined) => { - if (!providerId) return ; + // Handle completely empty providerId cases + if (!providerId || providerId === "") { + return ; + } + // The providerId from the database will be a string UUID const provider = providers.find(p => p.id === providerId); - if (!provider) return ; + if (!provider) { + return ; + } switch (provider.type) { case "cloudflare": diff --git a/client/src/pages/domains.tsx b/client/src/pages/domains.tsx index 3b661f2..b0f2cb5 100644 --- a/client/src/pages/domains.tsx +++ b/client/src/pages/domains.tsx @@ -46,9 +46,14 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Loader2 } from "lucide-react"; +// Domain name regex +const domainRegex = /^((?!-)[A-Za-z0-9-]{1,63}(?