Skip to content

feat(home): 展示常用订阅账号 - #504

Merged
tbphp merged 2 commits into
v2from
tbphp/home-active-subscription-accounts
Aug 31, 2026
Merged

feat(home): 展示常用订阅账号#504
tbphp merged 2 commits into
v2from
tbphp/home-active-subscription-accounts

Conversation

@tbphp

@tbphp tbphp commented Aug 31, 2026

Copy link
Copy Markdown
Owner

关联 Issue / Related Issue

无 / None

变更内容 / Change Content

  • Bug 修复 / Bug fix

  • 新功能 / New feature

  • 其他改动 / Other changes

  • 新增管理员首页活跃订阅账号接口,基于 credential_attempt_stats 最近 24 小时成功记录排序,跨分组按账号身份去重并限制最多 4 张卡片

  • 使用一分钟进程缓存并批量读取持久化额度快照;不查询请求日志、不新增聚合表或数据库迁移,也不触发上游同步

  • 首页复用现有订阅账号卡片的只读变体,保留主要信息与排版,隐藏多选、刷新、菜单、重置和展开详情;查询结果为空时不渲染板块

  • AccessKey 登录前端不查询、不渲染,后端接口拒绝访问

自查清单 / Checklist

  • 我已运行 make check,或在说明中写明无法运行的原因和未验证范围。 / I ran make check, or documented why it could not run and what remains unverified.
  • 本 PR 范围聚焦,未包含无关改动。 / This PR is focused and contains no unrelated changes.
  • 我已更新必要的公开文档或发布说明。 / I updated any required public documentation or release notes.
  • 我已确认提交、日志和测试数据不包含敏感信息。 / I confirmed that commits, logs, and fixtures contain no sensitive data.
  • 如适用,我已说明兼容性或数据迁移影响。 / Where applicable, I documented compatibility or data-migration impact.

验证:make check 已通过。

兼容性:新增只读管理接口,无数据库迁移;现有分组页订阅账号卡片交互保持不变。本次不需要公开文档或发布说明。

Summary by CodeRabbit

  • 新功能
    • 首页新增“最近常用订阅账号”区域,仅管理员可查看。
    • 展示账号图标、能力、关联分组数量及可用状态,最多显示四个账号。
    • 账号卡片采用只读模式,不影响现有订阅账号管理操作。
  • 体验优化
    • 支持响应式布局,并新增中文、英文和日文界面文案。
    • 数据短暂缓存,减少重复加载并提升首页访问速度。

Copilot AI lite review requested due to automatic review settings August 31, 2026 05:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T06:09:07.939080Z 72eb4f0 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: QUIET

Plan: Pro Plus

Run ID: 3b3bc10f-32f9-4354-a514-3822af936b47

📥 Commits

Reviewing files that changed from the base of the PR and between 1c8fe7f and 72eb4f0.

📒 Files selected for processing (1)
  • web/src/i18n/locales/en-US/core.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

新增首页订阅账户读取接口。后端按 24 小时活动聚合账户,并使用一分钟缓存。接口仅允许管理员访问。前端校验响应数据,并在首页显示最多四个只读订阅账户卡片。卡片显示账户组总数、可用组数和订阅凭据状态。

Merge Risk: 🔵 Low · up to 72eb4

The PR adds a read-only administrator homepage section for recently active subscription accounts. It is mergeable with explicit owner follow-up for the malformed English label on single-group accounts and the bounded cache-isolation concern.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 11 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 标题“feat(home): 展示常用订阅账号”准确概括了新增管理员首页活跃订阅账号功能,内容明确且简洁。
Description check ✅ Passed 描述完整说明了功能范围、排序与去重规则、缓存策略、权限控制、前端展示、兼容性影响和验证结果。关联 Issue 明确标记为无,且自查清单已完成。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch tbphp/home-active-subscription-accounts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (1)
web/src/i18n/locales/en-US/core.ts-294-294 (1)

294-294: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

修正单分组账号的英文文案。

count 为 1 时,当前文案显示为 1 Groups。请改用不依赖单复数的文本,例如 Groups: {count}


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: QUIET

Plan: Pro Plus

Run ID: f4414a3a-1e3a-4a91-9f86-a8ea5ef0c218

📥 Commits

Reviewing files that changed from the base of the PR and between 118c9a9 and 1c8fe7f.

📒 Files selected for processing (14)
  • internal/control/home_subscription_accounts.go
  • internal/control/home_subscription_accounts_test.go
  • internal/control/http_routes.go
  • internal/control/server_test.go
  • internal/control/service.go
  • web/src/app/query-keys.ts
  • web/src/app/resources/home.ts
  • web/src/app/router.ts
  • web/src/features/groups/credentials/SubscriptionAccountCard.vue
  • web/src/features/home/HomeSubscriptionAccounts.vue
  • web/src/features/home/HomeView.vue
  • web/src/i18n/locales/en-US/core.ts
  • web/src/i18n/locales/ja-JP/core.ts
  • web/src/i18n/locales/zh-CN/core.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@tbphp tbphp self-assigned this Aug 31, 2026
@tbphp tbphp added the enhancement New feature or request label Aug 31, 2026
@tbphp tbphp added this to the v2.0.0 milestone Aug 31, 2026
@tbphp
tbphp merged commit 2ea86cd into v2 Aug 31, 2026
7 checks passed
@tbphp
tbphp deleted the tbphp/home-active-subscription-accounts branch August 31, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants