Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite9f8822

Browse files
feat(site): allow opening web terminal to container (#16797)
Co-authored-by: BrunoQuaresma <bruno_nonato_quaresma@hotmail.com>
1 parentd8561a6 commite9f8822

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎site/src/pages/TerminalPage/TerminalPage.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ const TerminalPage: FC = () => {
5555
// a round-trip, and must be a UUIDv4.
5656
constreconnectionToken=searchParams.get("reconnect")??uuidv4();
5757
constcommand=searchParams.get("command")||undefined;
58+
constcontainerName=searchParams.get("container")||undefined;
59+
constcontainerUser=searchParams.get("container_user")||undefined;
5860
// The workspace name is in the format:
5961
// <workspace name>[.<agent name>]
6062
constworkspaceNameParts=params.workspace?.split(".");
@@ -234,6 +236,8 @@ const TerminalPage: FC = () => {
234236
command,
235237
terminal.rows,
236238
terminal.cols,
239+
containerName,
240+
containerUser,
237241
)
238242
.then((url)=>{
239243
if(disposed){
@@ -302,6 +306,8 @@ const TerminalPage: FC = () => {
302306
workspace.error,
303307
workspace.isLoading,
304308
workspaceAgent,
309+
containerName,
310+
containerUser,
305311
]);
306312

307313
return(

‎site/src/utils/terminal.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,21 @@ export const terminalWebsocketUrl = async (
77
command:string|undefined,
88
height:number,
99
width:number,
10+
containerName:string|undefined,
11+
containerUser:string|undefined,
1012
):Promise<string>=>{
1113
constquery=newURLSearchParams({ reconnect});
1214
if(command){
1315
query.set("command",command);
1416
}
1517
query.set("height",height.toString());
1618
query.set("width",width.toString());
19+
if(containerName){
20+
query.set("container",containerName);
21+
}
22+
if(containerName&&containerUser){
23+
query.set("container_user",containerUser);
24+
}
1725

1826
consturl=newURL(baseUrl||`${location.protocol}//${location.host}`);
1927
url.protocol=url.protocol==="https:" ?"wss:" :"ws:";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp