ui: fix NAN% used memory for vm (#11307)

This commit is contained in:
Abhishek Kumar 2025-07-28 18:29:17 +05:30 committed by GitHub
parent 524f0d80db
commit d693736ee8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,8 +54,8 @@ export default {
const metricsFields = ['cpunumber', 'cputotal', 'cpuused', 'memorytotal',
{
memoryused: (record) => {
if (record.memoryintfreekbs <= 0 || record.memorykbs <= 0) {
return '-'
if (!record.memoryintfreekbs || record.memoryintfreekbs <= 0 || record.memorykbs <= 0) {
return ''
}
return parseFloat(100.0 * (record.memorykbs - record.memoryintfreekbs) / record.memorykbs).toFixed(2) + '%'
}