Add React frontend, ZFS pool mapping, and multi-stage Docker build

- Vite + React frontend with dark-themed dashboard, slot grid per
  enclosure, and SMART detail overlay
- ZFS pool membership via zpool status -P
- Multi-stage Dockerfile (Node build + Python runtime)
- Updated docker-compose with network_mode host and healthcheck
This commit is contained in:
2026-03-07 03:04:23 +00:00
parent e2bd413041
commit 7beead8cae
13 changed files with 554 additions and 6 deletions

View File

@@ -2,6 +2,7 @@ from fastapi import APIRouter, HTTPException
from models.schemas import DriveDetail
from services.smart import get_smart_data
from services.zfs import get_zfs_pool_map
router = APIRouter(prefix="/api/drives", tags=["drives"])
@@ -17,4 +18,7 @@ async def get_drive_detail(device: str):
if "error" in data:
raise HTTPException(status_code=502, detail=data["error"])
pool_map = await get_zfs_pool_map()
data["zfs_pool"] = pool_map.get(device)
return DriveDetail(**data)

View File

@@ -11,6 +11,7 @@ from models.schemas import (
)
from services.enclosure import discover_enclosures, list_slots
from services.smart import get_smart_data
from services.zfs import get_zfs_pool_map
logger = logging.getLogger(__name__)
@@ -21,6 +22,7 @@ router = APIRouter(prefix="/api/overview", tags=["overview"])
async def get_overview():
"""Aggregate view of all enclosures, slots, and drive health."""
enclosures_raw = discover_enclosures()
pool_map = await get_zfs_pool_map()
enc_results: list[EnclosureWithDrives] = []
total_drives = 0
@@ -74,6 +76,7 @@ async def get_overview():
smart_supported=sd.get("smart_supported", True),
temperature_c=sd.get("temperature_c"),
power_on_hours=sd.get("power_on_hours"),
zfs_pool=pool_map.get(sd["device"]),
)
elif s["populated"]:
total_drives += 1