feat: Move agent status (#2593)

* Move agent status

* Format
This commit is contained in:
Presley Pizzo
2022-06-23 10:18:56 -04:00
committed by GitHub
parent ac557e02b8
commit 65870e65ce
+2 -7
View File
@@ -21,7 +21,6 @@ const Language = {
resourceLabel: "Resource", resourceLabel: "Resource",
agentsLabel: "Agents", agentsLabel: "Agents",
agentLabel: "Agent", agentLabel: "Agent",
statusLabel: "Status",
accessLabel: "Access", accessLabel: "Access",
} }
@@ -57,7 +56,6 @@ export const Resources: FC<ResourcesProps> = ({ resources, getResourcesError, wo
</Stack> </Stack>
</TableCell> </TableCell>
{canUpdateWorkspace && <TableCell>{Language.accessLabel}</TableCell>} {canUpdateWorkspace && <TableCell>{Language.accessLabel}</TableCell>}
<TableCell>{Language.statusLabel}</TableCell>
</TableHeaderRow> </TableHeaderRow>
</TableHead> </TableHead>
<TableBody> <TableBody>
@@ -82,6 +80,7 @@ export const Resources: FC<ResourcesProps> = ({ resources, getResourcesError, wo
) )
} }
const agentStatus = getDisplayAgentStatus(theme, agent)
return ( return (
<TableRow key={`${resource.id}-${agent.id}`}> <TableRow key={`${resource.id}-${agent.id}`}>
{/* We only want to display the name in the first row because we are using rowSpan */} {/* We only want to display the name in the first row because we are using rowSpan */}
@@ -96,6 +95,7 @@ export const Resources: FC<ResourcesProps> = ({ resources, getResourcesError, wo
<TableCell className={styles.agentColumn}> <TableCell className={styles.agentColumn}>
{agent.name} {agent.name}
<span className={styles.operatingSystem}>{agent.operating_system}</span> <span className={styles.operatingSystem}>{agent.operating_system}</span>
<span style={{ color: agentStatus.color }}>{agentStatus.status}</span>
</TableCell> </TableCell>
{canUpdateWorkspace && ( {canUpdateWorkspace && (
<TableCell> <TableCell>
@@ -121,11 +121,6 @@ export const Resources: FC<ResourcesProps> = ({ resources, getResourcesError, wo
</Stack> </Stack>
</TableCell> </TableCell>
)} )}
<TableCell>
<span style={{ color: getDisplayAgentStatus(theme, agent).color }}>
{getDisplayAgentStatus(theme, agent).status}
</span>
</TableCell>
</TableRow> </TableRow>
) )
}) })