mirror of
https://github.com/fankes/komari-agent.git
synced 2025-10-19 02:59:23 +08:00
feat: 优化 CPU 和磁盘信息获取,增强对 Server 版本的支持,改进终端关闭逻辑
This commit is contained in:
@@ -36,6 +36,10 @@ func Disk() DiskInfo {
|
||||
|
||||
// isPhysicalDisk 判断分区是否为物理磁盘
|
||||
func isPhysicalDisk(part disk.PartitionStat) bool {
|
||||
// 对于LXC等基于loop的根文件系统,始终包含根挂载点
|
||||
if part.Mountpoint == "/" {
|
||||
return true
|
||||
}
|
||||
mountpoint := strings.ToLower(part.Mountpoint)
|
||||
// 临时文件系统
|
||||
if mountpoint == "/tmp" || mountpoint == "/var/tmp" || mountpoint == "/dev/shm" ||
|
||||
|
Reference in New Issue
Block a user