Files
siyuan/kernel/model
konti1334 2e6b13eec4 🎨 add POST /api/setting/setTheme endpoint (#17198)
Adds a minimal endpoint for activating a theme by name and mode without
requiring the caller to fetch and re-POST the entire appearance config blob.

Request body:
  { "theme": "<theme-dir-name>", "mode": 0|1 }

Behaviour:
- Sets both ThemeLight and ThemeDark to the supplied theme name
- Sets Mode (0 = light, 1 = dark)
- Calls InitAppearance() to validate the theme exists and reads its
  version from theme.json for cache-busting
- Saves conf.json
- Broadcasts the "setAppearance" WebSocket event so all open windows
  call loadAssets() and reload the theme CSS with the new ?v= parameter

Returns the full Appearance config (same shape as setAppearance).

Motivation: external tools (e.g. OS-level theme switchers) previously
had to GET /api/system/getConf, patch the appearance object, and POST
the entire blob to /api/setting/setAppearance.  /api/setting/setTheme
reduces that to a single, self-contained call with no dependencies.

Co-authored-by: You name <konty@github.com>
2026-03-13 17:28:45 +08:00
..
…
2026-03-08 22:14:06 +08:00
2026-03-08 22:14:06 +08:00
…
2026-01-31 18:14:03 +08:00
…
2026-03-08 22:14:06 +08:00
2026-03-13 17:02:42 +08:00
…
2026-03-05 10:11:44 +08:00
2026-03-08 22:14:06 +08:00
…
…
2026-01-20 10:05:28 +08:00