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

Commiteda8190

Browse files
feat: open app in tab or slim-window (#16152)
Closecoder/terraform-provider-coder#297
1 parente693b66 commiteda8190

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

‎site/src/modules/resources/AppLink/AppLink.tsx‎

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,13 @@ export const AppLink: FC<AppLinkProps> = ({ app, workspace, agent }) => {
129129
}
130130

131131
event.preventDefault();
132+
132133
// This is an external URI like "vscode://", so
133134
// it needs to be opened with the browser protocol handler.
134-
if(app.external&&!app.url.startsWith("http")){
135-
// If the protocol is external the browser does not
136-
// redirect the user from the page.
135+
constshouldOpenAppExternally=
136+
app.external&&!app.url.startsWith("http");
137137

138+
if(shouldOpenAppExternally){
138139
// This is a magic undocumented string that is replaced
139140
// with a brand-new session token from the backend.
140141
// This only exists for external URLs, and should only
@@ -149,12 +150,22 @@ export const AppLink: FC<AppLinkProps> = ({ app, workspace, agent }) => {
149150
setFetchingSessionToken(false);
150151
}
151152
window.location.href=url;
152-
}else{
153-
window.open(
154-
href,
155-
Language.appTitle(appDisplayName,generateRandomString(12)),
156-
"width=900,height=600",
157-
);
153+
return;
154+
}
155+
156+
switch(app.open_in){
157+
case"slim-window":{
158+
window.open(
159+
href,
160+
Language.appTitle(appDisplayName,generateRandomString(12)),
161+
"width=900,height=600",
162+
);
163+
return;
164+
}
165+
default:{
166+
window.open(href);
167+
return;
168+
}
158169
}
159170
}}
160171
>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp