fix: Values in the hypervisor were not matched

Ironic node has no vcpu and memory usages data

Closes-Bug: #2040971
Change-Id: I918c1abdba059866ac86f53b5e7e2b7fbdfdfc98
This commit is contained in:
xusongfu 2023-10-26 15:01:25 +08:00
parent 91aa92b55a
commit af9f6b74cc

View File

@ -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'),