Repository navigation
使用统计改为全平台,用户排行默认展示并按 Token 合计排序 - #126
Merged
Merged
Conversation
- 统计只含聚合数字、不含正文,不再按机器人或私聊可见范围过滤,所有登录成员看全平台 - 用户排行放到第一个并默认展开,按四类 Token 合计倒序,显示圆形头像、平台姓名和 Token 合计 - by_user 每行新增 tokens、avatar_url;无需数据库迁移 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动
GET /api/admin/statistics只返回聚合数字、不含对话正文,因此去掉按机器人管理范围和私密轮次的过滤,任何登录成员(含机器人令牌)都看全平台所有机器人的用量。首页用量汇总复用同一接口,也随之变为全平台数字。by_user每行新增tokens、avatar_url。docs/statistics-and-health.md、CHANGELOG 同步更新。无需数据库迁移。测试
uv run pytest tests/api/test_statistics.py:原「成员只看可见范围」「机器人令牌不含飞书私聊」两个用例改为一个全平台用例,覆盖跨机器人与私聊计入、按 Token 排序(消息更多但 Token 更少者靠后)、平台姓名和头像npx vitest run tests/StatisticsView.spec.ts tests/HomeView.spec.ts:断言标签顺序、默认展开用户排行、圆形头像与 Token 合计🤖 Generated with Claude Code