From 1bad0c538b747ed86d0e3b7ec7d00b402756174e Mon Sep 17 00:00:00 2001 From: Milo Schwartz Date: Thu, 30 Jan 2025 10:55:57 -0500 Subject: [PATCH] add link to docs for tcp/udp --- .../settings/resources/CreateResourceForm.tsx | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/app/[orgId]/settings/resources/CreateResourceForm.tsx b/src/app/[orgId]/settings/resources/CreateResourceForm.tsx index 33f5bdfc..4ac8055a 100644 --- a/src/app/[orgId]/settings/resources/CreateResourceForm.tsx +++ b/src/app/[orgId]/settings/resources/CreateResourceForm.tsx @@ -60,6 +60,8 @@ import { SelectValue } from "@app/components/ui/select"; import { subdomainSchema } from "@server/schemas/subdomainSchema"; +import Link from "next/link"; +import { SquareArrowOutUpRight } from "lucide-react"; const createResourceFormSchema = z .object({ @@ -68,18 +70,23 @@ const createResourceFormSchema = z siteId: z.number(), http: z.boolean(), protocol: z.string(), - proxyPort: z.number().optional(), + proxyPort: z.number().optional() }) .refine( (data) => { if (!data.http) { - return z.number().int().min(1).max(65535).safeParse(data.proxyPort).success; + return z + .number() + .int() + .min(1) + .max(65535) + .safeParse(data.proxyPort).success; } return true; }, { message: "Invalid port number", - path: ["proxyPort"], + path: ["proxyPort"] } ) .refine( @@ -91,7 +98,7 @@ const createResourceFormSchema = z }, { message: "Invalid subdomain", - path: ["subdomain"], + path: ["subdomain"] } ); @@ -295,6 +302,20 @@ export default function CreateResourceForm({ /> )} + {!form.watch("http") && ( + + + Learn how to use set up TCP/UDP resources + + + + )} + {!form.watch("http") && ( <>