Don't unfold first node in dashboard unless there is only one node in the cluster (#28108)

fixes #28107

Also moves the Host / Cmd Line column to be the first column so nodes and workers can be more easily distinguished.
This commit is contained in:
Alan Guo 2022-08-31 19:05:24 -07:00 committed by GitHub
parent 213e24cafd
commit 91cacd6214
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -65,6 +65,9 @@ const NodeRow = ({ node, expanded, onExpandButtonClick }: NodeRowProps) => {
)}
</IconButton>
</TableCell>
<TableCell align="center">
<Box minWidth={TEXT_COL_MIN_WIDTH}>{hostname}</Box>
</TableCell>
<TableCell>
<StatusChip type="node" status={raylet.state} />
</TableCell>
@ -75,9 +78,6 @@ const NodeRow = ({ node, expanded, onExpandButtonClick }: NodeRowProps) => {
</Link>
</Tooltip>
</TableCell>
<TableCell align="center">
<Box minWidth={TEXT_COL_MIN_WIDTH}>{hostname}</Box>
</TableCell>
<TableCell align="center">
<Box minWidth={TEXT_COL_MIN_WIDTH}>{ip}</Box>
</TableCell>
@ -165,6 +165,7 @@ const WorkerRow = ({ node, worker }: WorkerRowProps) => {
<TableCell>
{/* Empty because workers do not have an expand / unexpand button. */}
</TableCell>
<TableCell align="center">{cmdline[0]}</TableCell>
<TableCell>
<StatusChip type="worker" status="ALIVE" />
</TableCell>
@ -175,7 +176,6 @@ const WorkerRow = ({ node, worker }: WorkerRowProps) => {
</Tooltip>
)}
</TableCell>
<TableCell align="center">{cmdline[0]}</TableCell>
<TableCell align="center">{pid}</TableCell>
<TableCell>
<PercentageBar num={Number(cpu)} total={100}>

View file

@ -36,9 +36,9 @@ const useStyles = makeStyles((theme) => ({
const columns = [
"", // Expand button
"Host / Cmd Line",
"State",
"ID",
"Host / Cmd Line",
"IP / PID",
"CPU Usage",
"Memory",
@ -283,7 +283,7 @@ const Nodes = () => {
key={node.raylet.nodeId}
node={node}
isRefreshing={isRefreshing}
startExpanded={i === 0}
startExpanded={nodeList.length === 1}
/>
))}
</TableBody>