Skip to content

main -> alpha - #1962

Merged
seefs001 merged 23 commits into
alphafrom
main
Oct 3, 2025
Merged

main -> alpha#1962
seefs001 merged 23 commits into
alphafrom
main

Conversation

@seefs001

@seefs001 seefs001 commented Oct 3, 2025

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added Doubao Video channel with icon and options.
    • Introduced Google Gemini chat format/interface.
    • Header override now supports {api_key} with UI templates.
    • Video task billing adjusts by actual token usage.
  • UI

    • Updated footer links/style; refined footer visibility on specific pages.
  • Documentation

    • Added Japanese README and language link; noted machine translation.
    • Updated payment (EPay + Stripe), request format conversions, Gemini/Claude API sections, and env var notes.
  • i18n

    • Expanded EN/FR translations (incl. Passkey/2FA).
  • Chores

    • Default Docker Compose switches to PostgreSQL.
    • Upgraded Go toolchain and dependencies.

t0ng7u and others added 23 commits September 27, 2025 18:47
…onent pages

- Replace blanket console route footer hiding with specific page targeting
- Only hide footer on pages that use CardPro component:
  * /console/channel (channels management)
  * /console/log (usage logs)
  * /console/redemption (redemption codes)
  * /console/user (user management)
  * /console/token (token management)
  * /console/midjourney (midjourney logs)
  * /console/task (task logs)
  * /console/models (model management)
  * /pricing (pricing page)
- Footer now displays on other console pages (dashboard, settings, topup, etc.)
- Improves UI consistency by showing footer where CardPro's internal pagination isn't used

This change ensures footer is only hidden when CardPro component provides its own
pagination/footer functionality, while preserving footer visibility on other pages
that benefit from the global footer navigation.
feat(i18n): add and update French translations
…onent pages

- Replace blanket console route footer hiding with specific page targeting
- Only hide footer on pages that use CardPro component:
  * /console/channel (channels management)
  * /console/log (usage logs)
  * /console/redemption (redemption codes)
  * /console/user (user management)
  * /console/token (token management)
  * /console/midjourney (midjourney logs)
  * /console/task (task logs)
  * /console/models (model management)
  * /pricing (pricing page)
- Footer now displays on other console pages (dashboard, settings, topup, etc.)
- Improves UI consistency by showing footer where CardPro's internal pagination isn't used

This change ensures footer is only hidden when CardPro component provides its own
pagination/footer functionality, while preserving footer visibility on other pages
that benefit from the global footer navigation.
…le-footer

# Conflicts:
#	web/src/components/table/channels/modals/EditChannelModal.jsx
#	web/src/hooks/common/useSidebar.js
- Removed the 'chatnio' link from the footer.
- Added new links for 'CoAI' and 'GPT-Load' in the footer.
- Updated the localization key for '基于New API的项目' to '友情链接' for better clarity.
- Adjusted the design of the footer to improve layout and visibility of the developer credit.
✨ feat(layout): refine footer visibility logic to target CardPro component pages
@coderabbitai

coderabbitai Bot commented Oct 3, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a new Doubao video channel (type 54) with task adaptor, token-based billing for video tasks, common Claude header handling, header override processing with {api_key} substitution, Gemini config enhancement, Docker default DB switched to PostgreSQL, Go/tooling dependency bumps, README updates including Japanese localization, and UI/i18n tweaks.

Changes

