From 87fa14b09d7f33e03b49c815b8a3b29a7fcd871e Mon Sep 17 00:00:00 2001 From: zhangke Date: Mon, 24 Oct 2022 13:38:30 +0800 Subject: [PATCH] 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 --- src/resources/cinder/cinder-pool.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/resources/cinder/cinder-pool.jsx b/src/resources/cinder/cinder-pool.jsx index 8d8a6688..1fa8bc43 100644 --- a/src/resources/cinder/cinder-pool.jsx +++ b/src/resources/cinder/cinder-pool.jsx @@ -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) ? ( - value + isNumber(value) ? `${value}% (${t('Used')}: ${record.usedGB} / ${t('Total')}: ${ record.total_capacity_gb })`