Commit Graph
2154 Commits
Author SHA1 Message Date
t0ng7u 59337e9ed8 Merge remote-tracking branch 'origin/main' into v2/localmain
# Conflicts:
#	model/option.go
2026-04-27 15:30:29 +08:00
Calcium-Ion e36d191c2e Merge pull request #4450 from feitianbubu/pr/7fa4a87ad953642a2f454ad0813a0c8b6ac361c6
增加用户创建时间和最后登录时间
2026-04-26 22:12:22 +08:00
Seefs f424f906d8 feat: sync upstream pricing from pricing endpoint (#4452)
* feat: sync upstream pricing from pricing endpoint

* feat: sync upstream pricing with expression priority

* fix: add feedback while syncing upstream pricing

* fix: show loading state for empty upstream pricing sync
2026-04-26 20:17:35 +08:00
Calcium-Ion cc4ad6c39e Merge pull request #4437 from seefs001/fix/channel-upstream-model-sync
fix(channel): load model mapping during upstream model checks
2026-04-26 20:17:14 +08:00
feitianbubu 02aacb38a2 feat: add user created_at and last_login_at 2026-04-25 12:44:44 +08:00
CaIon a7c38ec851 fix: add PaymentProvider field to prevent cross-gateway callback attacks
EPay allows users to switch payment methods (e.g. wxpay→alipay) during
checkout, causing callback rejection. Replace fragile blocklist guard
with a PaymentProvider field on TopUp and SubscriptionOrder that
identifies which gateway created the order.
2026-04-24 22:16:16 +08:00
Seefs 095e1920f1 fix(channel): load model mapping during upstream model checks 2026-04-24 17:51:46 +08:00
CaIon 3a2138ba61 refactor: rename and relocate HasModelBillingConfig function for clarity 2026-04-24 16:39:12 +08:00
yyhhyyyyyy e3d64cb76d Merge pull request #4431 from yyhhyyyyyy/fix/tiered-billing-model-list
fix: include tiered billing models in model listing
2026-04-24 16:24:36 +08:00
t0ng7u 1be6cdbe51 Merge remote-tracking branch 'origin/main' into v2/localmain
# Conflicts:
#	model/option.go
#	web/classic/src/components/table/model-pricing/modal/components/DynamicPricingBreakdown.jsx
#	web/classic/src/constants/billing.constants.js
#	web/classic/src/pages/Setting/Payment/SettingsPaymentGatewayWaffoPancake.jsx
#	web/classic/src/pages/Setting/Ratio/ToolPriceSettings.jsx
#	web/classic/src/pages/Setting/Ratio/components/TieredPricingEditor.jsx
#	web/classic/src/pages/Setting/Ratio/components/requestRuleExpr.js
2026-04-24 02:52:19 +08:00
CaIon 6bde1a9c8d Merge origin/main into nightly
Resolve conflicts:
- .gitignore: keep nightly additions (.test, skills-lock.json)
- relay/helper/price.go: keep both billingexpr and model imports
- en.json / zh-CN.json: keep nightly's superset of i18n entries
- service/billing_session.go: add missing 3rd arg to DecreaseUserQuota
- en.json / zh-CN.json: deduplicate 129+320 duplicate i18n keys
2026-04-23 21:37:03 +08:00
XiaoAI1024 49474520ec Protect external token migration tests 2026-04-23 13:29:00 +08:00
XiaoAI1024 0feb6f2c3c Add cross-database token migration tests 2026-04-23 13:29:00 +08:00
XiaoAI1024 81ddf6e722 Add legacy token migration test 2026-04-23 13:29:00 +08:00
XiaoAI1024 2431efc01f Support longer legacy token keys 2026-04-23 13:29:00 +08:00
Seefs 1d83b5472a fix: require proper verification for passkey changes (#4393) 2026-04-22 22:55:06 +08:00
Seefs 5f67d2a28b fix: use stream for codex auto test (#4325) 2026-04-22 22:54:41 +08:00
Seefs f995a868e4 Merge pull request #4089 from seefs001/feature/waffo-pay
rafactor: payment
2026-04-18 14:22:54 +08:00
CaIon c31343ac76 fix(log): hide admin identity in user-visible management logs
Admin username/ID was embedded directly into the log Content for
quota changes and forced 2FA disable, leaking the operator's
identity to the target user via their own usage log page.

Move operator info into Other.admin_info so formatUserLogs strips
it for non-admin viewers, and render it in the expand panel only
for admins as "操作管理员".

Closes #4301
2026-04-18 00:16:52 +08:00
CaIon 9253426223 fix(user): invalidate user and token caches when disabling user
When an admin disables/deletes/promotes/demotes a user via ManageUser,
explicitly evict the user cache and all of the user's token caches from
Redis. This prevents a disabled user from continuing to make successful
API requests until the user cache TTL expires, and ensures subsequent
requests reload fresh status from the database.
2026-04-17 23:58:45 +08:00
CaIon 209d90e861 feat(topup): add admin-only audit info to top-up logs
Thread caller IP from webhook/admin controllers through model recharge
functions and record a new RecordTopupLog entry with admin_info (server
IP, caller IP, order payment method, callback payment method, system
version). Frontend shows these fields in the expanded log row and the
IP column for admins on top-up logs, while non-admins continue to see
admin_info stripped by formatUserLogs.
2026-04-17 23:51:30 +08:00
t0ng7u fdc382ceea Merge remote-tracking branch 'origin/main' into v2/localmain 2026-04-17 17:55:27 +08:00
CaIon 22e509c1ef refactor: simplify ShouldDisableChannel function by removing unused parameters and commented-out code 2026-04-16 20:56:44 +08:00
t0ng7u dd291b5f6a Merge branch 'main' into v2/localmain 2026-04-15 21:28:10 +08:00
CaIon 8aaec8b1cc feat: add PaymentMethod field to TopUp model and enhance payment method validation in topup controllers 2026-04-15 21:17:49 +08:00
t0ng7u dadc064231 Merge remote-tracking branch 'origin/main' into v2/localmain 2026-04-15 21:07:12 +08:00
CaIon b2a40d3381 feat: enhance Stripe webhook handling for async payment events 2026-04-15 20:56:55 +08:00
t0ng7u 91288cafe8 🎨 feat: add backend-configurable frontend theme switching (default/classic)
Introduce runtime frontend theme switching so administrators can switch
between the new frontend (Radix UI + Tailwind) and the classic frontend
(Semi Design) from the settings page without restarting the server.

Directory restructuring:
- Move new frontend from web/ to web/default/
- Move classic frontend from web/old/ to web/classic/
- One-frontend-per-folder layout for extensibility

Backend (injection pattern):
- Add setting/system_setting/theme.go with GlobalConfig.Register("theme")
  so the DB key "theme.frontend" is handled automatically by
  handleConfigUpdate — no switch-case in updateOptionMap needed
- Use atomic.Value in common.GetTheme()/SetTheme() for lock-free
  concurrent reads on the hot path (static file middleware)
- Add themeAwareFileSystem that delegates to the correct embedded FS
  based on the current theme at request time
- Embed both frontends into the binary via go:embed
- Add controller validation for theme.frontend values
- Expose theme in GET /api/status response

Frontend settings UI:
- New frontend: add "Frontend Theme" select in System Information section
  using Radix UI Select + react-hook-form + Zod validation
- Classic frontend: add "前端主题" select in Personalization section
  using Semi Design Form.Select

Build system:
- Update Dockerfile with multi-stage builds for both frontends
- Update Makefile with separate build targets for each frontend
- Update GitHub Actions release workflow for dual frontend builds

i18n:
- New frontend: add translations for all 6 locales (en/zh/fr/ja/ru/vi)
- Classic frontend: add translations for all 7 locales (en/zh-TW/ja/fr/ru/vi)
- Fix zh "AI Proxy Library" → "AI 代理库"

Documentation:
- Update CLAUDE.md, AGENTS.md, .cursor/rules/project.mdc to reflect
  the new web/default/ and web/classic/ directory structure
2026-04-15 17:19:24 +08:00
t0ng7u d276aae890 ✨ feat(web): port missing features from legacy frontend and complete i18n
Backport and enhance several features from the old frontend (web/old)
that were missing or incomplete in the new React frontend:

- Playground & channel test: parse structured JSON error responses from
  SSE streams and non-streaming API calls, extract error codes, and
  display actionable UI for `model_price_error` (admin settings link)
- User management: replace local quota manipulation with atomic
  server-side quota adjustments (add/subtract/override) via dedicated
  API endpoint, making the quota field read-only in the edit drawer
- Subscriptions: display next quota reset time for active subscriptions
- Dashboard: limit model ranking chart to top 20 models with an "Other"
  bucket, add dimension tooltips with sorted values and totals to model
  call trend and user consumption trend charts
- i18n: add 24 new translation keys across all 6 locales (en, zh, fr,
  ja, ru, vi) for the newly introduced UI elements and messages
2026-04-15 16:08:32 +08:00
t0ng7u 8a0d878a98 Merge branch 'main' into v2/localmain
# Conflicts:
#	web/bun.lock
#	web/package.json
#	web/src/i18n/locales/en.json
#	web/src/i18n/locales/fr.json
#	web/src/i18n/locales/ja.json
#	web/src/i18n/locales/ru.json
#	web/src/i18n/locales/vi.json
2026-04-15 15:38:30 +08:00
feitianbubu d15e14b117 feat: include admin username in quota adjustment logs 2026-04-13 16:09:59 +08:00
skynono b4df9955f4 fix: isStream status in error logs instead of hardcoded false (#4195) 2026-04-12 17:41:26 +08:00
CaIon 2819e3a1d1 fix: improve login error handling to distinguish database errors from auth failures
ValidateAndFill now checks the DB query result and returns sentinel errors
(ErrDatabase, ErrInvalidCredentials, ErrUserEmptyCredentials) instead of
hardcoded Chinese strings. The controller maps each sentinel to the
appropriate i18n message, so users see "please contact admin" on DB errors
instead of a misleading "wrong password" message. Non-DB errors still
return a unified vague response to avoid leaking user existence.
2026-04-12 17:11:20 +08:00
CaIon ed7f839911 feat: improve model price error UX with role-aware messages and cleaner UI
- Backend: differentiate error messages for admin vs regular users in price.go
- Backend: include error_code in channel test response for structured error handling
- Frontend: render model_price_error as a styled card in Playground with admin nav button
- Frontend: show inline error details and settings link in channel test modal
- Frontend: parse error codes from both SSE and non-streaming API responses
- i18n: remove redundant "Settings" suffix from setting tab translations (en/fr/ru/ja/vi)
- i18n: update "Group & Model Pricing" translations across all locales
2026-04-11 17:19:38 +08:00
QuentinHsu 3a42b6cb25 feat(web): add subscription management and admin settings UI
* feat(web): add subscription management and admin settings UI

- Add subscription management module (plans, pricing, toggle status, and related dialogs/tables with Stripe/Creem integration notes)
- Add channel affinity (rules and cache stats), Waffo integration, performance, and Grok model sections to system settings, with extended types and section registry
- Add status code mapping validation/risk warnings, upstream update hooks, and utilities for channels; add available models and sidebar module cards to user profile
- Add chat2link route and useMinimumLoadingTime, useTableCompactMode shared hooks

Made-with: Cursor

* fix: remove duplicate GenerateOAuthCode and add missing TaskBulkUpdate

- remove duplicate GenerateOAuthCode from github.go since oauth.go already has the generic version.
- add model.TaskBulkUpdate for bulk update by upstream task_id strings, fixing task_video.go build failure.

* feat(router): add chat2link and subscriptions routes

- register /chat2link page route under authenticated layout.
- register /subscriptions/ page route under authenticated layout.
- update auto-generated routeTree type definitions and route mappings.

* feat(docker): add development environment setup with Docker Compose

- Introduced docker-compose.dev.yml for local development, including services for new-api, Redis, and PostgreSQL.
- Created Dockerfile.dev for backend-only builds, optimizing the development workflow.
- Updated makefile to include new commands for starting backend services and frontend development.

* feat(web): complete i18n coverage for setup wizard and add language switcher

- wrap all hardcoded English strings in setup-wizard, database-step, usage-mode-step, and complete-step with t() calls, covering step titles, descriptions, form validation messages, and fallback strings.
- add LanguageSwitcher component to the top-right corner of the setup page so users can switch language during initial setup.
- register 25 dynamic i18n keys in static-keys.ts and provide full translations for zh/en/ja/fr/ru/vi.

* feat(i18n): internationalize default version text in workspace-switcher

- remove hardcoded 'Unknown version' default, use t('Unknown version') for i18n fallback
- add "Unknown version" translation entries across all 6 locale files (zh/en/fr/ru/ja/vi)

* feat(i18n): add full i18n coverage for channel-affinity settings page

- replace Chinese t() keys with English keys across three channel-affinity components to align with new frontend i18n conventions.
- add 51 translation entries to all 6 locale files (en/zh/ja/fr/ru/vi) covering main page, rule editor, and cache stats dialog.
- register section-registry dynamic keys in static-keys.ts.

* feat(i18n): add full i18n coverage for Waffo payment settings page

- replace Chinese i18n keys with English keys in waffo-settings-section.tsx for consistency.
- wrap previously hardcoded labels (Pay Method Type / Pay Method Name) with t().
- add 26 Waffo-related translation entries across all 6 locale files (en/zh/fr/ru/ja/vi).

* feat(i18n): add missing translations for global model settings page

- add all 6 locale translations for 3 missing t() keys in global-settings-card.
- register dynamically used 'Grok' key in static-keys.ts for i18n scanner coverage.

* feat(i18n): add full i18n coverage for Grok model settings page

- add translations in all 6 locales (en/zh/fr/ja/ru/vi) for grok-settings-card t() calls.
- cover violation fee toggle, amount input, and official docs link labels.
- include section-registry descriptionKey translation entries.

* feat(i18n): add full i18n coverage for performance settings page

- migrate all t() keys from Chinese to English to align with project conventions.
- add translations for all 6 locales (en/zh/ja/fr/ru/vi) covering disk cache,
  system monitoring, log management, and stats dashboard sections.
- remove 71 obsolete Chinese-keyed entries from every locale file.

* fix(i18n): add 116 missing English translation keys across all locales

- scan all t() calls to identify English keys used in code but absent from locale files.
- add translations for zh/en/fr/ja/ru/vi, keeping key sets and sort order consistent.
- covers system-settings, channels, models, auth, wallet and other modules.

* fix(i18n): add missing translations for log cleanup quick-select and confirm dialog

- wrap quick-select button labels (24 hours ago / 7 days ago / 30 days ago) with t().
- replace hardcoded English strings in purge confirm dialog with t() calls and date interpolation.
- add 5 new translation keys across all 6 locale files (zh/en/fr/ja/ru/vi).

* refactor(web): unify all time display with dayjs formatting

- replace all toLocaleString/toLocaleDateString/toLocaleTimeString and manual padStart concatenation with dayjs.format().
- standardize output: datetime as YYYY-MM-DD HH:mm:ss, date as YYYY-MM-DD, time as HH:mm:ss.
- add formatDateTimeStr, formatDateStr, formatTimeStr dayjs-based helpers in lib/format.ts.
- update 12 files across core utils and feature components.

* refactor(web): replace native datetime-local input with DateTimePicker in announcements

- swap browser-native datetime-local for the project's DateTimePicker component to match the UI used in log cleanup and other pages.
- convert between Date objects and ISO strings to bridge the form's string-based schema.

* refactor(web): replace native HTML elements with design system components

- replace ~35 native <button> with <Button> across pricing, profile, channels modules
- replace native <input>/<textarea>/<label> with <Input>/<Textarea>/<Label> for consistent form styling
- replace native <table> with <Table> components, <details>/<summary> with <Collapsible>
- replace decorative <hr> with <Separator> to ensure global UI consistency

* refactor(web): enhance profile components with design system consistency

- update ProfileSecurityCard to use buttons for security actions, improving accessibility and styling.
- modify AccountBindingsTab layout to a grid for better responsiveness and visual alignment.
- refactor NotificationTab to utilize icons for notification methods, enhancing user experience and clarity.

* fix(i18n): complete i18n coverage for profile page components

- wrap passkey card status badges (enabled/disabled, backup state) and last-used text with t()
- fix hardcoded button labels in security dialogs (change password, access token, delete account)
- internationalize all 2FA dialog strings (setup, disable, backup codes)
- fix email bind dialog description and button state text missing i18n
- wrap remaining hardcoded strings in notification tab and checkin calendar
- add all missing translation entries to zh.json and en.json

* fix(i18n): enhance error messages with translations for deployment access and settings

- wrap connection error messages in DeploymentAccessGuard and IoNetDeploymentSettingsSection with t() for internationalization.
- add missing translation key for "io.net model deployment is not enabled or api key missing" in all locale files (en, fr, ja, ru, vi, zh).
2026-04-10 23:42:22 +08:00
CaIon 040e8c1da8 feat: replace quota input with amount-first UI and atomic quota adjustment
- Refactor token, redemption, and user quota inputs to prioritize monetary
  amount entry, with raw quota input collapsed by default
- Add atomic quota adjustment modal for users with add/subtract/override modes,
  bypassing batch update queue for immediate DB consistency
- Make user quota fields readonly in edit form; all modifications go through
  the dedicated adjust-quota modal via POST /api/user/manage
- Add DecreaseUserQuota `db` parameter for direct DB writes, matching
  IncreaseUserQuota behavior
- Support negative quota display in amount conversion helpers
- Add i18n keys for all new UI strings across all locales
2026-04-09 22:44:53 +08:00
CaIon 4d2993e4cc Merge remote-tracking branch 'origin/main' into nightly
# Conflicts:
#	web/src/helpers/render.jsx
#	web/src/hooks/usage-logs/useUsageLogsData.jsx
#	web/src/i18n/locales/en.json
2026-04-09 17:12:21 +08:00
yyhhyyyyyy 0220df8429 fix(channel-test): support tiered billing model tests (#4145)
Pre-fill BillingRequestInput from dto.Request before ModelPriceHelper,
so tiered_expr billing resolves param() from the structured request
instead of reading HTTP body (which is empty in channel-test context).

- attachTestBillingRequestInput: marshal dto.Request → RequestInput
- ResolveIncomingBillingExprRequestInput: early-return when pre-filled
- settleTestQuota / buildTestLogOther: align test settlement & logging
  with production TryTieredSettle / InjectTieredBillingInfo paths
2026-04-09 17:08:52 +08:00
Apple\Apple b8650b9e67 Merge branch 'main' into v2/main
# Conflicts:
#	.env.example
#	.github/ISSUE_TEMPLATE/bug_report.md
#	.github/ISSUE_TEMPLATE/bug_report_en.md
#	.github/ISSUE_TEMPLATE/config.yml
#	.github/ISSUE_TEMPLATE/feature_request.md
#	.github/ISSUE_TEMPLATE/feature_request_en.md
#	.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
#	.github/workflows/docker-image-alpha.yml
#	.github/workflows/docker-image-arm64.yml
#	.github/workflows/release.yml
#	.gitignore
#	Dockerfile
#	LICENSE
#	README.fr.md
#	README.ja.md
#	README.md
#	common/constants.go
#	common/email.go
#	common/endpoint_defaults.go
#	common/endpoint_type.go
#	common/gin.go
#	common/init.go
#	common/str.go
#	common/sys_log.go
#	common/topup-ratio.go
#	common/utils.go
#	constant/context_key.go
#	constant/endpoint_type.go
#	constant/env.go
#	controller/channel-test.go
#	controller/channel.go
#	controller/codex_oauth.go
#	controller/codex_usage.go
#	controller/console_migrate.go
#	controller/log.go
#	controller/midjourney.go
#	controller/misc.go
#	controller/model_meta.go
#	controller/model_sync.go
#	controller/option.go
#	controller/passkey.go
#	controller/pricing.go
#	controller/ratio_sync.go
#	controller/redemption.go
#	controller/relay.go
#	controller/secure_verification.go
#	controller/task.go
#	controller/token.go
#	controller/topup.go
#	controller/topup_creem.go
#	controller/topup_stripe.go
#	controller/usedata.go
#	controller/user.go
#	controller/video_proxy.go
#	controller/video_proxy_gemini.go
#	controller/wechat.go
#	docker-compose.yml
#	docs/installation/BT.md
#	docs/openapi/relay.json
#	dto/audio.go
#	dto/channel_settings.go
#	dto/claude.go
#	dto/embedding.go
#	dto/gemini.go
#	dto/openai_image.go
#	dto/openai_request.go
#	dto/openai_response.go
#	dto/openai_video.go
#	dto/ratio_sync.go
#	dto/rerank.go
#	dto/suno.go
#	dto/task.go
#	dto/user_settings.go
#	electron/package-lock.json
#	electron/package.json
#	go.mod
#	go.sum
#	logger/logger.go
#	main.go
#	middleware/auth.go
#	middleware/cache.go
#	middleware/cors.go
#	middleware/distributor.go
#	middleware/logger.go
#	middleware/rate-limit.go
#	middleware/request-id.go
#	model/log.go
#	model/main.go
#	model/midjourney.go
#	model/model_meta.go
#	model/option.go
#	model/pricing.go
#	model/redemption.go
#	model/task.go
#	model/token.go
#	model/topup.go
#	model/usedata.go
#	model/user.go
#	model/user_cache.go
#	relay/audio_handler.go
#	relay/channel/adapter.go
#	relay/channel/ali/adaptor.go
#	relay/channel/ali/dto.go
#	relay/channel/ali/image.go
#	relay/channel/ali/image_wan.go
#	relay/channel/ali/rerank.go
#	relay/channel/ali/text.go
#	relay/channel/api_request.go
#	relay/channel/aws/adaptor.go
#	relay/channel/aws/constants.go
#	relay/channel/aws/dto.go
#	relay/channel/aws/relay-aws.go
#	relay/channel/baidu/dto.go
#	relay/channel/baidu/relay-baidu.go
#	relay/channel/claude/adaptor.go
#	relay/channel/claude/constants.go
#	relay/channel/claude/relay-claude.go
#	relay/channel/cloudflare/relay_cloudflare.go
#	relay/channel/codex/adaptor.go
#	relay/channel/codex/constants.go
#	relay/channel/cohere/relay-cohere.go
#	relay/channel/coze/dto.go
#	relay/channel/coze/relay-coze.go
#	relay/channel/deepseek/adaptor.go
#	relay/channel/dify/dto.go
#	relay/channel/dify/relay-dify.go
#	relay/channel/gemini/adaptor.go
#	relay/channel/gemini/constant.go
#	relay/channel/gemini/relay-gemini-native.go
#	relay/channel/gemini/relay-gemini.go
#	relay/channel/minimax/adaptor.go
#	relay/channel/minimax/constants.go
#	relay/channel/minimax/relay-minimax.go
#	relay/channel/mistral/text.go
#	relay/channel/moonshot/adaptor.go
#	relay/channel/moonshot/constants.go
#	relay/channel/ollama/relay-ollama.go
#	relay/channel/openai/adaptor.go
#	relay/channel/openai/audio.go
#	relay/channel/openai/chat_via_responses.go
#	relay/channel/openai/constant.go
#	relay/channel/openai/relay-openai.go
#	relay/channel/openai/relay_responses.go
#	relay/channel/openrouter/dto.go
#	relay/channel/perplexity/adaptor.go
#	relay/channel/perplexity/relay-perplexity.go
#	relay/channel/replicate/adaptor.go
#	relay/channel/siliconflow/adaptor.go
#	relay/channel/task/ali/adaptor.go
#	relay/channel/task/doubao/adaptor.go
#	relay/channel/task/doubao/constants.go
#	relay/channel/task/gemini/adaptor.go
#	relay/channel/task/hailuo/adaptor.go
#	relay/channel/task/jimeng/adaptor.go
#	relay/channel/task/kling/adaptor.go
#	relay/channel/task/sora/adaptor.go
#	relay/channel/task/suno/adaptor.go
#	relay/channel/task/vertex/adaptor.go
#	relay/channel/task/vidu/adaptor.go
#	relay/channel/tencent/relay-tencent.go
#	relay/channel/vertex/adaptor.go
#	relay/channel/vertex/dto.go
#	relay/channel/volcengine/adaptor.go
#	relay/channel/xai/adaptor.go
#	relay/channel/xai/constants.go
#	relay/channel/xai/text.go
#	relay/channel/xunfei/relay-xunfei.go
#	relay/channel/zhipu/adaptor.go
#	relay/channel/zhipu/relay-zhipu.go
#	relay/channel/zhipu_4v/adaptor.go
#	relay/channel/zhipu_4v/constants.go
#	relay/channel/zhipu_4v/relay-zhipu_v4.go
#	relay/chat_completions_via_responses.go
#	relay/claude_handler.go
#	relay/common/override.go
#	relay/common/override_test.go
#	relay/common/relay_info.go
#	relay/common/relay_utils.go
#	relay/compatible_handler.go
#	relay/constant/relay_mode.go
#	relay/embedding_handler.go
#	relay/gemini_handler.go
#	relay/helper/model_mapped.go
#	relay/helper/price.go
#	relay/helper/stream_scanner.go
#	relay/helper/valid_request.go
#	relay/image_handler.go
#	relay/mjproxy_handler.go
#	relay/relay_task.go
#	relay/rerank_handler.go
#	relay/responses_handler.go
#	router/api-router.go
#	router/dashboard.go
#	router/main.go
#	router/relay-router.go
#	router/video-router.go
#	router/web-router.go
#	service/codex_credential_refresh.go
#	service/codex_oauth.go
#	service/convert.go
#	service/error.go
#	service/file_decoder.go
#	service/image.go
#	service/log_info_generate.go
#	service/midjourney.go
#	service/openai_chat_responses_mode.go
#	service/openaicompat/chat_to_responses.go
#	service/openaicompat/policy.go
#	service/quota.go
#	service/token_counter.go
#	service/user_notify.go
#	setting/chat.go
#	setting/config/config.go
#	setting/model_setting/claude.go
#	setting/model_setting/gemini.go
#	setting/model_setting/global.go
#	setting/model_setting/qwen.go
#	setting/operation_setting/status_code_ranges.go
#	setting/operation_setting/status_code_ranges_test.go
#	setting/ratio_setting/cache_ratio.go
#	setting/ratio_setting/exposed_cache.go
#	setting/ratio_setting/group_ratio.go
#	setting/ratio_setting/model_ratio.go
#	setting/reasoning/suffix.go
#	setting/system_setting/fetch_setting.go
#	types/error.go
#	types/price_data.go
#	types/relay_format.go
#	types/request_meta.go
#	types/rw_map.go
#	web/.gitignore
#	web/index.html
#	web/package.json
#	web/src/i18n/locales/en.json
#	web/src/i18n/locales/fr.json
#	web/src/i18n/locales/ja.json
#	web/src/i18n/locales/ru.json
#	web/src/i18n/locales/vi.json
2026-04-08 21:01:42 +08:00
CaIon 606a4eee96 feat(dashboard): add admin user analytics and fix chart labels
- Add GET /api/data/users endpoint for user-grouped quota data (admin only)
- Add user consumption ranking (horizontal bar, top 10) and user consumption
  trend (area chart) tabs visible only to admin users
- Fix mislabeled "消耗趋势" tab to "调用趋势" (shows call counts, not quota)
- Add processUserData helper for user ranking and trend data extraction
- Add i18n keys for new tabs across all 7 locales
2026-04-08 15:44:01 +08:00
bbbugg 07843d7898 fix(pricing): add filtering for pricing based on usable groups 2026-04-07 15:56:28 +08:00
RedwindA 12a48c620e feat(token): add batch API for fetching token keys
Add new endpoint POST /api/token/batch/keys to fetch multiple
token keys in a single request, improving performance when
exporting or copying multiple tokens.

- Backend: Add GetTokenKeysBatch controller and GetTokenKeysByIds model
- Backend: Add route with CriticalRateLimit and DisableCache middleware
- Frontend: Add fetchTokenKeysBatch helper function
- Frontend: Update useTokensData to use batch API for token export
2026-04-06 19:46:01 +08:00
CaIon 8fc0eb78e2 feat(billing): enhance task billing process with video input detection and updated pricing logic
- Added `EstimateBilling` function to check for video input in request metadata and return corresponding discount ratios.
- Updated `ModelPriceHelperPerCall` to incorporate new pricing logic based on model ratios and video input.
- Enhanced task billing logs to include model ratio information and adjusted calculations for actual quota based on additional multipliers.
- Introduced `renderTaskBillingProcess` to improve rendering of task billing information in the UI.
2026-04-06 15:54:55 +08:00
CaIon 670abee2f0 fix(EditChannelModal): enhance clipboard handling with error checks
Added checks to ensure clipboard functionality is available before attempting to read from it. Improved error handling during clipboard read operations to prevent unhandled exceptions.
2026-03-31 21:42:36 +08:00
CaIon e099117c61 refactor: use POST for account binding endpoints and normalize reset responses
- Switch /api/oauth/email/bind and /api/oauth/wechat/bind from GET to
  POST with JSON body for better REST semantics
- Normalize password reset endpoint to return consistent responses
- Apply url.QueryEscape to WeChat code parameter for robustness
2026-03-31 18:44:40 +08:00
CaIon 20399d3c8f fix: harden SSRF protection for unauthenticated and user-level endpoints
- Add ValidateURLWithFetchSetting check before fetching MJ image URLs
  in RelayMidjourneyImage (unauthenticated endpoint)
- Add ValidateURLWithFetchSetting check before fetching video URLs
  in VideoProxy (upstream-controlled URL)
- Enable ApplyIPFilterForDomain by default to prevent DNS rebinding
  bypass of SSRF protection
- Elevate FetchModels endpoint from AdminAuth to RootAuth
- Update frontend: mark domain IP filtering as recommended, update
  description and i18n translations (zh-CN/zh-TW/en/fr/ja/ru/vi)
2026-03-31 17:57:47 +08:00
Calcium-Ion 49eb533aaf Merge pull request #3381 from seefs001/feature/regex-ignored-upstream-models
feat: support regex-prefixed ignored upstream models
2026-03-23 15:02:44 +08:00
Seefs f40eb4e5d2 fix: oauth bind callback handling 2026-03-23 00:48:55 +08:00
Seefs 45f65c297b feat: support regex-prefixed ignored upstream models 2026-03-22 15:43:03 +08:00
RedwindA dcd0911612 fix: log management race condition, partial delete reporting, and UX issues
- Fix data race on gin.DefaultWriter during log rotation by adding LogWriterMu
- Report partial failure when some log files fail to delete instead of always returning success
- Fix misleading "logging disabled" banner shown before API responds
- Fix en.json translation for numeric validation message
2026-03-21 20:40:39 +08:00