Commit Graph
766 Commits
Author SHA1 Message Date
erio 00decae9bb feat(frontend): move API Key quota bars from capacity to usage window column
Move daily/weekly/total quota progress bars for API Key accounts from
the capacity column (QuotaBadge) to the usage window column
(UsageProgressBar), providing a consistent visual experience with
other usage displays.
2026-03-08 20:10:48 +08:00
erio 0bf7111e27 feat: add Antigravity 403 forbidden status detection and display
- Backend: detect and classify 403 responses (validation/violation/forbidden)
- Backend: extract verification/appeal URLs from 403 response body
- Frontend: display forbidden status badges with color coding
- Frontend: show clickable/copyable verification links
- Also includes: sora SDK client rename, table header style fix, tier badge in accounts list

chore: bump version to 0.1.93.23
2026-03-08 18:23:07 +08:00
erio e6d42f7418 fix(frontend): broaden swipe-select activation area 2026-03-08 04:44:45 +08:00
erio c7d44b419f refactor(frontend): unify admin table selection state 2026-03-08 04:36:49 +08:00
erio 27eb50e468 fix(frontend): prefer text selection over swipe select 2026-03-08 04:01:34 +08:00
erio c6d47fa3a6 fix(frontend): auto-scroll table during swipe select 2026-03-08 03:51:41 +08:00
erio f9e4fd0bab fix(frontend): restore admin table scroll layout 2026-03-08 03:33:10 +08:00
erioandClaude Opus 4.6 dc46a49c6c fix: make table scrollbar clearly visible and prevent text selection during drag
Scrollbar:
- Override scrollbar-width to 'auto' (was 'thin' ~6px, nearly invisible)
- Increase scrollbar-color opacity to 0.7 (was 0.5)
- Add explicit ::-webkit-scrollbar width 10px for older Chrome

Text selection:
- Block selectstart in Phase 1 (onMouseDown) instead of Phase 2
- Clear existing text selection with removeAllRanges() on drag start

Stability:
- Add window blur handler to cleanup drag on tab switch / window leave
- Guard onWheel RAF callback against stale drag state
- Defensive removeMarquee() before createMarquee()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 03:17:58 +08:00
erioandClaude Opus 4.6 93cd0fd4b9 fix: make table scrollbar always visible instead of hover-only
The global CSS makes all scrollbars transparent by default (only visible
on hover). For table containers, scrollbars should always be visible so
users know the content is scrollable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 02:56:34 +08:00
erioandClaude Opus 4.6 259b9d2dbb fix: optimize swipe-select with binary search, short-circuit, and scrollbar detection
- Binary search in findRowIndexAtY (O(n) → O(log n))
- Short-circuit applyRange when row index unchanged
- Cache scrollParent in beginDrag instead of per-frame lookup
- Skip autoScroll recomputation when scrollTop unchanged
- Detect scrollbar clicks on inner containers, not just document

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 02:46:15 +08:00
erioandClaude Opus 4.6 ce32f0c75d fix: prevent scrollbar disappearance after swipe-select drag
- Replace document.body.style.userSelect manipulation with selectstart
  event listener to prevent text selection (no body style mutation)
- Skip mousedown on scrollbar area (clientX >= documentElement.clientWidth)
- Extract cleanupDrag() for robust state cleanup in all code paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 02:28:55 +08:00
erioandClaude Opus 4.6 fcf57d973b feat: enhance swipe-select with page-wide drag, scroll wheel, and auto-scroll
- Allow starting drag from anywhere on the page (not just inside tbody)
- Use 5px drag threshold to prevent accidental selection on click
- Support mouse wheel scrolling during drag to select new rows
- Auto-scroll when dragging near viewport edges with row re-detection
- Find closest row by viewport Y coordinate instead of requiring exact hit

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 02:18:14 +08:00
erioandClaude Opus 4.6 64e6aeab01 refactor: replace row-highlighting with marquee overlay for swipe-select
Remove selectedRowIds/isRowSelected/row-selected CSS from DataTable.
Add semi-transparent marquee rectangle overlay during drag selection,
with dark mode theme support using primary colors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 01:53:18 +08:00
erioandClaude Opus 4.6 1e9a412151 feat: highlight selected rows in DataTable with primary background
Add selectedRowIds prop to DataTable. Selected rows get a blue tint
background (primary-50), including sticky columns. Integrated into
AccountsView and ProxiesView for visual feedback during swipe select.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 01:37:42 +08:00
erioandClaude Opus 4.6 4fdc977192 feat: add WeChat-style swipe-to-select for account and proxy tables
Add useSwipeSelect composable that enables drag-to-select rows in
DataTable. Mousedown on a row and drag up/down to select/deselect
a contiguous range. Integrated into AccountsView and ProxiesView.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 01:29:13 +08:00
erioandClaude Opus 4.6 597c19e80b fix: comprehensive Sora & GDrive code review fixes
P0 fixes:
- StorageType: UploadFromURL now returns actual storageType, fixing
  GDrive tasks being incorrectly recorded as "s3"
