1
- import Popover from "@mui/material/Popover"
2
- import { makeStyles , useTheme } from "@mui/styles"
1
+ import Collapse from "@mui/material/Collapse"
3
2
import Skeleton from "@mui/material/Skeleton"
3
+ import { makeStyles } from "@mui/styles"
4
4
import { useMachine } from "@xstate/react"
5
- import CodeOutlined from "@mui/icons-material/CodeOutlined"
6
5
import {
7
6
CloseDropdown ,
8
7
OpenDropdown ,
9
8
} from "components/DropdownArrows/DropdownArrows"
10
9
import { LogLine , logLineHeight } from "components/Logs/Logs"
11
- import { PortForwardButton } from "./PortForwardButton"
12
10
import { VSCodeDesktopButton } from "components/VSCodeDesktopButton/VSCodeDesktopButton"
11
+ import { useProxy } from "contexts/ProxyContext"
13
12
import {
14
13
FC ,
15
14
useCallback ,
@@ -19,8 +18,6 @@ import {
19
18
useRef ,
20
19
useState ,
21
20
} from "react"
22
- import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"
23
- import { darcula } from "react-syntax-highlighter/dist/cjs/styles/prism"
24
21
import AutoSizer from "react-virtualized-auto-sizer"
25
22
import { FixedSizeList as List , ListOnScrollProps } from "react-window"
26
23
import { colors } from "theme/colors"
@@ -40,10 +37,9 @@ import { Stack } from "../Stack/Stack"
40
37
import { TerminalLink } from "../TerminalLink/TerminalLink"
41
38
import { AgentLatency } from "./AgentLatency"
42
39
import { AgentMetadata } from "./AgentMetadata"
43
- import { AgentVersion } from "./AgentVersion"
44
40
import { AgentStatus } from "./AgentStatus"
45
- import Collapse from "@mui/material/Collapse "
46
- import { useProxy } from "contexts/ProxyContext "
41
+ import { AgentVersion } from "./AgentVersion "
42
+ import { PortForwardButton } from "./PortForwardButton "
47
43
48
44
export interface AgentRowProps {
49
45
agent : WorkspaceAgent
@@ -86,9 +82,6 @@ export const AgentRow: FC<AgentRowProps> = ({
86
82
}
87
83
: undefined ,
88
84
} )
89
- const theme = useTheme ( )
90
- const startupScriptAnchorRef = useRef < HTMLButtonElement > ( null )
91
- const [ startupScriptOpen , setStartupScriptOpen ] = useState ( false )
92
85
const hasAppsToDisplay = ! hideVSCodeDesktopButton || agent . apps . length > 0
93
86
const shouldDisplayApps =
94
87
showApps &&
@@ -132,6 +125,7 @@ export const AgentRow: FC<AgentRowProps> = ({
132
125
level : "error" ,
133
126
output : "Startup logs exceeded the max size of 1MB!" ,
134
127
time : new Date ( ) . toISOString ( ) ,
128
+ source_id : "" ,
135
129
} )
136
130
}
137
131
return logs
@@ -348,47 +342,6 @@ export const AgentRow: FC<AgentRowProps> = ({
348
342
Show startup logs
349
343
</ button >
350
344
) }
351
-
352
- < button
353
- className = { combineClasses ( [
354
- styles . logsPanelButton ,
355
- styles . scriptButton ,
356
- ] ) }
357
- ref = { startupScriptAnchorRef }
358
- onClick = { ( ) => {
359
- setStartupScriptOpen ( ! startupScriptOpen )
360
- } }
361
- >
362
- < CodeOutlined />
363
- Startup script
364
- </ button >
365
-
366
- < Popover
367
- classes = { {
368
- paper : styles . startupScriptPopover ,
369
- } }
370
- open = { startupScriptOpen }
371
- onClose = { ( ) => setStartupScriptOpen ( false ) }
372
- anchorEl = { startupScriptAnchorRef . current }
373
- >
374
- < div >
375
- < SyntaxHighlighter
376
- style = { darcula }
377
- language = "shell"
378
- showLineNumbers
379
- // Use inline styles does not work correctly
380
- // https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/329
381
- codeTagProps = { { style : { } } }
382
- customStyle = { {
383
- background : theme . palette . background . default ,
384
- maxWidth : 600 ,
385
- margin : 0 ,
386
- } }
387
- >
388
- { agent . startup_script || "" }
389
- </ SyntaxHighlighter >
390
- </ div >
391
- </ Popover >
392
345
</ div >
393
346
</ div >
394
347
) }
@@ -510,10 +463,6 @@ const useStyles = makeStyles((theme) => ({
510
463
} ,
511
464
} ,
512
465
513
- startupScriptPopover : {
514
- backgroundColor : theme . palette . background . default ,
515
- } ,
516
-
517
466
agentNameAndStatus : {
518
467
display : "flex" ,
519
468
alignItems : "center" ,
@@ -602,13 +551,6 @@ const useStyles = makeStyles((theme) => ({
602
551
color : theme . palette . warning . light ,
603
552
} ,
604
553
605
- scriptButton : {
606
- "& svg" : {
607
- width : theme . spacing ( 2 ) ,
608
- height : theme . spacing ( 2 ) ,
609
- } ,
610
- } ,
611
-
612
554
agentOS : {
613
555
textTransform : "capitalize" ,
614
556
} ,
0 commit comments