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:
@@ -5,10 +5,7 @@ import {
|
|||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { ResourceBreakdownItem } from '../../apis/resource';
|
import { ResourceBreakdownItem } from '../../apis/resource';
|
||||||
import {
|
import { instanceTypeSeriesLabel } from '../../utils/format-instance-type';
|
||||||
cpuOnlyLabel,
|
|
||||||
instanceTypeSeriesLabel
|
|
||||||
} from '../../utils/format-instance-type';
|
|
||||||
import { parseRollup } from '../../utils/time-buckets';
|
import { parseRollup } from '../../utils/time-buckets';
|
||||||
|
|
||||||
type GroupKey = 'gpu_type' | 'instance' | 'user';
|
type GroupKey = 'gpu_type' | 'instance' | 'user';
|
||||||
@@ -95,7 +92,10 @@ const useInstancesColumns = (groupKey: GroupKey) => {
|
|||||||
ephemeralMib: row.ephemeral_mib,
|
ephemeralMib: row.ephemeral_mib,
|
||||||
persistentMib: row.persistent_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) }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user