- Concurrency: selectAccount returns ReleaseFunc to caller, fixing
  premature slot release before task creation
- Race condition: applyRecoveredToken uses copy-on-write for
  account.Credentials map to prevent concurrent write panic
- GetCameoStatus: use direct HTTP call to populate missing fields
  (StatusMessage, InstructionSetHint, InstructionSet)
- Frontend: progress bar uses reactive now.value instead of
  non-reactive Date.now()

P1 fixes:
- EditImage: pass req.Image through to CreateImageRequest
- ListPending: add LIMIT 200 to prevent unbounded queries
- Worker encapsulation: add ListPendingTasks/UpdateTask proxy methods
  to SoraTaskService, worker no longer accesses repo directly
- Frontend polling: add retry counter (3 attempts) before giving up

P2-P3 fixes:
- QuotaBar: handle both quota_source and source field names
- i18n: replace hardcoded Chinese labels in SoraPromptBar and
  example prompts in SoraGeneratePage with i18n keys
- Fix regenrate → regenerate i18n typo
- SoraMediaPreview: skip Escape handler when not visible
- SoraGeneratePage: void handleGenerate promise in handleRetry

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 01:02:55 +08:00
erioandClaude Opus 4.6 19b4da4149 refactor: compact QuotaLimitCard layout and fix CreateAccountModal merge
- QuotaLimitCard: label and input on same row for reduced height
- CreateAccountModal: move AffinityConfigCard into OAuth/SetupToken
  quota control section, eliminating duplicate "配额控制" cards

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 00:17:43 +08:00
erioandClaude Opus 4.6 587c530f35 refactor: unify quota sections into single "配额控制" card
Merge the separate "配额限制" and "配额控制" sections into one unified
"配额控制" section per account type. For Anthropic OAuth/SetupToken
accounts, AffinityConfigCard is now inside the quota control section
instead of a separate card.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:43:10 +08:00
erio 56d9d5cd60 Merge branch 'release/custom-0.1.92' into release/custom-0.1.93
# Conflicts:
#	backend/ent/group.go
#	backend/ent/group/group.go
#	backend/ent/group/where.go
#	backend/ent/group_create.go
#	backend/ent/group_update.go
#	backend/ent/migrate/schema.go
#	backend/ent/mutation.go
#	backend/ent/runtime/runtime.go
#	backend/ent/schema/group.go
#	backend/go.sum
#	backend/internal/handler/dto/mappers.go
#	backend/internal/repository/group_repo.go
#	frontend/src/views/admin/GroupsView.vue
2026-03-07 18:35:52 +08:00
erioandClaude Opus 4.6 0381414ca3 refactor: unify QuotaLimitCard and AffinityConfigCard under single section
Move both cards under a unified "配额限制" section wrapper for Anthropic
platform. Remove independent section wrappers from both components so
they render as plain rounded cards. Non-Anthropic apikey accounts get
their own quota section with just QuotaLimitCard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 18:07:25 +08:00
erioandClaude Opus 4.6 165cd33621 refactor: move affinity config to quota section with unified style
- AffinityConfigCard redesigned to match QuotaLimitCard style (section title + toggle card)
- Moved from standalone section to quota area, visible for all Anthropic account types
- Green zone (base) allows empty = no limit, min=1 when set; yellow zone hidden when base unset
- Deduplicated affinity save logic in EditAccountModal (single block for all Anthropic types)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:20:43 +08:00
shaw 92d35409de feat: 为openai分组增加messages调度开关和默认映射模型 2026-03-07 17:02:19 +08:00
erioandClaude Opus 4.6 59869b2b07 feat: client affinity three-zone scheduling model (green/yellow/red)
Backend: Add AffinityZone type with GetAffinityBase/GetAffinityBuffer/GetAffinityZone
methods. Integrate classifyByAffinityZone into Layer 2 scheduling and red zone
check into Layer 1.6 affinity hit path. 17 unit tests covering all zone boundaries.

