Add header quick links with CRUD management and icon enhancements
- Add LinkConfig model and links field to settings - Add CRUD API endpoints for links (list/create/update/delete) - Add Links management tab in WebUI with add/edit/delete dialogs - Add live icon preview in Link and Script dialog forms - Show MDI icons inline in Quick Actions cards, Scripts table, Links table - Add broadcast_links_changed WebSocket event for live updates - Add EN/RU translations for all links management strings Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,14 @@ class ScriptConfig(BaseModel):
|
||||
shell: bool = Field(default=True, description="Run command in shell")
|
||||
|
||||
|
||||
class LinkConfig(BaseModel):
|
||||
"""Configuration for a header quick link."""
|
||||
|
||||
url: str = Field(..., description="URL to open")
|
||||
icon: str = Field(default="mdi:link", description="MDI icon name (e.g., 'mdi:led-strip-variant')")
|
||||
label: str = Field(default="", description="Tooltip text")
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""Application settings loaded from environment or config file."""
|
||||
|
||||
@@ -97,6 +105,12 @@ class Settings(BaseSettings):
|
||||
description='Thumbnail size: "small" (150x150), "medium" (300x300), or "both"',
|
||||
)
|
||||
|
||||
# Header quick links
|
||||
links: dict[str, LinkConfig] = Field(
|
||||
default_factory=dict,
|
||||
description="Quick links displayed as icons in the header",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def load_from_yaml(cls, path: Optional[Path] = None) -> "Settings":
|
||||
"""Load settings from a YAML configuration file."""
|
||||
|
||||
Reference in New Issue
Block a user