Skip to content

Commit 4349acc

Browse files
authored
fix: cpu and ram columns fallback (#3211)
1 parent 8b56c5a commit 4349acc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/components/nodesColumns/columns.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,16 +236,12 @@ export function getCpuColumn<
236236
sortAccessor: ({PoolStats = []}) => Math.max(...PoolStats.map(({Usage}) => Number(Usage))),
237237
defaultOrder: DataTable.DESCENDING,
238238
render: ({row}) => {
239-
if (!row.PoolStats) {
240-
return EMPTY_DATA_PLACEHOLDER;
241-
}
242-
243239
let totalPoolUsage =
244240
isNumeric(row.CoresUsed) && isNumeric(row.CoresTotal)
245241
? row.CoresUsed / row.CoresTotal
246242
: undefined;
247243

248-
if (totalPoolUsage === undefined) {
244+
if (totalPoolUsage === undefined && row.PoolStats) {
249245
let totalThreadsCount = 0;
250246
totalPoolUsage = row.PoolStats.reduce((acc, pool) => {
251247
totalThreadsCount += Number(pool.Threads);
@@ -259,9 +255,10 @@ export function getCpuColumn<
259255
<CellWithPopover
260256
placement={['top', 'bottom']}
261257
fullWidth
258+
disabled={!row.PoolStats}
262259
content={
263260
<DefinitionList responsive>
264-
{row.PoolStats.map((pool) =>
261+
{row.PoolStats?.map((pool) =>
265262
isNumeric(pool.Usage) ? (
266263
<DefinitionList.Item key={pool.Name} name={pool.Name}>
267264
{formatPool('Usage', pool.Usage).value}

0 commit comments

Comments
 (0)