siyuan/kernel/api
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
..
account.go ♻️ Refactor Go to err != nil, err == nil (#12385) 2024-09-04 09:40:50 +08:00
ai.go 🎨 Update slogan Refactor your thinking https://github.com/siyuan-note/siyuan/issues/8608 2023-06-24 20:39:55 +08:00
archive.go ♻️ Refactor Go to err != nil, err == nil (#12385) 2024-09-04 09:40:50 +08:00
asset.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
attr.go 🎨 Improve /api/attr/setBlockAttrs and /api/attr/batchSetBlockAttrs (#17027) 2026-02-17 13:35:26 +08:00
av.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
bazaar.go 🎨 /api/bazaar/uninstallBazaarPlugin supports not passing the frontend parameter (#17173) 2026-03-10 18:49:58 +08:00
block.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
block_op.go 🐛 The updateBlock API encountered a null pointer error https://github.com/siyuan-note/siyuan/issues/16705 2025-12-26 22:02:55 +08:00
bookmark.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
broadcast.go ♻️ Refactor EventSource broadcast subscribe (#13708) 2025-01-03 09:28:16 +08:00
clipboard.go 🎨 Clean code 2026-03-10 16:31:15 +08:00
export.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
extension.go 🐛 Fix https://github.com/siyuan-note/siyuan/issues/17138 2026-03-06 08:44:31 +08:00
file.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
filetree.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
format.go ♻️ Refactor Go to err != nil, err == nil (#12385) 2024-09-04 09:40:50 +08:00
graph.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
history.go 🎨 Supports cleaning up unreferenced databases https://github.com/siyuan-note/siyuan/issues/11569 2026-01-29 22:58:21 +08:00
icon.go 🔒 https://github.com/siyuan-note/siyuan/security/advisories/GHSA-6865-qjcf-286f 2026-03-04 11:48:09 +08:00
import.go 🎨 Support importing markdown zip on the browser (#14950) 2025-06-02 21:14:04 +08:00
inbox.go ♻️ Refactor Go to err != nil, err == nil (#12385) 2024-09-04 09:40:50 +08:00
lute.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
network.go 🎨 Clean code 2026-03-11 09:10:34 +08:00
notebook.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
notification.go 🎨 Support sending notifications on HarmonyOS https://github.com/siyuan-note/siyuan/issues/17125 2026-03-05 23:45:24 +08:00
outline.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
pandoc.go ♻️ Refactor Go to err != nil, err == nil (#12385) 2024-09-04 09:40:50 +08:00
petal.go ♻️ refactor reloadPlugin (#17137) 2026-03-05 10:11:44 +08:00
ref.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
repo.go 🎨 Automatic purge for local data repo https://github.com/siyuan-note/siyuan/issues/13091 2024-11-17 01:33:21 +08:00
riff.go ♻️ Improve transaction flush 2024-10-22 19:21:04 +08:00
router.go 🎨 add POST /api/setting/setTheme endpoint (#17198) 2026-03-13 17:28:45 +08:00
search.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
setting.go 🎨 add POST /api/setting/setTheme endpoint (#17198) 2026-03-13 17:28:45 +08:00
snippet.go 🎨 Add field disabledInPublish to the code snippet to indicate whether it is disabled in the publish service https://github.com/siyuan-note/siyuan/issues/15806 2025-09-09 09:18:12 +08:00
sql.go 🎨 Add internal kernel API /api/sqlite/flushTransaction https://github.com/siyuan-note/siyuan/issues/10005 2024-11-19 22:53:18 +08:00
storage.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
sync.go 🎨 Improve import S3/WebDAV conf https://github.com/siyuan-note/siyuan/issues/13718 2025-01-04 21:26:30 +08:00
system.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
tag.go Publish service supports document-level access control (#16041) 2026-03-12 18:04:01 +08:00
template.go 🔒 Some security vulnerabilities https://github.com/siyuan-note/siyuan/issues/13426 2024-12-11 17:30:14 +08:00
transaction.go 🎨 Improve export preview mode https://github.com/siyuan-note/siyuan/issues/16732 2025-12-31 11:32:51 +08:00
ui.go 🎨 Unified file listener logic (#17134) 2026-03-04 22:33:35 +08:00
workspace.go 🐛 Can't switch workspaces on mobile https://github.com/siyuan-note/siyuan/issues/16544 https://github.com/siyuan-note/siyuan/issues/16552 2025-12-10 08:41:15 +08:00