From f450b13dc5314d6ed1d0ed5190ba04a66428287c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 09:10:37 +0000 Subject: [PATCH 1/3] Initial plan From 9e8dacfe06138ff0eb4aa364671e6d15c6da4b25 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 09:14:40 +0000 Subject: [PATCH 2/3] Fix health check form to properly sync test commands with form state Co-authored-by: Siumauricio <47042324+Siumauricio@users.noreply.github.com> --- .../cluster/swarm-forms/health-check-form.tsx | 13 ++++++++----- .../advanced/cluster/swarm-forms/index.ts | 16 ++++++++-------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/health-check-form.tsx b/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/health-check-form.tsx index b2fc49ef3..54ec0b242 100644 --- a/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/health-check-form.tsx +++ b/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/health-check-form.tsx @@ -31,7 +31,6 @@ interface HealthCheckFormProps { export const HealthCheckForm = ({ id, type }: HealthCheckFormProps) => { const [isLoading, setIsLoading] = useState(false); - const [testCommands, setTestCommands] = useState([]); const queryMap = { postgres: () => @@ -72,6 +71,8 @@ export const HealthCheckForm = ({ id, type }: HealthCheckFormProps) => { }, }); + const testCommands = form.watch("Test") || []; + useEffect(() => { if (data?.healthCheckSwarm) { const hc = data.healthCheckSwarm; @@ -82,7 +83,6 @@ export const HealthCheckForm = ({ id, type }: HealthCheckFormProps) => { StartPeriod: hc.StartPeriod, Retries: hc.Retries, }); - setTestCommands(hc.Test || []); } }, [data, form]); @@ -117,17 +117,20 @@ export const HealthCheckForm = ({ id, type }: HealthCheckFormProps) => { }; const addTestCommand = () => { - setTestCommands([...testCommands, ""]); + form.setValue("Test", [...testCommands, ""]); }; const updateTestCommand = (index: number, value: string) => { const newCommands = [...testCommands]; newCommands[index] = value; - setTestCommands(newCommands); + form.setValue("Test", newCommands); }; const removeTestCommand = (index: number) => { - setTestCommands(testCommands.filter((_, i) => i !== index)); + form.setValue( + "Test", + testCommands.filter((_, i) => i !== index), + ); }; return ( diff --git a/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/index.ts b/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/index.ts index ebd00abcd..2f07be53d 100644 --- a/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/index.ts +++ b/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/index.ts @@ -1,10 +1,10 @@ -export { HealthCheckForm } from "./health-check-form"; -export { RestartPolicyForm } from "./restart-policy-form"; -export { PlacementForm } from "./placement-form"; -export { UpdateConfigForm } from "./update-config-form"; -export { RollbackConfigForm } from "./rollback-config-form"; -export { ModeForm } from "./mode-form"; -export { LabelsForm } from "./labels-form"; -export { StopGracePeriodForm } from "./stop-grace-period-form"; export { EndpointSpecForm } from "./endpoint-spec-form"; +export { HealthCheckForm } from "./health-check-form"; +export { LabelsForm } from "./labels-form"; +export { ModeForm } from "./mode-form"; +export { PlacementForm } from "./placement-form"; +export { RestartPolicyForm } from "./restart-policy-form"; +export { RollbackConfigForm } from "./rollback-config-form"; +export { StopGracePeriodForm } from "./stop-grace-period-form"; +export { UpdateConfigForm } from "./update-config-form"; export { filterEmptyValues, hasValues } from "./utils"; From d3f0bf654bf0995ac1a43d5e610bb68746ff106d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 09:16:49 +0000 Subject: [PATCH 3/3] Fix TypeScript type annotations in health check form Co-authored-by: Siumauricio <47042324+Siumauricio@users.noreply.github.com> --- .../advanced/cluster/swarm-forms/health-check-form.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/health-check-form.tsx b/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/health-check-form.tsx index 54ec0b242..1e0d032f0 100644 --- a/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/health-check-form.tsx +++ b/apps/dokploy/components/dashboard/application/advanced/cluster/swarm-forms/health-check-form.tsx @@ -129,7 +129,7 @@ export const HealthCheckForm = ({ id, type }: HealthCheckFormProps) => { const removeTestCommand = (index: number) => { form.setValue( "Test", - testCommands.filter((_, i) => i !== index), + testCommands.filter((_: string, i: number) => i !== index), ); }; @@ -143,7 +143,7 @@ export const HealthCheckForm = ({ id, type }: HealthCheckFormProps) => { http://localhost:3000/health"])
- {testCommands.map((cmd, index) => ( + {testCommands.map((cmd: string, index: number) => (