fix(usage): label per-instance rows by shape, not an undefined title

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)
This commit is contained in:
michelia
2026-06-30 14:11:39 +08:00
committed by jialin
parent 7d94c77c15
commit 2e375c6603
@@ -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) }
);
}
};