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

feat(site): allow opening web terminal to container#16797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 2 commits intomainfromcj/site/terminal-container-params
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletionssite/src/pages/TerminalPage/TerminalPage.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -55,6 +55,8 @@ const TerminalPage: FC = () => {
// a round-trip, and must be a UUIDv4.
const reconnectionToken = searchParams.get("reconnect") ?? uuidv4();
const command = searchParams.get("command") || undefined;
const containerName = searchParams.get("container") || undefined;
const containerUser = searchParams.get("container_user") || undefined;
// The workspace name is in the format:
// <workspace name>[.<agent name>]
const workspaceNameParts = params.workspace?.split(".");
Expand DownExpand Up@@ -234,6 +236,8 @@ const TerminalPage: FC = () => {
command,
terminal.rows,
terminal.cols,
containerName,
containerUser,
)
.then((url) => {
if (disposed) {
Expand DownExpand Up@@ -302,6 +306,8 @@ const TerminalPage: FC = () => {
workspace.error,
workspace.isLoading,
workspaceAgent,
containerName,
containerUser,
]);

return (
Expand Down
8 changes: 8 additions & 0 deletionssite/src/utils/terminal.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,13 +7,21 @@ export const terminalWebsocketUrl = async (
command: string | undefined,
height: number,
width: number,
containerName: string | undefined,
containerUser: string | undefined,
): Promise<string> => {
const query = new URLSearchParams({ reconnect });
if (command) {
query.set("command", command);
}
query.set("height", height.toString());
query.set("width", width.toString());
if (containerName) {
query.set("container", containerName);
}
if (containerName && containerUser) {
query.set("container_user", containerUser);
}

const url = new URL(baseUrl || `${location.protocol}//${location.host}`);
url.protocol = url.protocol === "https:" ? "wss:" : "ws:";
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp