From 641f643d2dff3fcc5ec41f8b994e6fc979ab6c22 Mon Sep 17 00:00:00 2001 From: Owen Date: Mon, 8 Jun 2026 15:38:09 -0700 Subject: [PATCH] Prefil the port with the best guess port --- src/components/PrivateResourceForm.tsx | 34 +++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/src/components/PrivateResourceForm.tsx b/src/components/PrivateResourceForm.tsx index 9864e5e7c..4a786954c 100644 --- a/src/components/PrivateResourceForm.tsx +++ b/src/components/PrivateResourceForm.tsx @@ -570,7 +570,7 @@ export function PrivateResourceForm({ mode: "host", destination: "", alias: null, - destinationPort: 22, + destinationPort: null, scheme: "http", ssl: true, httpConfigSubdomain: null, @@ -1038,9 +1038,35 @@ export function PrivateResourceForm({ modeOptions } value={field.value} - onChange={ - field.onChange - } + onChange={( + newMode + ) => { + field.onChange( + newMode + ); + if ( + newMode === + "ssh" + ) { + form.setValue( + "destinationPort", + 22 + ); + } else if ( + newMode === + "http" + ) { + form.setValue( + "destinationPort", + 443 + ); + } else { + form.setValue( + "destinationPort", + null + ); + } + }} cols={2} />