@@ -7,8 +7,9 @@ import TableHead from "@material-ui/core/TableHead"
7
7
import TableRow from "@material-ui/core/TableRow"
8
8
import useTheme from "@material-ui/styles/useTheme"
9
9
import { ErrorSummary } from "components/ErrorSummary/ErrorSummary"
10
+ import { TableCellDataPrimary } from "components/TableCellData/TableCellData"
10
11
import { FC } from "react"
11
- import { getDisplayAgentStatus , getWorkspaceStatus , WorkspaceStateEnum } from "util/workspace"
12
+ import { getDisplayAgentStatus } from "util/workspace"
12
13
import { Workspace , WorkspaceResource } from "../../api/typesGenerated"
13
14
import { AppLink } from "../AppLink/AppLink"
14
15
import { SSHButton } from "../SSHButton/SSHButton"
@@ -24,6 +25,8 @@ const Language = {
24
25
resourceLabel : "Resource" ,
25
26
agentsLabel : "Agents" ,
26
27
agentLabel : "Agent" ,
28
+ statusLabel : "status: " ,
29
+ osLabel : "os: " ,
27
30
}
28
31
29
32
interface ResourcesProps {
@@ -42,10 +45,6 @@ export const Resources: FC<React.PropsWithChildren<ResourcesProps>> = ({
42
45
const styles = useStyles ( )
43
46
const theme : Theme = useTheme ( )
44
47
45
- const workspaceStatus : keyof typeof WorkspaceStateEnum = getWorkspaceStatus (
46
- workspace . latest_build ,
47
- )
48
-
49
48
return (
50
49
< div aria-label = { Language . resources } className = { styles . wrapper } >
51
50
{ getResourcesError ? (
@@ -103,21 +102,24 @@ export const Resources: FC<React.PropsWithChildren<ResourcesProps>> = ({
103
102
) }
104
103
105
104
< TableCell className = { styles . agentColumn } >
106
- { agent . name }
107
- < div className = { styles . agentInfo } >
108
- < span className = { styles . operatingSystem } > { agent . operating_system } </ span >
109
- { WorkspaceStateEnum [ workspaceStatus ] !==
110
- WorkspaceStateEnum [ "stopped" ] && (
105
+ < TableCellDataPrimary highlight > { agent . name } </ TableCellDataPrimary >
106
+ < div className = { styles . data } >
107
+ < div className = { styles . dataRow } >
108
+ < strong > { Language . statusLabel } </ strong >
111
109
< span style = { { color : agentStatus . color } } className = { styles . status } >
112
110
{ agentStatus . status }
113
111
</ span >
114
- ) }
112
+ </ div >
113
+ < div className = { styles . dataRow } >
114
+ < strong > { Language . osLabel } </ strong >
115
+ < span className = { styles . operatingSystem } > { agent . operating_system } </ span >
116
+ </ div >
115
117
</ div >
116
118
</ TableCell >
117
119
< TableCell >
118
- < >
120
+ < div className = { styles . accessLinks } >
119
121
{ canUpdateWorkspace && agent . status === "connected" && (
120
- < div className = { styles . accessLinks } >
122
+ < >
121
123
< SSHButton workspaceName = { workspace . name } agentName = { agent . name } />
122
124
< TerminalLink
123
125
workspaceName = { workspace . name }
@@ -134,9 +136,9 @@ export const Resources: FC<React.PropsWithChildren<ResourcesProps>> = ({
134
136
agentName = { agent . name }
135
137
/>
136
138
) ) }
137
- </ div >
139
+ </ >
138
140
) }
139
- </ >
141
+ </ div >
140
142
</ TableCell >
141
143
</ TableRow >
142
144
)
@@ -181,14 +183,6 @@ const useStyles = makeStyles((theme) => ({
181
183
paddingLeft : `${ theme . spacing ( 4 ) } px !important` ,
182
184
} ,
183
185
184
- agentInfo : {
185
- display : "flex" ,
186
- gap : theme . spacing ( 1.5 ) ,
187
- fontSize : 14 ,
188
- color : theme . palette . text . secondary ,
189
- marginTop : theme . spacing ( 0.5 ) ,
190
- } ,
191
-
192
186
operatingSystem : {
193
187
display : "block" ,
194
188
textTransform : "capitalize" ,
@@ -204,4 +198,23 @@ const useStyles = makeStyles((theme) => ({
204
198
status : {
205
199
whiteSpace : "nowrap" ,
206
200
} ,
201
+
202
+ data : {
203
+ color : theme . palette . text . secondary ,
204
+ fontSize : 14 ,
205
+ marginTop : theme . spacing ( 0.75 ) ,
206
+ display : "grid" ,
207
+ gridAutoFlow : "row" ,
208
+ whiteSpace : "nowrap" ,
209
+ gap : theme . spacing ( 0.75 ) ,
210
+ } ,
211
+
212
+ dataRow : {
213
+ display : "flex" ,
214
+ alignItems : "center" ,
215
+
216
+ "& strong" : {
217
+ marginRight : theme . spacing ( 1 ) ,
218
+ } ,
219
+ } ,
207
220
} ) )
0 commit comments