fix: 认证系统、登录兼容性、运行时配置、钉钉通知及代码清理

- 实现 JWT 认证中间件,保护配置管理和任务删除接口
- 修复 ConfigView 登录按钮(Vue 3 inject 替代 $root)
- 页面刷新时通过 /api/auth/me 校验 token 有效性
- max_concurrent_builds 修改后运行时即时生效
- 实现钉钉 webhook 通知(构建成功/失败自动推送)
- 删除未使用的 useWebSocket composable
- log_streamer 使用 LOG_QUEUE_MAX_SIZE 配置常量
This commit is contained in:
shen
2026-06-08 20:35:05 +08:00
parent f5919a8229
commit e18f33d60f
14 changed files with 262 additions and 91 deletions
+8 -3
View File
@@ -62,10 +62,15 @@ class BuildQueue:
task.cancel()
def update_max_concurrent(self, new_max: int):
"""更新最大并发数"""
"""更新最大并发数(运行时生效)"""
if new_max == self._max_concurrent:
return
old = self._max_concurrent
self._max_concurrent = new_max
# 注意:运行时修改需要重建 semaphore,这里简化处理
# 实际使用时建议重启服务生效
# 调整信号量:增加并发时 release 额外的许可,减少时由自然消费收敛
if new_max > old:
for _ in range(new_max - old):
self._semaphore.release()
@property
def queue_size(self) -> int: