From 4d0e9f3c719634e7d76e8b439e8acb577b9810ec Mon Sep 17 00:00:00 2001 From: krfricke Date: Tue, 2 Jun 2020 23:00:59 +0200 Subject: [PATCH] [Dashboard] Sort IDLE workers to bottom in dashboard (#8708) * Sort IDLE workers to bottom in dashboard * Fixed linting error Co-authored-by: Kai Fricke --- .../src/pages/dashboard/node-info/NodeInfo.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/python/ray/dashboard/client/src/pages/dashboard/node-info/NodeInfo.tsx b/python/ray/dashboard/client/src/pages/dashboard/node-info/NodeInfo.tsx index 4be505752..7c8d88ecd 100644 --- a/python/ray/dashboard/client/src/pages/dashboard/node-info/NodeInfo.tsx +++ b/python/ray/dashboard/client/src/pages/dashboard/node-info/NodeInfo.tsx @@ -176,9 +176,19 @@ class NodeInfo extends React.Component< return ( - clusterWorkerPids.has(worker.pid.toString()), - )} + clusterWorkers={client.workers + .filter((worker) => + clusterWorkerPids.has(worker.pid.toString()), + ) + .sort((w1, w2) => { + if (w2.cmdline[0] === "ray::IDLE") { + return -1; + } + if (w1.cmdline[0] === "ray::IDLE") { + return 1; + } + return w1.pid < w2.pid ? -1 : 1; + })} node={client} raylet={ client.ip in rayletInfo.nodes