From cef21ac8b5bae06e1054a1f11fd032d8612a0664 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 29 Sep 2024 13:31:38 -0600 Subject: [PATCH] fix(multi-server): remove string validation on port --- .../dashboard/settings/servers/add-server.tsx | 16 +++++++++++++++- .../dashboard/settings/servers/update-server.tsx | 16 +++++++++++++++- apps/dokploy/package.json | 2 +- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/apps/dokploy/components/dashboard/settings/servers/add-server.tsx b/apps/dokploy/components/dashboard/settings/servers/add-server.tsx index 6bd44dcfe..8cb71167f 100644 --- a/apps/dokploy/components/dashboard/settings/servers/add-server.tsx +++ b/apps/dokploy/components/dashboard/settings/servers/add-server.tsx @@ -212,7 +212,21 @@ export const AddServer = () => { Port - + { + const value = e.target.value; + if (value === "") { + field.onChange(0); + } else { + const number = Number.parseInt(value, 10); + if (!Number.isNaN(number)) { + field.onChange(number); + } + } + }} + /> diff --git a/apps/dokploy/components/dashboard/settings/servers/update-server.tsx b/apps/dokploy/components/dashboard/settings/servers/update-server.tsx index 73eadd30d..16eb5ba7d 100644 --- a/apps/dokploy/components/dashboard/settings/servers/update-server.tsx +++ b/apps/dokploy/components/dashboard/settings/servers/update-server.tsx @@ -228,7 +228,21 @@ export const UpdateServer = ({ serverId }: Props) => { Port - + { + const value = e.target.value; + if (value === "") { + field.onChange(0); + } else { + const number = Number.parseInt(value, 10); + if (!Number.isNaN(number)) { + field.onChange(number); + } + } + }} + /> diff --git a/apps/dokploy/package.json b/apps/dokploy/package.json index f5b576354..7d5c28d31 100644 --- a/apps/dokploy/package.json +++ b/apps/dokploy/package.json @@ -1,6 +1,6 @@ { "name": "dokploy", - "version": "v0.9.1", + "version": "v0.9.2", "private": true, "license": "Apache-2.0", "type": "module",