From 766a2a0546b09ffd5ceec2b941c829b0df4846bd Mon Sep 17 00:00:00 2001 From: CityFun <31820853+zhengkunwang223@users.noreply.github.com> Date: Thu, 11 Sep 2025 11:46:16 +0800 Subject: [PATCH] feat: optimization disk zie display (#10337) --- agent/app/service/disk_utils.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/agent/app/service/disk_utils.go b/agent/app/service/disk_utils.go index 1399629e8..901334d2c 100644 --- a/agent/app/service/disk_utils.go +++ b/agent/app/service/disk_utils.go @@ -140,7 +140,7 @@ func parseLsblkOutput(output string) ([]response.DiskBasicInfo, error) { rota := fields["ROTA"] totalSize, used, avail, usePercent, _ := getDiskUsageInfo("/dev/" + name) - if totalSize != "" { + if totalSize != "" && fsType != "" { size = totalSize } actualMountPoint := mountPoint @@ -167,7 +167,7 @@ func parseLsblkOutput(output string) ([]response.DiskBasicInfo, error) { } } - diskInfo := response.DiskBasicInfo{ + info := response.DiskBasicInfo{ Device: name, Size: size, Model: model, @@ -183,7 +183,7 @@ func parseLsblkOutput(output string) ([]response.DiskBasicInfo, error) { Serial: serial, } - diskInfos = append(diskInfos, diskInfo) + diskInfos = append(diskInfos, info) } return diskInfos, nil