@@ -14,6 +14,7 @@ import { Tooltip, Button, theme, Space, ButtonProps } from 'antd';
1414import {
1515 BAIAppIcon ,
1616 BAIContainerCommitIcon ,
17+ BAIFileBrowserIcon ,
1718 BAIJupyterIcon ,
1819 BAISessionLogIcon ,
1920 BAISftpIcon ,
@@ -36,7 +37,7 @@ type SessionActionButtonKey =
3637 | 'terminate' ;
3738
3839export type PrimaryAppOption = {
39- appName : 'jupyter' ;
40+ appName : 'jupyter' | 'filebrowser' ;
4041 urlPostfix ?: string ;
4142} ;
4243
@@ -146,44 +147,87 @@ const SessionActionButtons: React.FC<SessionActionButtonsProps> = ({
146147 return session ? (
147148 < >
148149 < Wrapper compact = { compact } >
149- { primaryAppOption && primaryAppOption . appName === 'jupyter' && (
150- < Tooltip
151- title = {
152- isButtonTitleMode
153- ? undefined
154- : t ( 'session.ExecuteSpecificApp' , {
155- appName : 'Jupyter Notebook' ,
156- } )
157- }
158- >
159- < Button
160- size = { size }
161- type = { 'primary' }
162- disabled = {
163- ! isAppSupported ( session ) || ! isActive ( session ) || ! isOwner
164- }
165- icon = { < BAIJupyterIcon /> }
166- onClick = { ( ) => {
167- const appOption = {
168- 'app-name' : primaryAppOption . appName ,
169- 'session-uuid' : session ?. row_id ,
170- 'url-postfix' : primaryAppOption . urlPostfix ,
171- } ;
150+ { primaryAppOption && (
151+ < >
152+ { primaryAppOption . appName === 'jupyter' && (
153+ < Tooltip
154+ title = {
155+ isButtonTitleMode
156+ ? undefined
157+ : t ( 'session.ExecuteSpecificApp' , {
158+ appName : 'Jupyter Notebook' ,
159+ } )
160+ }
161+ >
162+ < Button
163+ size = { size }
164+ type = { 'primary' }
165+ disabled = {
166+ ! isAppSupported ( session ) || ! isActive ( session ) || ! isOwner
167+ }
168+ icon = { < BAIJupyterIcon /> }
169+ onClick = { ( ) => {
170+ const appOption = {
171+ 'app-name' : primaryAppOption . appName ,
172+ 'session-uuid' : session ?. row_id ,
173+ 'url-postfix' : primaryAppOption . urlPostfix ,
174+ } ;
172175
173- // @ts -ignore
174- globalThis . appLauncher . _runApp (
175- omitNullAndUndefinedFields ( appOption ) ,
176- ) ;
177- } }
178- title = {
179- isButtonTitleMode
180- ? t ( 'session.ExecuteSpecificApp' , {
181- appName : 'Jupyter Notebook' ,
182- } )
183- : undefined
184- }
185- />
186- </ Tooltip >
176+ // @ts -ignore
177+ globalThis . appLauncher . _runApp (
178+ omitNullAndUndefinedFields ( appOption ) ,
179+ ) ;
180+ } }
181+ title = {
182+ isButtonTitleMode
183+ ? t ( 'session.ExecuteSpecificApp' , {
184+ appName : 'Jupyter Notebook' ,
185+ } )
186+ : undefined
187+ }
188+ />
189+ </ Tooltip >
190+ ) }
191+ { primaryAppOption . appName === 'filebrowser' && (
192+ < Tooltip
193+ title = {
194+ isButtonTitleMode
195+ ? undefined
196+ : t ( 'session.ExecuteSpecificApp' , {
197+ appName : 'Jupyter Notebook' ,
198+ } )
199+ }
200+ >
201+ < Button
202+ size = { size }
203+ type = { 'primary' }
204+ disabled = {
205+ ! isAppSupported ( session ) || ! isActive ( session ) || ! isOwner
206+ }
207+ icon = { < BAIFileBrowserIcon /> }
208+ onClick = { ( ) => {
209+ const appOption = {
210+ 'app-name' : primaryAppOption . appName ,
211+ 'session-uuid' : session ?. row_id ,
212+ 'url-postfix' : primaryAppOption . urlPostfix ,
213+ } ;
214+
215+ // @ts -ignore
216+ globalThis . appLauncher . _runApp (
217+ omitNullAndUndefinedFields ( appOption ) ,
218+ ) ;
219+ } }
220+ title = {
221+ isButtonTitleMode
222+ ? t ( 'session.ExecuteSpecificApp' , {
223+ appName : 'File browser' ,
224+ } )
225+ : undefined
226+ }
227+ />
228+ </ Tooltip >
229+ ) }
230+ </ >
187231 ) }
188232 { isVisible ( 'appLauncher' ) && (
189233 < >
0 commit comments