Cohort / File(s) Summary
Docs and localization updates
README.md, README.en.md, README.fr.md, README.ja.md
Add Japanese README and language links; update features (EPay/Stripe, Gemini format/API, request format conversions); rename API labels; clarify env vars and caching notes.
New Doubao video channel & mapping
constant/channel.go, web/src/constants/channel.constants.js, web/src/helpers/render.jsx
Introduce ChannelTypeDoubaoVideo=54 with base URL; add UI option and icon for Doubao Video.
Doubao video task adaptor (new feature)
relay/channel/task/doubao/adaptor.go, relay/channel/task/doubao/constants.go, relay/relay_adaptor.go, controller/channel-test.go
Implement Doubao task adaptor (init/validate/build/do/parse/fetch); export model list and channel name; wire into adaptor factories; skip channel test for Doubao video.
Video task billing logic
controller/task_video.go, relay/common/relay_info.go
Add token-based settle/refund against pre-charge using model/group ratios; extend TaskInfo with completion_tokens and total_tokens.
Header handling refactor
relay/channel/api_request.go, relay/channel/claude/adaptor.go, relay/channel/aws/adaptor.go
Add processHeaderOverride with {api_key} substitution; centralize Claude header ops via CommonClaudeHeadersOperation; update AWS adaptor to use common handler.
Gemini config extension
dto/gemini.go
Add ImageConfig field to GeminiChatGenerationConfig.
Runtime/platform changes
docker-compose.yml, go.mod
Switch default DB from MySQL to PostgreSQL; update healthcheck and DSN; introduce postgres service/volume; bump Go to 1.25.1 and upgrade json/arch deps.
Footer and layout
web/src/components/layout/Footer.jsx, web/src/components/layout/PageLayout.jsx
Rework footer links/branding; change footer visibility to a specific path list.
Channel edit modal UX
web/src/components/table/channels/modals/EditChannelModal.jsx
Revise header override UI, add template insertion and supported variable {api_key} hints.
i18n updates
web/src/i18n/locales/en.json, web/src/i18n/locales/fr.json
Add keys for variables/templates and security/Passkey/2FA; adjust wording; remove some obsolete keys.
Minor web formatting/tidy
web/jsconfig.json, web/src/components/common/modals/TwoFactorAuthModal.jsx, web/src/components/table/mj-logs/MjLogsFilters.jsx, web/src/components/table/task-logs/TaskLogsColumnDefs.jsx, web/src/components/table/task-logs/TaskLogsFilters.jsx, web/src/components/table/usage-logs/UsageLogsFilters.jsx, web/src/helpers/api.js, web/src/hooks/common/useSidebar.js, web/src/pages/Setting/Operation/SettingsGeneral.jsx, web/src/pages/Setting/Operation/SettingsMonitoring.jsx, web/src/pages/Setting/Payment/SettingsPaymentGateway.jsx, web/src/pages/Setting/Ratio/ModelRatioSettings.jsx, web/src/components/topup/*
Formatting and small text/layout tweaks; no behavioral changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Web as Web Console
  participant API as New API
  participant Doubao as Doubao Video API
  participant Billing as Billing/Ratios

  rect rgba(230,245,255,0.6)
  note right of Web: Submit video generation task
  User->>Web: Configure model/prompts/assets
  Web->>API: POST /task (channel=doubao-video)
  API->>API: Validate & build Doubao request
  API->>Doubao: Create task (auth + headers)
  Doubao-->>API: task_id
  API-->>Web: task_id
  end

  rect rgba(240,255,240,0.6)
  note right of API: Poll task status
  Web->>API: GET /task/:id
  API->>Doubao: Fetch status/result
  Doubao-->>API: status + tokens/urls
  API->>Billing: Compute final quota using model & group ratios
  alt delta > 0
    Billing->>API: Deduct difference
  else delta < 0
    Billing->>API: Refund difference
  else exact
    Billing->>API: No adjustment
  end
  API-->>Web: Status/result (url, progress, tokens)
  end
Loading
sequenceDiagram
  autonumber
  participant Admin as Admin UI
  participant API as New API
  participant Upstream as Upstream API

  rect rgba(255,248,230,0.6)
  note over Admin,API: Header override with {api_key}
  Admin->>API: Save header_override JSON (uses {api_key})
  end

  rect rgba(245,245,255,0.6)
  note right of API: Request execution
  API->>API: processHeaderOverride({api_key}→real key)
  API->>Upstream: Request with overridden headers
  Upstream-->>API: Response
  API-->>Admin: Result
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • creamlike1024
  • Calcium-Ion

Poem

In cables bright, new streams now flow,
A Doubao spark, where videos grow.
Tokens tally, debts made right,
Headers swap the keys in flight.
Postgres hums, the engines sing—
Hop, hop! I ship this shiny thing. 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch main

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4137120 and d5e01a3.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (41)
  • README.en.md (5 hunks)
  • README.fr.md (5 hunks)
  • README.ja.md (1 hunks)
  • README.md (6 hunks)
  • constant/channel.go (2 hunks)
  • controller/channel-test.go (1 hunks)
  • controller/task_video.go (2 hunks)
  • docker-compose.yml (3 hunks)
  • dto/gemini.go (2 hunks)
  • go.mod (5 hunks)
  • relay/channel/api_request.go (5 hunks)
  • relay/channel/aws/adaptor.go (1 hunks)
  • relay/channel/claude/adaptor.go (2 hunks)
  • relay/channel/task/doubao/adaptor.go (1 hunks)
  • relay/channel/task/doubao/constants.go (1 hunks)
  • relay/common/relay_info.go (1 hunks)
  • relay/relay_adaptor.go (3 hunks)
  • web/jsconfig.json (1 hunks)
  • web/src/components/common/modals/TwoFactorAuthModal.jsx (1 hunks)
  • web/src/components/layout/Footer.jsx (3 hunks)
  • web/src/components/layout/PageLayout.jsx (1 hunks)
  • web/src/components/settings/SystemSetting.jsx (9 hunks)
  • web/src/components/table/channels/modals/EditChannelModal.jsx (7 hunks)
  • web/src/components/table/mj-logs/MjLogsFilters.jsx (1 hunks)
  • web/src/components/table/task-logs/TaskLogsColumnDefs.jsx (1 hunks)
  • web/src/components/table/task-logs/TaskLogsFilters.jsx (1 hunks)
  • web/src/components/table/usage-logs/UsageLogsFilters.jsx (1 hunks)
  • web/src/components/topup/RechargeCard.jsx (7 hunks)
  • web/src/components/topup/index.jsx (6 hunks)
  • web/src/components/topup/modals/PaymentConfirmModal.jsx (1 hunks)
  • web/src/constants/channel.constants.js (1 hunks)
  • web/src/constants/console.constants.js (1 hunks)
  • web/src/helpers/api.js (0 hunks)
  • web/src/helpers/render.jsx (2 hunks)
  • web/src/hooks/common/useSidebar.js (1 hunks)
  • web/src/i18n/locales/en.json (2 hunks)
  • web/src/i18n/locales/fr.json (1 hunks)
  • web/src/pages/Setting/Operation/SettingsGeneral.jsx (1 hunks)
  • web/src/pages/Setting/Operation/SettingsMonitoring.jsx (1 hunks)
  • web/src/pages/Setting/Payment/SettingsPaymentGateway.jsx (5 hunks)
  • web/src/pages/Setting/Ratio/ModelRatioSettings.jsx (4 hunks)

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 and usage tips.

@seefs001
seefs001 merged commit 8a01f09 into alpha Oct 3, 2025
4 of 5 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Oct 14, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants