feat(ui): 增加模型连接性测试功能并优化对话框 ESC 键处理

- 模型测试: 新增测试按钮,支持多 API 格式选择
- ESC 键: 重构为全局栈管理,支持嵌套对话框
- 修复: check_endpoint 使用 FORMAT_ID 替代 name
- 优化: Redis 连接池添加健康检查

Co-authored-by: htmambo <htmambo@users.noreply.github.com>
This commit is contained in:
fawney19
2026-01-13 20:08:47 +08:00
parent 6fdb944b1e
commit 8c4c5fa394
5 changed files with 196 additions and 31 deletions

View File

@@ -641,7 +641,7 @@ class ChatAdapterBase(ApiAdapter):
url=url,
headers=headers,
json_body=body,
api_format=cls.name,
api_format=cls.FORMAT_ID,
# 用量计算参数(现在强制记录)
db=db,
user=user,

View File

@@ -172,6 +172,7 @@ class RedisClientManager:
max_connections=redis_max_conn,
decode_responses=True,
socket_connect_timeout=5.0,
health_check_interval=30, # 每 30 秒检查连接健康状态
)
safe_url = f"sentinel://{sentinel_service}"
else:
@@ -182,6 +183,7 @@ class RedisClientManager:
socket_timeout=5.0,
socket_connect_timeout=5.0,
max_connections=redis_max_conn,
health_check_interval=30, # 每 30 秒检查连接健康状态
)
safe_url = redis_url.split("@")[-1] if "@" in redis_url else redis_url