Frontend: Add AffinityConfigCard for base/buffer configuration in EditAccountModal.
Move affinity badge from status column to capacity column with zone-based coloring
(count/limit format). Extract CapacityBadge and QuotaBadge components to reduce
AccountCapacityCell from 444 to 215 lines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 16:56:23 +08:00
shaw 7079edc2d0 feat: announcement支持强制弹窗通知 2026-03-07 15:06:13 +08:00
erioandClaude Opus 4.6 e890f177b9 refactor: usage queue groups by proxy exit identity instead of proxy_id
Anthropic OAuth/setup-token accounts are throttled by actual proxy
connection (host:port:username). Other platforms bypass the queue
entirely. Also adds unit tests for affinity and usage queue features.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:33:52 +08:00
erioandClaude Opus 4.6 9b382a2dc7 feat: add affinity clients hover popover with last active times
- New API: GET /accounts/:id/affinity-clients returns client list with
  last_active timestamps from Redis ZSET scores
- New Lua script: get_affinity_clients_with_scores.lua uses ZREVRANGEBYSCORE
  WITHSCORES to return both client IDs and their timestamps
- New frontend component: AffinityBadge.vue replaces inline badge with
  hover popover that lazy-loads client details on first hover
- Shows client ID (monospace) + relative time (e.g. "3h ago")

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 13:50:39 +08:00
shaw a42a1f08e9 fix: 编辑error状态账号时保存报Status验证失败
后端UpdateAccountRequest.Status的oneof验证缺少error状态,
前端编辑表单也未处理error状态,导致编辑异常账号时无法保存
2026-03-07 13:47:08 +08:00
erioandClaude Opus 4.6 12f61daca4 fix: increase usage query throttle to 1-2s random delay
Widen the per-group delay between Anthropic usage API calls from
1-1.5s to 1-2s to avoid upstream 429 rate limiting when multiple
accounts share the same proxy exit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 12:53:28 +08:00
erioandClaude Opus 4.6 1864f41f33 merge: sync upstream/main into release/custom-0.1.92
Merge upstream main branch changes including:
- OpenAI Codex support and websearch adaptation
- API key rate limit auto-reset fix
- golangci-lint v2.11 upgrade for Go 1.26 compatibility
- Go 1.26.1 stdlib security fixes
- Empty stream failover fix
- CCSwitch import improvements
- API key credentials preserve existing fields
- Usage query rate limit optimization
- Setup Token real utilization fix

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 12:53:12 +08:00
shaw c0c322ba16 chore: openai账号模型映射新增claude->gpt快捷映射按钮 2026-03-07 10:26:30 +08:00
shaw d35c5cd491 feat: openai平台的apikey新增claude code使用教程 2026-03-07 10:14:57 +08:00
Wesley Liddick 421b4c0aff Merge pull request #830 from ckken/pr/ccswitch-import-improvements
fix(ccswitch): improve import provider name and usage parsing
2026-03-07 08:49:09 +08:00
erioandClaude Opus 4.6 ea5e5dd9c7 feat: display client affinity count badge in account status column
Add colored circle badge showing affinity client count before the account
status indicator. Badge color reflects count severity (gray=0, green=1-5,
yellow=6-15, red=16+). Tooltip shows full client ID list on hover.

Backend: AccountHandler batch queries reverse affinity index via
GetAccountAffinityClientsBatch, returns affinity_client_count and
affinity_clients in DTO. GatewayCache interface extended with the new
batch method backed by a Lua script (get_affinity_clients.lua).

