Skip to content

Commit bf6840f

Browse files
authored
Dashboard: Show CPU sku and hide count if GPU is empty (#1241)
1 parent 55227d3 commit bf6840f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/dashboard/src/pages/Submission/components/ClusterSelectField.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,16 @@ const ClusterSelectField: React.FC<ClusterSelectFieldProps & BaseTextFieldProps>
4747
if (!isEmpty(res)) {
4848
clusterName = (String)(Object.keys(res['gpu_capacity'])[0])
4949
}
50+
if (clusterName === 'undefined') {
51+
clusterName = (String)(Object.keys(res['cpu_capacity'])[0])
52+
}
5053
const gpuCapacity = isEmpty(res) ? 0 : (String)(sumValues(res['gpu_capacity']));
5154
const gpuAvailable = isEmpty(res) ? 0 : (String)(sumValues(res['gpu_avaliable']));
52-
setHelperText(`${clusterName} (${gpuAvailable} / ${gpuCapacity} to use)`);
55+
if (isEmpty(res['gpu_capacity'])) {
56+
setHelperText(`${clusterName}`);
57+
} else {
58+
setHelperText(`${clusterName} (${gpuAvailable} / ${gpuCapacity} to use)`);
59+
}
5360
})
5461
if (cluster) {
5562
onClusterChange(cluster);

0 commit comments

Comments
 (0)