From 2ca2b35546c0f3bc1726630dba6ab5066dec6fb9 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Thu, 4 Jan 2024 15:36:47 -0600 Subject: [PATCH 1/2] fix: workspace proxy command app link href --- site/src/utils/apps.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/site/src/utils/apps.ts b/site/src/utils/apps.ts index 6021f2ffebb52..b412984172f97 100644 --- a/site/src/utils/apps.ts +++ b/site/src/utils/apps.ts @@ -20,7 +20,10 @@ export const createAppLinkHref = ( agent.name }/apps/${encodeURIComponent(appSlug)}/`; if (app.command) { - href = `${preferredPathBase}/@${username}/${workspace.name}.${ + // Terminal links are relative. The terminal page knows how + // to select the correct workspace proxy for the websocket + // connection. + href = `/@${username}/${workspace.name}.${ agent.name }/terminal?command=${encodeURIComponent(app.command)}`; } From bc5e4d3baf009eebcfd0a4e9b3f6d1ab308529a0 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Thu, 4 Jan 2024 18:37:05 -0600 Subject: [PATCH 2/2] fix js test --- site/src/utils/apps.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/utils/apps.test.ts b/site/src/utils/apps.test.ts index 9e188efb2af35..9223668f65c8e 100644 --- a/site/src/utils/apps.test.ts +++ b/site/src/utils/apps.test.ts @@ -59,7 +59,7 @@ describe("create app link", () => { }, ); expect(href).toBe( - "/path-base/@username/Test-Workspace.a-workspace-agent/terminal?command=ls%20-la", + "/@username/Test-Workspace.a-workspace-agent/terminal?command=ls%20-la", ); });