From ae08123f787ed85094b809d4b177850f6f86273f Mon Sep 17 00:00:00 2001
From: alphaeusmote <41258468-alphaeusmote@users.noreply.replit.com>
Date: Thu, 10 Apr 2025 11:50:11 +0000
Subject: [PATCH] Checkpoint
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9111ef36-26c8-4085-84ca-a35dc1fec1b5
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7083d608-d6d3-4a6a-9a27-6286c5109627/24e018cf-bcea-47d6-ad75-1ad9ac058ac9.jpg
---
client/src/components/domain/domain-table.tsx | 25 +++++++++++--------
client/src/pages/domains.tsx | 7 +++++-
2 files changed, 21 insertions(+), 11 deletions(-)
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}(?