All test mocks synchronized with updated GatewayCache interface.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 04:52:10 +08:00
erioandClaude Opus 4.6 8d85cb57f1 feat: add client affinity toggle to create account modal
The client affinity setting was only available when editing an account.
Now it's also available during account creation for all Anthropic
platform types (OAuth, Setup Token, API Key).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 03:14:01 +08:00
ckken 97bf1d85ab feat(ccswitch): use site_name as default provider name in import link 2026-03-07 01:19:10 +08:00
ckken 207a493fab fix(ccswitch): parse remaining quota from /v1/usage response 2026-03-07 01:19:10 +08:00
erio 29d948bbfd Merge branch 'worktree-feature/sora' into release/custom-0.1.92 2026-03-07 00:35:35 +08:00
erioandClaude Opus 4.6 dac451ee0b feat(frontend): move provider selection into drawer and remove quota field
- Move storage provider selection (S3/GDrive) from separate modal into
  the drawer itself, shown as the first step when creating a new profile
- Provider type is locked once selected (read-only badge in header)
- Remove default_storage_quota_gb field from form and table column
- Remove unused formatStorageQuotaGB function and providerSelectOpen ref

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 00:34:11 +08:00
erioandClaude Opus 4.6 8071e9c4d8 fix(frontend): vertically center table row content in storage table
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 00:25:55 +08:00
erioandClaude Opus 4.6 a21f7d650b feat: display daily/weekly/total quota dimensions in account list
- Add quota_daily_limit/used and quota_weekly_limit/used to DTO and
  frontend Account type
- AccountCapacityCell shows D (daily), W (weekly), and $ (total) badges
  with color-coded status (green/yellow/red)
- AccountActionMenu shows reset button when any quota dimension is set
- Extract quotaBadgeClass/quotaBadgeTooltip as shared functions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 00:18:41 +08:00
erioandClaude Opus 4.6 e6b3808dcd fix(frontend): reduce action column height in storage table
Change flex-wrap gap-2 to items-center gap-1 to keep buttons on one line.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 00:15:06 +08:00
erio 5acf888d06 Merge remote-tracking branch 'origin/release/custom-0.1.92' into worktree-feature/sora 2026-03-06 23:58:40 +08:00
erioandClaude Opus 4.6 9e107fae73 feat(sora): improve storage management page with split columns, test buttons, quota and video stats
- Split compound "Profile" column into separate Profile ID and Name columns
- Replace "Endpoint" column with "Storage Path" showing bucket/prefix or folder info
- Add GDrive quota display (capacity/used) via new backend API endpoint
- Add video count statistics per storage type via new backend API endpoint
- Add inline test button per profile with 15s timeout and per-profile loading state
- Backend: GetQuotaInfo, CountByStorageType, GetGDriveQuota, GetStorageVideoStats

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 23:58:27 +08:00
Gemini WenandClaude Opus 4.6 9f7ad47598 fix(account): clean up stale credentials fields after spreading currentCredentials
When customErrorCodes is disabled or modelMapping is empty, explicitly
delete the fields inherited from currentCredentials spread to avoid
preserving stale values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 23:38:58 +08:00
Gemini Wen 3c83cd8be2 Merge remote-tracking branch 'origin/main' into fix/apikey-credentials-preserve-existing-fields 2026-03-06 23:38:18 +08:00
erioandClaude Opus 4.6 6a7bcabb6f feat(frontend): add GDrive storage test button in profile drawer
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:56:23 +08:00
erioandClaude Opus 4.6 33ab8413db feat: support independent daily/weekly/total quota limits for API Key accounts
Replace single-period-selector (三选一) with three independently configurable
quota dimensions (日/周/总) that can all be set simultaneously. Account is
paused when ANY dimension is exceeded. Periodic quotas (daily/weekly) use
lazy reset via atomic SQL — no cron job needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 21:20:29 +08:00
神乐 dd25281305 chore(test): resolve merge conflict for ws usage window pr 2026-03-06 21:16:21 +08:00
erioandClaude Opus 4.6 e3f9774eda fix(sora): add GDrive OAuth callback page for postMessage flow
The OAuth flow opens a popup window that redirects to /admin/gdrive-oauth-callback,
but this route and page were missing. Add the callback view that extracts the
authorization code from the URL and sends it back to the opener window via
postMessage, completing the OAuth authorization flow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 21:10:02 +08:00
神乐 838ada8864 fix(openai): restore ws usage window display 2026-03-06 20:49:47 +08:00