@@ -37,6 +37,9 @@ import { PortForwardButton } from "./PortForwardButton";
37
37
import { SSHButton } from "./SSHButton/SSHButton" ;
38
38
import { TerminalLink } from "./TerminalLink/TerminalLink" ;
39
39
import { VSCodeDesktopButton } from "./VSCodeDesktopButton/VSCodeDesktopButton" ;
40
+ import { useQuery } from "react-query" ;
41
+ import { xrayScan } from "api/queries/integrations" ;
42
+ import { XRayScanAlert } from "./XRayScanAlert" ;
40
43
41
44
// Logs are stored as the Line interface to make rendering
42
45
// much more efficient. Instead of mapping objects each time, we're
@@ -74,6 +77,12 @@ export const AgentRow: FC<AgentRowProps> = ({
74
77
sshPrefix,
75
78
storybookLogs,
76
79
} ) => {
80
+ // XRay integration
81
+ const xrayScanQuery = useQuery (
82
+ xrayScan ( { workspaceId : workspace . id , agentId : agent . id } ) ,
83
+ ) ;
84
+
85
+ // Apps visibility
77
86
const hasAppsToDisplay = ! hideVSCodeDesktopButton || agent . apps . length > 0 ;
78
87
const shouldDisplayApps =
79
88
showApps &&
@@ -84,6 +93,7 @@ export const AgentRow: FC<AgentRowProps> = ({
84
93
agent . display_apps . includes ( "vscode_insiders" ) ;
85
94
const showVSCode = hasVSCodeApp && ! hideVSCodeDesktopButton ;
86
95
96
+ // Agent runtime logs
87
97
const logSourceByID = useMemo ( ( ) => {
88
98
const sources : { [ id : string ] : WorkspaceAgentLogSource } = { } ;
89
99
for ( const source of agent . log_sources ) {
@@ -216,6 +226,8 @@ export const AgentRow: FC<AgentRowProps> = ({
216
226
) }
217
227
</ header >
218
228
229
+ { xrayScanQuery . data && < XRayScanAlert scan = { xrayScanQuery . data } /> }
230
+
219
231
< div css = { styles . content } >
220
232
{ agent . status === "connected" && (
221
233
< section css = { styles . apps } >
@@ -276,7 +288,9 @@ export const AgentRow: FC<AgentRowProps> = ({
276
288
277
289
{ hasStartupFeatures && (
278
290
< section
279
- css = { ( theme ) => ( { borderTop : `1px solid ${ theme . palette . divider } ` } ) }
291
+ css = { ( theme ) => ( {
292
+ borderTop : `1px solid ${ theme . palette . divider } ` ,
293
+ } ) }
280
294
>
281
295
< Collapse in = { showLogs } >
282
296
< AutoSizer disableHeight >
@@ -571,6 +585,10 @@ const styles = {
571
585
flexWrap : "wrap" ,
572
586
lineHeight : "1.5" ,
573
587
588
+ "&:has(+ [role='alert'])" : {
589
+ paddingBottom : 16 ,
590
+ } ,
591
+
574
592
[ theme . breakpoints . down ( "md" ) ] : {
575
593
gap : 16 ,
576
594
} ,
0 commit comments