Files
Nexus/docs/changelog/2026-06-08-script-exec-complete-sound-setting.md
T
2026-07-08 22:31:31 +08:00

36 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 2026-06-08 — 脚本执行完成提示音可配置
## 摘要
将原先硬编码在 `App.vue` 的双音提示改为系统设置项,支持关闭/三种音色,并可试听。
## 动机
用户需在「设置」中控制脚本执行结束时的浏览器提示音,而非写死在代码里。
## 涉及文件
- `frontend/src/utils/scriptCompleteSound.ts` — 音色预设与播放
- `frontend/src/composables/useScriptCompleteSound.ts` — 与 MySQL 设置同步
- `frontend/src/App.vue` — 使用 composable
- `frontend/src/pages/SettingsPage.vue` — 「界面提示」卡片
- `server/api/settings.py``script_exec_complete_sound` 白名单与枚举校验
## 设置项
| Key | 可选值 | 默认 |
|-----|--------|------|
| `script_exec_complete_sound` | `off` / `beep_short` / `beep_double` / `chime_soft` | `beep_double`(未配置时) |
API`PUT /api/settings/script_exec_complete_sound` `{ "value": "beep_double" }`
## 迁移 / 重启
- 无需迁移;首次保存时写入 `settings`
- 仅前端热更新即可试听;后端需 reload 以识别新白名单键
## 验证
- 设置 → 界面提示 → 切换音色并「试听」
- 触发脚本执行完成,确认按所选音色播放或关闭