@@ -83,9 +83,9 @@ export const AgentRow: FC<AgentRowProps> = ({
83
83
const [ startupScriptOpen , setStartupScriptOpen ] = useState ( false )
84
84
85
85
const hasStartupFeatures =
86
- Boolean ( agent . startup_script ) ||
87
86
Boolean ( agent . startup_logs_length ) ||
88
87
Boolean ( logsMachine . context . startupLogs ?. length )
88
+
89
89
const [ showStartupLogs , setShowStartupLogs ] = useState (
90
90
agent . lifecycle_state !== "ready" && hasStartupFeatures ,
91
91
)
@@ -205,13 +205,13 @@ export const AgentRow: FC<AgentRowProps> = ({
205
205
</ Maybe >
206
206
</ Stack >
207
207
208
- < Stack
209
- direction = "row"
210
- alignItems = "baseline "
211
- spacing = { 1 }
212
- className = { styles . startupLinks }
213
- >
214
- { hasStartupFeatures && (
208
+ { hasStartupFeatures && (
209
+ < Stack
210
+ direction = "row "
211
+ alignItems = "baseline"
212
+ spacing = { 1 }
213
+ className = { styles . startupLinks }
214
+ >
215
215
< Link
216
216
className = { styles . startupLink }
217
217
variant = "body2"
@@ -226,57 +226,57 @@ export const AgentRow: FC<AgentRowProps> = ({
226
226
) }
227
227
{ showStartupLogs ? "Hide" : "Show" } Startup Logs
228
228
</ Link >
229
- ) }
230
-
231
- { agent . startup_script && (
232
- < Link
233
- className = { styles . startupLink }
234
- variant = "body2"
235
- ref = { startupScriptAnchorRef }
236
- onClick = { ( ) => {
237
- setStartupScriptOpen ( ! startupScriptOpen )
238
- } }
239
- >
240
- < PlayCircleOutlined />
241
- View Startup Script
242
- </ Link >
243
- ) }
244
229
245
- < Popover
246
- classes = { {
247
- paper : styles . startupScriptPopover ,
248
- } }
249
- open = { startupScriptOpen }
250
- onClose = { ( ) => setStartupScriptOpen ( false ) }
251
- anchorEl = { startupScriptAnchorRef . current }
252
- anchorOrigin = { {
253
- vertical : "bottom" ,
254
- horizontal : "left" ,
255
- } }
256
- transformOrigin = { {
257
- vertical : "top" ,
258
- horizontal : "left" ,
259
- } }
260
- >
261
- < div >
262
- < SyntaxHighlighter
263
- style = { darcula }
264
- language = "shell"
265
- showLineNumbers
266
- // Use inline styles does not work correctly
267
- // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/329
268
- codeTagProps = { { style : { } } }
269
- customStyle = { {
270
- background : theme . palette . background . default ,
271
- maxWidth : 600 ,
272
- margin : 0 ,
230
+ { agent . startup_script && (
231
+ < Link
232
+ className = { styles . startupLink }
233
+ variant = "body2"
234
+ ref = { startupScriptAnchorRef }
235
+ onClick = { ( ) => {
236
+ setStartupScriptOpen ( ! startupScriptOpen )
273
237
} }
274
238
>
275
- { agent . startup_script || "" }
276
- </ SyntaxHighlighter >
277
- </ div >
278
- </ Popover >
279
- </ Stack >
239
+ < PlayCircleOutlined />
240
+ View Startup Script
241
+ </ Link >
242
+ ) }
243
+
244
+ < Popover
245
+ classes = { {
246
+ paper : styles . startupScriptPopover ,
247
+ } }
248
+ open = { startupScriptOpen }
249
+ onClose = { ( ) => setStartupScriptOpen ( false ) }
250
+ anchorEl = { startupScriptAnchorRef . current }
251
+ anchorOrigin = { {
252
+ vertical : "bottom" ,
253
+ horizontal : "left" ,
254
+ } }
255
+ transformOrigin = { {
256
+ vertical : "top" ,
257
+ horizontal : "left" ,
258
+ } }
259
+ >
260
+ < div >
261
+ < SyntaxHighlighter
262
+ style = { darcula }
263
+ language = "shell"
264
+ showLineNumbers
265
+ // Use inline styles does not work correctly
266
+ // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/329
267
+ codeTagProps = { { style : { } } }
268
+ customStyle = { {
269
+ background : theme . palette . background . default ,
270
+ maxWidth : 600 ,
271
+ margin : 0 ,
272
+ } }
273
+ >
274
+ { agent . startup_script || "" }
275
+ </ SyntaxHighlighter >
276
+ </ div >
277
+ </ Popover >
278
+ </ Stack >
279
+ ) }
280
280
</ div >
281
281
</ Stack >
282
282
0 commit comments