feat: optimization disk zie display (#10339)

This commit is contained in:
CityFun 2025-09-11 15:12:45 +08:00 committed by GitHub
parent ef2fb1c62e
commit 4e1a7bf42c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -104,7 +104,7 @@ func parseLsblkOutput(output string) ([]response.DiskBasicInfo, error) {
if diskType == "lvm" {
total, used, avail, usePercent, _ := getDiskUsageInfo("/dev/mapper/" + name)
if total != "" {
if total != "" && fsType != "" {
size = total
}
@ -139,10 +139,17 @@ func parseLsblkOutput(output string) ([]response.DiskBasicInfo, error) {
tran := fields["TRAN"]
rota := fields["ROTA"]
totalSize, used, avail, usePercent, _ := getDiskUsageInfo("/dev/" + name)
if totalSize != "" && fsType != "" {
size = totalSize
var (
used, avail, totalSize string
usePercent int
)
if mountPoint != "" {
totalSize, used, avail, usePercent, _ = getDiskUsageInfo("/dev/" + name)
if totalSize != "" {
size = totalSize
}
}
actualMountPoint := mountPoint
actualFsType := fsType
actualUsed := used