From 2e375c66031a8b8d59882d624f0aed0af462d438 Mon Sep 17 00:00:00 2001 From: michelia Date: Tue, 30 Jun 2026 12:08:43 +0800 Subject: [PATCH] fix(usage): label per-instance rows by shape, not an undefined title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Instances-tab Instance Type column passed isCpu ? cpuOnlyLabel : undefined. For a GPU row with vram but a missing/zero gpu_count, undefined let renderInstanceType fall back to "CPU Only" (acceleratable=false). Pass instanceTypeSeriesLabel(row) directly — consistent with the Instance Types column and robust to that edge. (PR #1245 review) --- .../instances-tab/tables/use-instances-columns.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/usage/instances-tab/tables/use-instances-columns.tsx b/src/pages/usage/instances-tab/tables/use-instances-columns.tsx index 3eeea14c..3c08b1e8 100644 --- a/src/pages/usage/instances-tab/tables/use-instances-columns.tsx +++ b/src/pages/usage/instances-tab/tables/use-instances-columns.tsx @@ -5,10 +5,7 @@ import { import { useIntl } from '@umijs/max'; import { useMemo } from 'react'; import { ResourceBreakdownItem } from '../../apis/resource'; -import { - cpuOnlyLabel, - instanceTypeSeriesLabel -} from '../../utils/format-instance-type'; +import { instanceTypeSeriesLabel } from '../../utils/format-instance-type'; import { parseRollup } from '../../utils/time-buckets'; type GroupKey = 'gpu_type' | 'instance' | 'user'; @@ -95,7 +92,10 @@ const useInstancesColumns = (groupKey: GroupKey) => { ephemeralMib: row.ephemeral_mib, persistentMib: row.persistent_mib }), - { intl, title: isCpu ? cpuOnlyLabel(row) : undefined } + // Label by shape directly (consistent with the Instance Types + // column); avoids renderInstanceType's "CPU Only" fallback when a + // GPU row has vram but a missing/zero gpu_count. + { intl, title: instanceTypeSeriesLabel(row) } ); } };