feat(admin): 账号用量窗口 5h/7d 增加说明 tooltip#2895
Open
wucm667 wants to merge 1 commit into
Open
Conversation
在账号管理列表"用量窗口"列表头增加一个说明性 HelpTooltip, 解释 5h / 7d 是上游账号(如 OpenAI ChatGPT、Claude)官方的滚动 用量窗口限制,由上游设定、非 sub2api 配置、与映射模型无关,且 窗口滚动到期后自动重置、无法在 sub2api 端解除。 复用现有 HelpTooltip 组件(teleport 到 body,避免表格裁剪), 单个 ⓘ 图标置于列表头,避免每行重复。新增 i18n key admin.accounts.usageWindowsHint(zh/en 同步)。纯展示说明, 不改用量计算与后端逻辑。 Co-Authored-By: Claude Opus 4.8 <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.
背景
账号管理列表的"用量窗口"列会展示
5h/7d(OAuth 账号还有7d S)进度条。不少用户看到后不理解它的含义,反复来问:这是什么限制、在哪里配置、能不能解除(见 #2887)。评论区其他用户已经给出过解答——这是上游账号(如 OpenAI ChatGPT)自身的官方滚动用量窗口限制,由上游对账号设定,不是 sub2api 配的,也跟映射的模型无关,无法在 sub2api 端解除。本 PR 把这条解释直接做成 UI 提示,避免重复答疑。改动
AccountsView.vue的"用量窗口"列表头新增一个说明性HelpTooltip(ⓘ 图标,hover 展开):@/components/common/HelpTooltip.vue,未引入任何新依赖;该组件 teleport 到 body,可避免表格容器overflow裁剪。admin.accounts.usageWindowsHint(zh.ts/en.ts同步),文案说明:5h / 7d是上游账号(如 OpenAI ChatGPT、Claude)官方的滚动用量窗口限制,由上游对账号设定,并非 sub2api 配置,也与映射的模型无关;usageWindow.*i18n 块。测试
均在
frontend/下执行:pnpm typecheck✅ 通过pnpm lint:check✅ 通过pnpm build✅ 通过pnpm test:run:新增AccountsView.usageWindowsHint.spec.ts✅ 通过(断言列表头同时渲染列名与usageWindowsHint提示文案)。AccountUsageCell.spec.ts中有 6 条用例失败,但这是 upstream/main 上既有的失败(getUsage调用参数匹配相关),已通过git stash在干净的 upstream/main 上复现确认,与本次改动无关,本 PR 未触碰该组件。pnpm-lock.yaml无变动。纯前端改动,无需跑后端测试。Fixes #2887