- 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
79 lines
1.7 KiB
Python
79 lines
1.7 KiB
Python
from pydantic import BaseModel
|
|
|
|
|
|
class Enclosure(BaseModel):
|
|
id: str
|
|
sg_device: str | None = None
|
|
vendor: str
|
|
model: str
|
|
revision: str
|
|
total_slots: int
|
|
populated_slots: int
|
|
|
|
|
|
class SlotInfo(BaseModel):
|
|
slot: int
|
|
populated: bool
|
|
device: str | None = None
|
|
|
|
|
|
class DriveDetail(BaseModel):
|
|
device: str
|
|
model: str | None = None
|
|
serial: str | None = None
|
|
wwn: str | None = None
|
|
firmware: str | None = None
|
|
capacity_bytes: int | None = None
|
|
smart_healthy: bool | None = None
|
|
smart_supported: bool = True
|
|
temperature_c: int | None = None
|
|
power_on_hours: int | None = None
|
|
reallocated_sectors: int | None = None
|
|
pending_sectors: int | None = None
|
|
uncorrectable_errors: int | None = None
|
|
wear_leveling_percent: int | None = None
|
|
zfs_pool: str | None = None
|
|
smart_attributes: list[dict] = []
|
|
|
|
|
|
class DriveHealthSummary(BaseModel):
|
|
device: str
|
|
model: str | None = None
|
|
serial: str | None = None
|
|
smart_healthy: bool | None = None
|
|
smart_supported: bool = True
|
|
temperature_c: int | None = None
|
|
power_on_hours: int | None = None
|
|
zfs_pool: str | None = None
|
|
|
|
|
|
class SlotWithDrive(BaseModel):
|
|
slot: int
|
|
populated: bool
|
|
device: str | None = None
|
|
drive: DriveHealthSummary | None = None
|
|
|
|
|
|
class EnclosureWithDrives(BaseModel):
|
|
id: str
|
|
sg_device: str | None = None
|
|
vendor: str
|
|
model: str
|
|
revision: str
|
|
total_slots: int
|
|
populated_slots: int
|
|
slots: list[SlotWithDrive]
|
|
|
|
|
|
class Overview(BaseModel):
|
|
healthy: bool
|
|
drive_count: int
|
|
warning_count: int
|
|
error_count: int
|
|
enclosures: list[EnclosureWithDrives]
|
|
|
|
|
|
class HealthCheck(BaseModel):
|
|
status: str
|
|
tools: dict[str, bool]
|