diff --git a/apps/dokploy/components/dashboard/application/advanced/show-application-advanced-settings.tsx b/apps/dokploy/components/dashboard/application/advanced/show-application-advanced-settings.tsx index c603ea327..b436e708f 100644 --- a/apps/dokploy/components/dashboard/application/advanced/show-application-advanced-settings.tsx +++ b/apps/dokploy/components/dashboard/application/advanced/show-application-advanced-settings.tsx @@ -16,19 +16,19 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; -import { api } from "@/utils/api"; -import { zodResolver } from "@hookform/resolvers/zod"; -import React, { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; import { InfoIcon } from "lucide-react"; +import React, { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; const addResourcesApplication = z.object({ memoryReservation: z.number().nullable().optional(), diff --git a/apps/dokploy/components/dashboard/application/domains/add-domain.tsx b/apps/dokploy/components/dashboard/application/domains/add-domain.tsx index 22eaf1d3c..611689439 100644 --- a/apps/dokploy/components/dashboard/application/domains/add-domain.tsx +++ b/apps/dokploy/components/dashboard/application/domains/add-domain.tsx @@ -104,9 +104,7 @@ export const AddDomain = ({ const dictionary = { success: domainId ? "Domain Updated" : "Domain Created", - error: domainId - ? "Error updating the domain" - : "Error creating the domain", + error: domainId ? "Error updating the domain" : "Error creating the domain", submit: domainId ? "Update" : "Create", dialogDescription: domainId ? "In this section you can edit a domain" diff --git a/apps/dokploy/components/dashboard/application/preview-deployments/add-preview-domain.tsx b/apps/dokploy/components/dashboard/application/preview-deployments/add-preview-domain.tsx index 3a33bbed2..64b7c3c61 100644 --- a/apps/dokploy/components/dashboard/application/preview-deployments/add-preview-domain.tsx +++ b/apps/dokploy/components/dashboard/application/preview-deployments/add-preview-domain.tsx @@ -104,9 +104,7 @@ export const AddPreviewDomain = ({ const dictionary = { success: domainId ? "Domain Updated" : "Domain Created", - error: domainId - ? "Error updating the domain" - : "Error creating the domain", + error: domainId ? "Error updating the domain" : "Error creating the domain", submit: domainId ? "Update" : "Create", dialogDescription: domainId ? "In this section you can edit a domain" diff --git a/apps/dokploy/components/dashboard/compose/domains/add-domain.tsx b/apps/dokploy/components/dashboard/compose/domains/add-domain.tsx index b9ae9a2ed..e18d40d73 100644 --- a/apps/dokploy/components/dashboard/compose/domains/add-domain.tsx +++ b/apps/dokploy/components/dashboard/compose/domains/add-domain.tsx @@ -126,9 +126,7 @@ export const AddDomainCompose = ({ const dictionary = { success: domainId ? "Domain Updated" : "Domain Created", - error: domainId - ? "Error updating the domain" - : "Error creating the domain", + error: domainId ? "Error updating the domain" : "Error creating the domain", submit: domainId ? "Update" : "Create", dialogDescription: domainId ? "In this section you can edit a domain" diff --git a/apps/dokploy/components/dashboard/mariadb/advanced/show-mariadb-resources.tsx b/apps/dokploy/components/dashboard/mariadb/advanced/show-mariadb-resources.tsx index 7624441ea..540ff6e74 100644 --- a/apps/dokploy/components/dashboard/mariadb/advanced/show-mariadb-resources.tsx +++ b/apps/dokploy/components/dashboard/mariadb/advanced/show-mariadb-resources.tsx @@ -16,14 +16,14 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; -import { api } from "@/utils/api"; -import { zodResolver } from "@hookform/resolvers/zod"; import { + Tooltip, + TooltipContent, TooltipProvider, TooltipTrigger, - TooltipContent, - Tooltip, } from "@/components/ui/tooltip"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; import { InfoIcon } from "lucide-react"; import React, { useEffect } from "react"; import { useForm } from "react-hook-form"; diff --git a/apps/dokploy/components/dashboard/mongo/advanced/show-mongo-resources.tsx b/apps/dokploy/components/dashboard/mongo/advanced/show-mongo-resources.tsx index d4824f526..3e49173f0 100644 --- a/apps/dokploy/components/dashboard/mongo/advanced/show-mongo-resources.tsx +++ b/apps/dokploy/components/dashboard/mongo/advanced/show-mongo-resources.tsx @@ -16,16 +16,16 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; -import { api } from "@/utils/api"; -import { zodResolver } from "@hookform/resolvers/zod"; -import React, { useEffect } from "react"; import { + Tooltip, + TooltipContent, TooltipProvider, TooltipTrigger, - TooltipContent, - Tooltip, } from "@/components/ui/tooltip"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; import { InfoIcon } from "lucide-react"; +import React, { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; diff --git a/apps/dokploy/components/dashboard/mysql/advanced/show-mysql-resources.tsx b/apps/dokploy/components/dashboard/mysql/advanced/show-mysql-resources.tsx index bcf5a0b90..cd7aea4e7 100644 --- a/apps/dokploy/components/dashboard/mysql/advanced/show-mysql-resources.tsx +++ b/apps/dokploy/components/dashboard/mysql/advanced/show-mysql-resources.tsx @@ -16,17 +16,17 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; -import { api } from "@/utils/api"; -import { zodResolver } from "@hookform/resolvers/zod"; -import React, { useEffect } from "react"; -import { useForm } from "react-hook-form"; import { + Tooltip, + TooltipContent, TooltipProvider, TooltipTrigger, - TooltipContent, - Tooltip, } from "@/components/ui/tooltip"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; import { InfoIcon } from "lucide-react"; +import React, { useEffect } from "react"; +import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; diff --git a/apps/dokploy/components/dashboard/postgres/advanced/show-postgres-resources.tsx b/apps/dokploy/components/dashboard/postgres/advanced/show-postgres-resources.tsx index 678aec29f..22863af1d 100644 --- a/apps/dokploy/components/dashboard/postgres/advanced/show-postgres-resources.tsx +++ b/apps/dokploy/components/dashboard/postgres/advanced/show-postgres-resources.tsx @@ -16,18 +16,18 @@ import { FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; -import { api } from "@/utils/api"; -import { zodResolver } from "@hookform/resolvers/zod"; -import React, { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; import { + Tooltip, + TooltipContent, TooltipProvider, TooltipTrigger, - TooltipContent, - Tooltip, } from "@/components/ui/tooltip"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; import { InfoIcon } from "lucide-react"; +import React, { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; import { z } from "zod"; const addResourcesPostgres = z.object({ diff --git a/apps/dokploy/components/dashboard/project/add-ai-assistant.tsx b/apps/dokploy/components/dashboard/project/add-ai-assistant.tsx new file mode 100644 index 000000000..2bb47618e --- /dev/null +++ b/apps/dokploy/components/dashboard/project/add-ai-assistant.tsx @@ -0,0 +1,10 @@ +import { TemplateGenerator } from "@/components/dashboard/project/ai/template-generator"; + +interface Props { + projectId: string; + projectName?: string; +} + +export const AddAiAssistant = ({ projectId }: Props) => { + return ; +}; diff --git a/apps/dokploy/components/dashboard/project/ai/step-four.tsx b/apps/dokploy/components/dashboard/project/ai/step-four.tsx new file mode 100644 index 000000000..276869f7c --- /dev/null +++ b/apps/dokploy/components/dashboard/project/ai/step-four.tsx @@ -0,0 +1,92 @@ +import { Button } from "@/components/ui/button"; +import { ScrollArea } from "@/components/ui/scroll-area"; +import dynamic from "next/dynamic"; +import ReactMarkdown from "react-markdown"; + +const MonacoEditor = dynamic(() => import("@monaco-editor/react"), { + ssr: false, +}); + +export function StepFour({ + prevStep, + templateInfo, + setOpen, + setTemplateInfo, +}: any) { + const handleSubmit = () => { + setTemplateInfo(templateInfo); // Update the template info + setOpen(false); + }; + + return ( +
+
+
+

Step 4: Review and Finalize

+ +
+
+ + {templateInfo.details.description} + +
+
+

Name

+

{templateInfo.name}

+
+
+

Server

+

{templateInfo.server || "localhost"}

+
+
+

Docker Compose

+ +
+
+

Environment Variables

+
    + {templateInfo.details.envVariables.map( + ( + env: { + name: string; + value: string; + }, + index: number, + ) => ( +
  • + {env.name}: + {env.value} +
  • + ), + )} +
+
+
+
+
+
+
+
+ + +
+
+
+ ); +} diff --git a/apps/dokploy/components/dashboard/project/ai/step-one.tsx b/apps/dokploy/components/dashboard/project/ai/step-one.tsx new file mode 100644 index 000000000..704816e2c --- /dev/null +++ b/apps/dokploy/components/dashboard/project/ai/step-one.tsx @@ -0,0 +1,69 @@ +"use client"; + +import { Button } from "@/components/ui/button"; +import { Label } from "@/components/ui/label"; +import { Textarea } from "@/components/ui/textarea"; +import { useState } from "react"; + +const examples = [ + "Make a personal blog", + "Add a photo studio portfolio", + "Create a personal ad blocker", + "Build a social media dashboard", + "Sendgrid service opensource analogue", +]; + +export function StepOne({ nextStep, setTemplateInfo, templateInfo }: any) { + const [userInput, setUserInput] = useState(templateInfo.userInput); + + const handleNext = () => { + setTemplateInfo({ ...templateInfo, userInput }); + nextStep(); + }; + + const handleExampleClick = (example: string) => { + setUserInput(example); + }; + + return ( +
+
+
+

Step 1: Describe Your Needs

+
+ +