From cfa01359329ee2ad18b4e756ac38189f441b4dbb Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 10 Aug 2025 16:42:50 -0600 Subject: [PATCH] remove: delete IsolatedDeployment component from dashboard --- .../compose/general/isolated-deployment.tsx | 188 ------------------ 1 file changed, 188 deletions(-) delete mode 100644 apps/dokploy/components/dashboard/compose/general/isolated-deployment.tsx diff --git a/apps/dokploy/components/dashboard/compose/general/isolated-deployment.tsx b/apps/dokploy/components/dashboard/compose/general/isolated-deployment.tsx deleted file mode 100644 index d76f79021..000000000 --- a/apps/dokploy/components/dashboard/compose/general/isolated-deployment.tsx +++ /dev/null @@ -1,188 +0,0 @@ -import { AlertBlock } from "@/components/shared/alert-block"; -import { CodeEditor } from "@/components/shared/code-editor"; -import { Button } from "@/components/ui/button"; -import { - DialogDescription, - DialogHeader, - DialogTitle, -} from "@/components/ui/dialog"; -import { - Form, - FormControl, - FormDescription, - FormField, - FormItem, - FormLabel, -} from "@/components/ui/form"; -import { Label } from "@/components/ui/label"; -import { Switch } from "@/components/ui/switch"; -import { api } from "@/utils/api"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { AlertTriangle } from "lucide-react"; -import { useEffect, useState } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; - -interface Props { - composeId: string; -} - -const schema = z.object({ - isolatedDeployment: z.boolean().optional(), -}); - -type Schema = z.infer; - -export const IsolatedDeployment = ({ composeId }: Props) => { - const utils = api.useUtils(); - const [compose, setCompose] = useState(""); - const { mutateAsync, error, isError } = - api.compose.isolatedDeployment.useMutation(); - - const { mutateAsync: updateCompose } = api.compose.update.useMutation(); - - const { data, refetch } = api.compose.one.useQuery( - { composeId }, - { enabled: !!composeId }, - ); - - console.log(data); - - const form = useForm({ - defaultValues: { - isolatedDeployment: false, - }, - resolver: zodResolver(schema), - }); - - useEffect(() => { - randomizeCompose(); - if (data) { - form.reset({ - isolatedDeployment: data?.isolatedDeployment || false, - }); - } - }, [form, form.reset, form.formState.isSubmitSuccessful, data]); - - const onSubmit = async (formData: Schema) => { - await updateCompose({ - composeId, - isolatedDeployment: formData?.isolatedDeployment || false, - }) - .then(async (_data) => { - await randomizeCompose(); - await refetch(); - toast.success("Compose updated"); - }) - .catch(() => { - toast.error("Error updating the compose"); - }); - }; - - const randomizeCompose = async () => { - await mutateAsync({ - composeId, - suffix: data?.appName || "", - }).then(async (data) => { - await utils.project.all.invalidate(); - setCompose(data); - }); - }; - - return ( - <> - - Isolate Deployment - - Use this option to isolate the deployment of this compose file. - - -
- - This feature creates an isolated environment for your deployment by - adding unique prefixes to all resources. It establishes a dedicated - network based on your compose file's name, ensuring your services run - in isolation. This prevents conflicts when running multiple instances - of the same template or services with identical names. - -
-
-

- Resources that will be isolated: -

-
    -
  • Docker volumes
  • -
  • Docker networks
  • -
-
-
-
- {isError && {error?.message}} -
- - {isError && ( -
- - - {error?.message} - -
- )} - -
-
- ( - -
- - Enable Isolated Deployment ({data?.appName}) - - - Enable isolated deployment to the compose file. - -
- - - -
- )} - /> -
- -
- -
-
-
- -
-							
-						
-
-
- - - ); -};