From af9f6b74cc18e9e785c959811ead0cd3d0599df9 Mon Sep 17 00:00:00 2001 From: xusongfu Date: Thu, 26 Oct 2023 15:01:25 +0800 Subject: [PATCH] fix: Values in the hypervisor were not matched Ironic node has no vcpu and memory usages data Closes-Bug: #2040971 Change-Id: I918c1abdba059866ac86f53b5e7e2b7fbdfdfc98 --- src/resources/nova/hypervisor.jsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/resources/nova/hypervisor.jsx b/src/resources/nova/hypervisor.jsx index ec4d9acf..f9059e0a 100644 --- a/src/resources/nova/hypervisor.jsx +++ b/src/resources/nova/hypervisor.jsx @@ -43,9 +43,11 @@ export const hypervisorColumns = [ ), width: 180, stringify: (value, record) => - `${value}% (${t('Used')}: ${record.vcpus_used} / ${t('Total')}: ${ - record.vcpus - })`, + record.hypervisor_type === 'ironic' + ? '-' + : `${value}% (${t('Used')}: ${record.vcpus_used} / ${t('Total')}: ${ + record.vcpus + })`, }, { title: t('Configured Memory (GiB)'), @@ -65,9 +67,11 @@ export const hypervisorColumns = [ ), width: 180, stringify: (value, record) => - `${value}% (${t('Used')}: ${record.memory_mb_used_gb} / ${t('Total')}: ${ - record.memory_mb_gb - })`, + record.hypervisor_type === 'ironic' + ? '-' + : `${value}% (${t('Used')}: ${record.memory_mb_used_gb} / ${t( + 'Total' + )}: ${record.memory_mb_gb})`, }, { title: t('Instances'),