Add isolated read-only official widget integration and searchable catalog

This commit is contained in:
Pigway
2026-10-02 16:20:54 +08:00
parent bfef1ad28d
commit 59fbdf7c1a
13 changed files with 1144 additions and 7 deletions
+18
View File
@@ -390,3 +390,21 @@ class ImageURLConfig(StrictModel):
raise ValueError("Use hostnames only, without URLs or wildcards")
self.allowed_hosts = sorted(set(h.lower() for h in self.allowed_hosts))
return self
class Widget(StrictModel):
id: int
name: str
tags: list[str] = Field(default_factory=list)
arg_keys: list[str] = Field(default_factory=list)
class WidgetState(StrictModel):
source: Literal["live", "snapshot", "mock"]
configured: bool
status: str = "OK"
observed_at: str | None = None
catalog: list[Widget]
current: Widget | None = None
current_verified: bool = False
writable: Literal[False] = False