mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
feat(pool,ui,trace): 号池按页配额刷新、配额倒计时、Trace 全量候选与 UI 用语统一
- 号池管理支持按当前页 Key 刷新配额,后端 refresh-quota 接口支持 key_ids 参数筛选 - 配额进度条 tooltip 展示重置倒计时,前端解析后端重置时间并实时倒计时 - Provider 选择器在无号池提供商时禁用,切换/刷新后保持选中状态对齐 - 启停账号后立即更新调度标签并刷新列表 - Trace 监控展示全量候选记录,不再过滤 available/unused 状态 - 请求时间线号池节点与 Provider 节点去重 - 全局 UI 用语统一:已停用/已禁用 -> 停用/禁用 - 导航菜单调整模型管理与号池管理顺序
This commit is contained in:
@@ -163,18 +163,17 @@ class AdminGetRequestTraceAdapter(AdminApiAdapter):
|
||||
async def handle(self, context: ApiRequestContext) -> Any: # type: ignore[override]
|
||||
db = context.db
|
||||
|
||||
# 查询所有候选后,默认只展示已发生调度结果的子集:
|
||||
# - 过滤 available/unused(预创建但未实际参与本次调度)
|
||||
# - 若过滤后为空(例如请求尚未开始),回退到全量,避免前端空白
|
||||
# 查询并展示该请求的全量候选:
|
||||
# - 包含 available/unused(未执行)
|
||||
# - 包含 skipped(跳过)
|
||||
# - 包含 pending/streaming/success/failed/cancelled(执行中/结果)
|
||||
all_candidates = RequestCandidateService.get_candidates_by_request_id(db, self.request_id)
|
||||
|
||||
# 如果没有数据,返回 404
|
||||
if not all_candidates:
|
||||
raise HTTPException(status_code=404, detail="Request not found")
|
||||
|
||||
candidates = [
|
||||
c for c in all_candidates if c.status not in ("available", "unused")
|
||||
] or all_candidates
|
||||
candidates = all_candidates
|
||||
|
||||
# 计算总延迟(只统计已完成的候选:success, failed, cancelled)
|
||||
# 使用显式的 is not None 检查,避免过滤掉 0ms 的快速响应
|
||||
|
||||
Reference in New Issue
Block a user