From 71756812b6b55977fea7f275223583ea784c6c21 Mon Sep 17 00:00:00 2001 From: Owen Date: Fri, 29 May 2026 10:57:28 -0700 Subject: [PATCH] Adjusting the ui --- src/app/ssh/SshClient.tsx | 217 ++++++++++++++++++++++---------------- src/app/vnc/VncClient.tsx | 2 +- 2 files changed, 130 insertions(+), 89 deletions(-) diff --git a/src/app/ssh/SshClient.tsx b/src/app/ssh/SshClient.tsx index 47697397d..d822b890a 100644 --- a/src/app/ssh/SshClient.tsx +++ b/src/app/ssh/SshClient.tsx @@ -16,6 +16,10 @@ import { CardDescription } from "@app/components/ui/card"; import Link from "next/link"; +import { ExternalLink } from "lucide-react"; +import { cn } from "@app/lib/cn"; + +type AuthTab = "password" | "privateKey"; type FormState = { username: string; @@ -53,7 +57,7 @@ export default function SshClient({ return { username: "", password: "", privateKey: "" }; }); - const fileInputRef = useRef(null); + const [authTab, setAuthTab] = useState("password"); function handleKeyFile(e: React.ChangeEvent) { const file = e.target.files?.[0]; @@ -186,8 +190,11 @@ export default function SshClient({ } const username = override?.username ?? form.username; - const password = override?.password ?? form.password; - const privateKey = override?.privateKey ?? form.privateKey; + const password = + override?.password ?? (authTab === "password" ? form.password : ""); + const privateKey = + override?.privateKey ?? + (authTab === "privateKey" ? form.privateKey : ""); const certificate = override?.certificate; const proxyAddress = `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/gateway/ssh`; @@ -353,95 +360,125 @@ export default function SshClient({ Sign in to SSH - Enter your credentials to access xxxx + Enter credentials to access xxxx -
- - - setForm({ - ...form, - username: e.target.value - }) - } - placeholder="root" - /> - - - - setForm({ - ...form, - password: e.target.value - }) - } - placeholder={ - form.privateKey - ? "Optional with key auth" - : "" - } - /> - - - -