From c7e576c8799fbc03e87adc3ecdb3c2c2ae0d73c7 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Thu, 10 Oct 2024 11:07:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A6=82=E8=A7=88=E9=A1=B5=E7=A3=81?= =?UTF-8?q?=E7=9B=98=E6=98=BE=E7=A4=BA=E6=8E=92=E9=99=A4=20overlay=20?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=20(#6672)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #6637 --- backend/app/service/dashboard.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/app/service/dashboard.go b/backend/app/service/dashboard.go index 45ef228b2..791c7eee4 100644 --- a/backend/app/service/dashboard.go +++ b/backend/app/service/dashboard.go @@ -3,10 +3,6 @@ package service import ( "encoding/json" "fmt" - "github.com/1Panel-dev/1Panel/backend/constant" - "github.com/shirou/gopsutil/v3/load" - "github.com/shirou/gopsutil/v3/mem" - "github.com/shirou/gopsutil/v3/net" network "net" "os" "sort" @@ -14,6 +10,11 @@ import ( "sync" "time" + "github.com/1Panel-dev/1Panel/backend/constant" + "github.com/shirou/gopsutil/v3/load" + "github.com/shirou/gopsutil/v3/mem" + "github.com/shirou/gopsutil/v3/net" + "github.com/1Panel-dev/1Panel/backend/app/dto" "github.com/1Panel-dev/1Panel/backend/global" "github.com/1Panel-dev/1Panel/backend/utils/cmd" @@ -268,13 +269,13 @@ func loadDiskInfo() []dto.DiskInfo { if strings.HasPrefix(fields[6], "/snap") || len(strings.Split(fields[6], "/")) > 10 { continue } - if strings.TrimSpace(fields[1]) == "tmpfs" { + if strings.TrimSpace(fields[1]) == "tmpfs" || strings.TrimSpace(fields[1]) == "overlay" { continue } if strings.Contains(fields[2], "K") { continue } - if strings.Contains(fields[6], "docker") { + if strings.Contains(fields[6], "docker") || strings.Contains(fields[6], "podman") || strings.Contains(fields[6], "containerd") || strings.HasPrefix(fields[6], "/var/lib/containers") { continue } isExclude := false