fix(usage): label instance_type trend series by product name
The grouped-trend legend used the raw group key, which for instance_type is the flavor slug (e.g. gpustack--generic-ln-x64-40c-160g--nvidia-a100-80g-4d). Prefer the enriched product name so the chart legend matches the GPU Instances list (#5700); falls back to the slug for legacy rows without dimension data.
This commit is contained in:
@@ -321,6 +321,13 @@ function flattenItem(
|
||||
if (dims.storage_type) flat.storage_type = dims.storage_type;
|
||||
if (dims.capacity_mib != null) flat.capacity_mib = dims.capacity_mib;
|
||||
}
|
||||
// For an instance_type grouped trend the series label (``group``) defaults to
|
||||
// the raw flavor slug; prefer the pretty product name so the chart legend
|
||||
// matches the GPU Instances list (#5700). Falls back to the slug for legacy
|
||||
// rows that predate dimension enrichment.
|
||||
if (groupBy === 'instance_type' && flat.product) {
|
||||
flat.group = flat.product;
|
||||
}
|
||||
return flat;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user