mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2025-07-27 12:10:57 +00:00
🐛 hotfix: 移除状态卡片Linux下非储存分区
Some checks failed
Deploy VitePress site to Pages / build (push) Failing after 8m9s
Some checks failed
Deploy VitePress site to Pages / build (push) Failing after 8m9s
This commit is contained in:
@ -64,6 +64,8 @@ data
|
|||||||
- percent: float
|
- percent: float
|
||||||
- total: int
|
- total: int
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# status_card_cache = {} # lang -> bytes
|
# status_card_cache = {} # lang -> bytes
|
||||||
|
|
||||||
|
|
||||||
@ -269,7 +271,9 @@ async def get_hardware_data() -> dict:
|
|||||||
for disk in psutil.disk_partitions(all=True):
|
for disk in psutil.disk_partitions(all=True):
|
||||||
try:
|
try:
|
||||||
disk_usage = psutil.disk_usage(disk.mountpoint)
|
disk_usage = psutil.disk_usage(disk.mountpoint)
|
||||||
if disk_usage.total == 0:
|
if disk_usage.total == 0 or disk.mountpoint.startswith(
|
||||||
|
("/var", "/boot", "/run", "/proc", "/sys", "/dev", "/tmp", "/snap")
|
||||||
|
):
|
||||||
continue # 虚拟磁盘
|
continue # 虚拟磁盘
|
||||||
result["disk"].append(
|
result["disk"].append(
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user