From 9bb2d6cdc814e2e6cd3f0d43224cba703ae6c325 Mon Sep 17 00:00:00 2001 From: Owen Date: Tue, 30 Jun 2026 12:16:37 -0400 Subject: [PATCH] Prompt for the username on vnc --- messages/en-US.json | 3 ++- src/app/vnc/VncClient.tsx | 29 +++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/messages/en-US.json b/messages/en-US.json index 388e34015..41937e61e 100644 --- a/messages/en-US.json +++ b/messages/en-US.json @@ -3587,7 +3587,8 @@ "sshPrivateKeyPlaceholder": "-----BEGIN OPENSSH PRIVATE KEY-----", "sshPrivateKeyRequired": "Private key is required", "vncTitle": "VNC", - "vncSignInDescription": "Enter your VNC password to connect", + "vncSignInDescription": "Enter your VNC credentials to connect", + "vncUsernameOptional": "Username (optional)", "vncPasswordOptional": "Password (optional)", "vncNoResourceTarget": "No resource target is available", "vncFailedToLoadNovnc": "Failed to load noVNC", diff --git a/src/app/vnc/VncClient.tsx b/src/app/vnc/VncClient.tsx index b44ab9168..b549cc547 100644 --- a/src/app/vnc/VncClient.tsx +++ b/src/app/vnc/VncClient.tsx @@ -37,10 +37,12 @@ import { createApiClient } from "@app/lib/api"; import { useEnvContext } from "@app/hooks/useEnvContext"; type VncCredentialsForm = { + username: string; password: string; }; const DEFAULT_VNC_CREDENTIALS: VncCredentialsForm = { + username: "", password: "" }; @@ -59,6 +61,7 @@ export default function VncClient({ const resourceName = target?.name?.trim() || null; const formSchema = z.object({ + username: z.string(), password: z.string() }); @@ -168,8 +171,11 @@ export default function VncClient({ screenRef.current.innerHTML = ""; const options: Record = {}; - if (values.password) { - options.credentials = { password: values.password }; + if (values.username || values.password) { + options.credentials = { + username: values.username, + password: values.password + }; } let rfb: any; @@ -292,6 +298,25 @@ export default function VncClient({ onSubmit={form.handleSubmit(onSubmit)} className="space-y-4" > + ( + + + {t("vncUsernameOptional")} + + + + + + + )} + />