From 346eb249264660f675bab479b274901d38033237 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 2 Aug 2025 13:20:00 -0600 Subject: [PATCH] feat(dashboard): add manual input option for service name selection in domain handling --- .../application/domains/handle-domain.tsx | 185 +++++++++++------- biome.json | 3 +- 2 files changed, 119 insertions(+), 69 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/domains/handle-domain.tsx b/apps/dokploy/components/dashboard/application/domains/handle-domain.tsx index 9069542d9..9d7a074f9 100644 --- a/apps/dokploy/components/dashboard/application/domains/handle-domain.tsx +++ b/apps/dokploy/components/dashboard/application/domains/handle-domain.tsx @@ -1,3 +1,10 @@ +import { zodResolver } from "@hookform/resolvers/zod"; +import { DatabaseZap, Dices, RefreshCw } from "lucide-react"; +import Link from "next/link"; +import { useEffect, useState } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import z from "zod"; import { AlertBlock } from "@/components/shared/alert-block"; import { Button } from "@/components/ui/button"; import { @@ -34,14 +41,6 @@ import { TooltipTrigger, } from "@/components/ui/tooltip"; import { api } from "@/utils/api"; -import { useEffect, useState } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; - -import { zodResolver } from "@hookform/resolvers/zod"; -import { DatabaseZap, Dices, RefreshCw } from "lucide-react"; -import Link from "next/link"; -import z from "zod"; export type CacheType = "fetch" | "cache"; @@ -123,6 +122,7 @@ interface Props { export const AddDomain = ({ id, type, domainId = "", children }: Props) => { const [isOpen, setIsOpen] = useState(false); const [cacheType, setCacheType] = useState("cache"); + const [isManualInput, setIsManualInput] = useState(false); const utils = api.useUtils(); const { data, refetch } = api.domain.one.useQuery( @@ -325,46 +325,126 @@ export const AddDomain = ({ id, type, domainId = "", children }: Props) => { Service Name
- + ) : ( + + + + )} + {!isManualInput && ( + <> + + + + + + +

+ Fetch: Will clone the repository and + load the services +

+
+
+
+ + + + + + +

+ Cache: If you previously deployed this + compose, it will read the services + from the last deployment/fetch from + the repository +

+
+
+
+ + )} { className="max-w-[10rem]" >

- Fetch: Will clone the repository and load - the services -

-
-
-
- - - - - - -

- Cache: If you previously deployed this - compose, it will read the services from - the last deployment/fetch from the - repository + {isManualInput + ? "Switch to service selection" + : "Enter service name manually"}

diff --git a/biome.json b/biome.json index a26024c86..519deba7b 100644 --- a/biome.json +++ b/biome.json @@ -27,7 +27,8 @@ "noUnsafeOptionalChaining": "off", "noUnusedImports": "error", "noUnusedFunctionParameters": "error", - "noUnusedVariables": "error" + "noUnusedVariables": "error", + "useHookAtTopLevel": "off" }, "style": { "noNonNullAssertion": "off",