From 4b4c86b4b72b48fb541fa21348d817a79e8179f9 Mon Sep 17 00:00:00 2001 From: Owen Date: Wed, 13 May 2026 21:16:00 -0700 Subject: [PATCH] Clean up forms a bit --- src/app/rdp/RdpClient.tsx | 24 ++--------------- src/app/ssh/SshClient.tsx | 57 ++++----------------------------------- src/app/vnc/VncClient.tsx | 33 ++++------------------- 3 files changed, 12 insertions(+), 102 deletions(-) diff --git a/src/app/rdp/RdpClient.tsx b/src/app/rdp/RdpClient.tsx index cedcd5282..57be5f919 100644 --- a/src/app/rdp/RdpClient.tsx +++ b/src/app/rdp/RdpClient.tsx @@ -37,7 +37,6 @@ type FormState = { password: string; hostname: string; domain: string; - authtoken: string; kdcProxyUrl: string; pcb: string; desktopWidth: number; @@ -60,7 +59,6 @@ export default function RdpClient() { password: "Password123!", hostname: "172.31.3.58:3389", domain: "", - authtoken: "pangolin-browser-gateway-dev", kdcProxyUrl: "", pcb: "", desktopWidth: 1280, @@ -159,16 +157,6 @@ export default function RdpClient() { return; } - if (form.authtoken === "") { - toast({ - variant: "destructive", - title: "Missing auth token", - description: - "An auth token is required to connect through the gateway" - }); - return; - } - toast({ title: "Connecting...", description: "Connection in progress" @@ -235,7 +223,7 @@ export default function RdpClient() { `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/gateway/rdp` ) .withServerDomain(form.domain) - .withAuthToken(form.authtoken) + .withAuthToken("test-token") .withDesktopSize({ width: form.desktopWidth, height: form.desktopHeight @@ -341,15 +329,7 @@ export default function RdpClient() { } /> - {/* - - update("authtoken", e.target.value) - } - /> - + {/* ({ - gatewayAddress: "ws://localhost:7171/jet/ssh", hostname: "", port: "22", username: "", - password: "", - authToken: "abc123" + password: "" }); const [connected, setConnected] = useState(false); @@ -122,7 +118,8 @@ export default function SshClient() { setError(null); setConnecting(true); - const url = new URL(form.gatewayAddress); + const proxyAddress = `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/gateway/ssh`; + const url = new URL(proxyAddress); // Pass connection parameters as query params so the proxy can route // before any application-level framing is needed. url.searchParams.set("host", form.hostname); @@ -130,7 +127,7 @@ export default function SshClient() { url.searchParams.set("username", form.username); // Auth token is sent as a query param; the proxy validates it before // forwarding any data. - url.searchParams.set("authToken", form.authToken); + url.searchParams.set("authToken", "test-token"); const ws = new WebSocket(url.toString(), ["ssh"]); wsRef.current = ws; @@ -195,27 +192,6 @@ export default function SshClient() { {!connected && (
-
- - - setForm({ - ...form, - gatewayAddress: e.target.value - }) - } - placeholder="ws://localhost:7171/jet/ssh" - className="bg-neutral-800 border-neutral-700 text-white" - /> -
-
- -
- - - setForm({ - ...form, - authToken: e.target.value - }) - } - className="bg-neutral-800 border-neutral-700 text-white" - /> -
{error &&

{error}

} @@ -320,10 +276,7 @@ export default function SshClient() {