fix: When the storage backends usage is 0 displayed error as '-'

If the storage backends usage is 0, show the progress component

Change-Id: If5263eb27d3534c37002a97c498f72166d597af8
This commit is contained in:
zhangke
2022-10-24 13:38:30 +08:00
committed by Boxiang Zhu
parent 544f022a87
commit 87fa14b09d

View File

@@ -14,6 +14,7 @@
import React from 'react';
import Progress from 'components/Progress';
import { isNumber } from 'lodash';
export const poolColumns = [
{
@@ -34,7 +35,7 @@ export const poolColumns = [
dataIndex: 'usedGBPercent',
isHideable: true,
render: (value, record) =>
value ? (
isNumber(value) ? (
<Progress
value={value}
label={`${record.usedGB} / ${record.total_capacity_gb}`}
@@ -43,7 +44,7 @@ export const poolColumns = [
'-'
),
stringify: (value, record) =>
value
isNumber(value)
? `${value}% (${t('Used')}: ${record.usedGB} / ${t('Total')}: ${
record.total_capacity_gb
})`