Repository navigation
refactor(overview): move usage panels to the Usage page - #408
Merged
caigee-cmd merged 2 commits intoOct 27, 2026
Merged
Conversation
The Overview page had grown three read-only insight panels that duplicate what the standalone Usage page is for. Keep Overview about gateway health and move the credit-expiry view to where the other usage numbers live. Overview: - Drop the Usage breakdown and Credit deduction history panels together with the usage fetch, its state and the 30s refresh branch that fed them; the page keeps status, traffic, account pool, resources and ranks. - Drop the now-unused regional catalog fetch that only fed Credit history. Usage: - Mount the credit expiry distribution under the Stats tab, following the same window as the tables above it. - Default the window to Today, matching Overview. - Add Today to the Quota tab, which previously started at the full retained range, and default it there too. Cleanup: delete UsagePanels.tsx, the RequestUsage types and fetcher, and the 36 i18n keys that only those panels used (en/zh stay in parity). The `/api/logs/usage` endpoint and SummarizeRequestUsage stay in place: they are public console API surface covered by TestRequestUsageEndpointCredits, so removing them is a separate breaking change. Verified against a copy of a live database on a scratch port: Overview has no usage panels, Usage defaults to Today on both tabs with the expiry distribution rendering 23 days of real credit expiry data.
caigee-cmd
approved these changes
Oct 27, 2026
caigee-cmd
left a comment
Owner
There was a problem hiding this comment.
LGTM:Overview 去掉重复用量面板,ExpiryDistribution 复用到 Usage,today 默认窗口合理。
Resolve rename conflicts under internal/webui/static after caigee-cmd#407 landed.
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.
Summary
The Overview page had accumulated three read-only insight panels that duplicate what the standalone Usage page is for. This PR keeps Overview focused on gateway health and moves the credit-expiry view to where the other usage numbers already live.
Overview
fetchRequestUsagecall, theusage/usageLoading/usageErrorstate, and the usage branch of the 30s background refresh that fed them. The page keeps gateway status, traffic, account pool, resources and the ranking cards.fetchModels(..., 'regional')) that existed only to resolve model credit rates for the credit history.Usage
Cleanup
UsagePanels.tsx, theRequestUsage*types andfetchRequestUsagefromapi/logs.ts.enandzhstay in parity at 851 keys each.npm run syncregeneratedinternal/webui/static.Deliberately not included
GET /api/logs/usageandSummarizeRequestUsageare left in place. They are public console API surface covered byTestRequestUsageEndpointCredits, so deleting them is a separate, breaking change rather than part of a menu reshuffle. Say the word and I will open a follow-up.Test plan
go test ./...go vet ./...cd worker && npm test(87 pass; untouched by this PR)cd frontend && npm run build && npm run lint— build green, 50 warnings / 0 errors (51 before this PR; no new warnings)changelog/unreleased/usage-page-consolidation.md(EN + 中文),release-notes.py validatepasses