feat: add ImmichSnapshot, BackrestSnapshot, extend HA/UptimeKuma models
This commit is contained in:
@@ -39,31 +39,30 @@ class BeszelSystemSnapshot(APIModel):
|
||||
disks: list[BeszelDiskMetric] = Field(default_factory=list)
|
||||
|
||||
|
||||
class DockerContainerSummary(APIModel):
|
||||
class DockerContainer(APIModel):
|
||||
id: str
|
||||
name: str
|
||||
state: DockerContainerState
|
||||
status_text: str
|
||||
image: str
|
||||
health: str | None = None
|
||||
state: DockerContainerState
|
||||
status: str
|
||||
|
||||
|
||||
class DockerSnapshot(APIModel):
|
||||
source_name: str = "docker"
|
||||
source_status: SourceStatus = "offline"
|
||||
containers: list[DockerContainer] = Field(default_factory=list)
|
||||
running: int = 0
|
||||
stopped: int = 0
|
||||
unhealthy: int = 0
|
||||
total: int = 0
|
||||
containers: list[DockerContainerSummary] = Field(default_factory=list)
|
||||
|
||||
|
||||
class UptimeKumaMonitor(APIModel):
|
||||
id: str
|
||||
id: int
|
||||
name: str
|
||||
status: OverallStatus
|
||||
latency_ms: int | None = None
|
||||
monitor_type: str | None = None
|
||||
status: str = "unknown" # "online" | "offline" | "degraded" | "unknown"
|
||||
uptime_24h: float = 0.0
|
||||
heartbeats: list[int] = Field(default_factory=list) # 1=up, 0=down, last 20
|
||||
|
||||
|
||||
class UptimeKumaSnapshot(APIModel):
|
||||
@@ -83,6 +82,11 @@ class HomeAssistantSnapshot(APIModel):
|
||||
version: str | None = None
|
||||
response_time_ms: int | None = None
|
||||
last_checked: datetime | None = None
|
||||
lights_on: int = 0
|
||||
lights_total: int = 0
|
||||
climate_active: int = 0
|
||||
doors_open: int = 0
|
||||
alerts: int = 0
|
||||
|
||||
|
||||
class AdGuardSnapshot(APIModel):
|
||||
@@ -98,6 +102,7 @@ class ScrutinyDevice(APIModel):
|
||||
name: str
|
||||
model: str
|
||||
status: str = "unknown" # "passed" | "failed" | "unknown"
|
||||
temperature: int | None = None
|
||||
|
||||
|
||||
class ScrutinySnapshot(APIModel):
|
||||
@@ -107,3 +112,20 @@ class ScrutinySnapshot(APIModel):
|
||||
devices: list[ScrutinyDevice] = Field(default_factory=list)
|
||||
failed_count: int = 0
|
||||
total_count: int = 0
|
||||
|
||||
|
||||
class ImmichSnapshot(APIModel):
|
||||
source_name: str = "immich"
|
||||
source_status: SourceStatus = "offline"
|
||||
photos: int = 0
|
||||
videos: int = 0
|
||||
storage_gb: float = 0.0
|
||||
|
||||
|
||||
class BackrestSnapshot(APIModel):
|
||||
source_name: str = "backrest"
|
||||
source_status: SourceStatus = "offline"
|
||||
repo_count: int = 0
|
||||
last_backup_age_hours: float | None = None
|
||||
last_backup_status: str = "unknown" # "ok" | "error" | "unknown"
|
||||
error_count: int = 0
|
||||
|
||||
Reference in New Issue
Block a user