feat: 更新主题配置与系统设置
This commit is contained in:
1 parent
1555d5344b
commit
151ecceb85
12 files changed
+145
-27
No files matched your search
@@ -1009,7 +1009,10 @@ When using `make dev` from root, the frontend automatically connects through ngi
|
||||
the built-in default theme. A row is `CustomThemePreset` (`id`, `name`,
|
||||
six-digit `primary`, optional primary-button `text_color`, `mode`, `overrides`, `enabled`,
|
||||
`sort_order`). `overrides` is intentionally a short interaction-only list:
|
||||
`button_hover`, `selected_background`, `border`, `muted`, `muted_text`, `destructive`, `brand_title`, and `primary_foreground`.
|
||||
`button_hover`, `navigation_gradient_start`, `navigation_gradient_end`,
|
||||
`selected_background`, `border`, `muted`, `muted_text`, `destructive`,
|
||||
`brand_title`, and `primary_foreground`. The navigation gradient endpoints
|
||||
default from `primary` and are only stored when an administrator overrides them.
|
||||
All values must be six-digit hex strings; the frontend derives every remaining
|
||||
semantic CSS/TDesign token so admins do not maintain a full raw token sheet.
|
||||
Ids must be `custom-theme-*`, names and ids are unique, and the router limits
|
||||
|
||||
@@ -422,8 +422,11 @@ themes through `PUT /api/system-settings/appearance`. Each theme stores a
|
||||
safe six-digit `primary` colour, an optional primary-button `text_color`,
|
||||
`light`/`dark` mode, name, enabled flag and sort order. The frontend derives
|
||||
the rest of the visual tokens; the optional `overrides` object only exposes
|
||||
eight interaction colours (`button_hover`, `selected_background`, `border`,
|
||||
`muted`, `muted_text`, `destructive`, `brand_title`, `primary_foreground`) for exceptional brand requirements. A custom theme id
|
||||
ten interaction colours (`button_hover`, `navigation_gradient_start`,
|
||||
`navigation_gradient_end`, `selected_background`, `border`, `muted`,
|
||||
`muted_text`, `destructive`, `brand_title`, `primary_foreground`) for
|
||||
exceptional brand requirements. The two navigation values override the
|
||||
automatically derived top-bar gradient. A custom theme id
|
||||
must use the `custom-theme-` prefix. Disabled or removed custom themes cannot
|
||||
remain the system default and automatically fall back to `light`.
|
||||
|
||||
|
||||
@@ -57,6 +57,14 @@ class CustomThemeColorOverrides(BaseModel):
|
||||
"""
|
||||
|
||||
button_hover: str | None = Field(default=None, description="Primary button hover colour")
|
||||
navigation_gradient_start: str | None = Field(
|
||||
default=None,
|
||||
description="Left colour for the configurable top-navigation gradient",
|
||||
)
|
||||
navigation_gradient_end: str | None = Field(
|
||||
default=None,
|
||||
description="Right colour for the configurable top-navigation gradient",
|
||||
)
|
||||
selected_background: str | None = Field(default=None, description="Selected/active item background")
|
||||
border: str | None = Field(default=None, description="Card and input border colour")
|
||||
muted: str | None = Field(default=None, description="Muted/secondary surface colour")
|
||||
@@ -71,6 +79,8 @@ class CustomThemeColorOverrides(BaseModel):
|
||||
|
||||
@field_validator(
|
||||
"button_hover",
|
||||
"navigation_gradient_start",
|
||||
"navigation_gradient_end",
|
||||
"selected_background",
|
||||
"border",
|
||||
"muted",
|
||||
|
||||
Reference in new issue
Block a user