From 3b83ecd85df28804084675ce89dcdf7140cce901 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Thu, 9 Mar 2023 17:15:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=A1=AC=E4=BB=B6?= =?UTF-8?q?=E4=BF=A1=E6=81=AFundefined?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TableFormatters/HostInfoFormatter.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/TableFormatters/HostInfoFormatter.vue b/src/components/TableFormatters/HostInfoFormatter.vue index 0f908992d..ec65169de 100644 --- a/src/components/TableFormatters/HostInfoFormatter.vue +++ b/src/components/TableFormatters/HostInfoFormatter.vue @@ -54,7 +54,14 @@ export default { const memory = this.items['memory'] const diskTotal = this.items['disk_total'] if (cpuCount) { - return `${cpuVcpus || cpuCores * cpuCount} Core ${memory}G ${diskTotal}G` + let text = `${cpuVcpus || cpuCores * cpuCount} Core` + if (memory) { + text += ` ${memory}G` + } + if (diskTotal) { + text += ` ${diskTotal}G` + } + return text } return '-' }