Add ZFS vdev exposure in API and frontend

This commit is contained in:
2026-03-07 04:14:14 +00:00
parent 10de5563b2
commit 3ef7061aa5
5 changed files with 65 additions and 9 deletions

View File

@@ -19,6 +19,9 @@ async def get_drive_detail(device: str):
raise HTTPException(status_code=502, detail=data["error"])
pool_map = await get_zfs_pool_map()
data["zfs_pool"] = pool_map.get(device)
zfs_info = pool_map.get(device)
if zfs_info:
data["zfs_pool"] = zfs_info["pool"]
data["zfs_vdev"] = zfs_info["vdev"]
return DriveDetail(**data)

View File

@@ -93,7 +93,8 @@ async def get_overview():
reallocated_sectors=sd.get("reallocated_sectors"),
pending_sectors=sd.get("pending_sectors"),
uncorrectable_errors=sd.get("uncorrectable_errors"),
zfs_pool=pool_map.get(sd["device"]),
zfs_pool=pool_map.get(sd["device"], {}).get("pool"),
zfs_vdev=pool_map.get(sd["device"], {}).get("vdev"),
health_status=health_status,
)
elif s["populated"]: