From fdf88b1ff3af7b0b7c74374889437a42a0643151 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Mon, 12 Jan 2026 09:13:18 -0600 Subject: [PATCH 1/2] feat(build): add Railpack version selection with manual input option - Introduced a dropdown for selecting Railpack versions, including a manual entry option for custom versions. - Implemented state management to toggle between predefined versions and manual input. - Updated form handling to accommodate the new selection method and provide user guidance. --- .../dashboard/application/build/show.tsx | 143 +++++++++++++++--- 1 file changed, 125 insertions(+), 18 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/build/show.tsx b/apps/dokploy/components/dashboard/application/build/show.tsx index 1a0ed386d..3488c8f49 100644 --- a/apps/dokploy/components/dashboard/application/build/show.tsx +++ b/apps/dokploy/components/dashboard/application/build/show.tsx @@ -1,6 +1,6 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { Cog } from "lucide-react"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; @@ -20,8 +20,39 @@ import { } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; import { api } from "@/utils/api"; +// Railpack versions from https://github.com/railwayapp/railpack/releases +export const RAILPACK_VERSIONS = [ + "0.15.4", + "0.15.3", + "0.15.2", + "0.15.1", + "0.15.0", + "0.14.0", + "0.13.0", + "0.12.0", + "0.11.0", + "0.10.0", + "0.9.2", + "0.9.1", + "0.9.0", + "0.8.0", + "0.7.0", + "0.6.0", + "0.5.0", + "0.4.0", + "0.3.0", + "0.2.2", +] as const; + export enum BuildType { dockerfile = "dockerfile", heroku_buildpacks = "heroku_buildpacks", @@ -152,6 +183,9 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => { }); const buildType = form.watch("buildType"); + const railpackVersion = form.watch("railpackVersion"); + const [isManualRailpackVersion, setIsManualRailpackVersion] = + useState(false); useEffect(() => { if (data) { @@ -163,6 +197,14 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => { }; form.reset(resetData(typedData)); + + // Check if railpack version is manual (not in the predefined list) + if ( + data.railpackVersion && + !RAILPACK_VERSIONS.includes(data.railpackVersion as any) + ) { + setIsManualRailpackVersion(true); + } } }, [data, form]); @@ -403,23 +445,88 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => { /> )} {buildType === BuildType.railpack && ( - ( - - Railpack Version - - - - - - )} - /> + <> + ( + + Railpack Version + + {isManualRailpackVersion ? ( +
+ + +
+ ) : ( + + )} +
+ + Select a Railpack version or choose manual to enter a + custom version.{" "} + + View releases + + + +
+ )} + /> + )}