Merge pull request #2893 from jumpserver/pr@dev@hardware_show

fix: 修复硬件信息undefined
This commit is contained in:
feng626
2023-03-09 17:16:43 +08:00
committed by GitHub

View File

@@ -54,7 +54,14 @@ export default {
const memory = this.items['memory'] const memory = this.items['memory']
const diskTotal = this.items['disk_total'] const diskTotal = this.items['disk_total']
if (cpuCount) { 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 '-' return '-'
} }