Commit Graph

3382 Commits

Author SHA1 Message Date
huangzhenpc
507261efc7 恢复缺失的service/channel_state_reporter.go
- 修复编译错误:undefined: service.ReportChannelState
- 恢复渠道状态报告服务功能
- 包含ChannelStateInfo和SystemStateReport结构体

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 15:29:12 +08:00
huangzhenpc
04c59d1136 修复docker-compose-custom.yml构建配置
- 添加build配置段,指定Dockerfile构建镜像
- 修复镜像构建问题,现在可以正确编译最新代码
- 保持所有环境变量和网络配置不变

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 15:17:45 +08:00
huangzhenpc
8d4bdacca2 完整更新:恢复所有自定义配置
 已同步官方 v0.9.0-alpha.8
 已恢复 Footer 自定义页脚
 已恢复 Claude 穿透功能
 已恢复 Docker 自定义配置 (端口3099)
 已恢复 Channel 计费逻辑增强
 已创建更新手册和部署脚本

关键配置:
- docker-compose-custom.yml: 使用3099端口,连接现有mysql/redis
- controller/channel-billing.go: 包含渠道状态报告功能
- temp/: 包含更新手册和自动化脚本

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 14:24:11 +08:00
huangzhenpc
b25f1f8634 同步官方v0.9.0-alpha.8,保留自定义Footer和Claude穿透功能
- 更新到官方最新版本 (c826d06d)
- 保留自定义页脚品牌信息 (听泉claude提供)
- 保留Claude渠道请求穿透功能,支持PassThroughRequestEnabled设置
- 添加补丁文件便于后续维护

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 10:32:26 +08:00
Calcium-Ion
c826d06d2c Merge pull request #1627 from QuantumNous/feature/new-partner-intro
🤝 docs(README): Introduction to New Partners
2025-08-21 12:58:53 +08:00
t0ng7u
7c058bfee3 🤝 docs(README): Enhancing Partner Layout 2025-08-21 12:51:49 +08:00
t0ng7u
b5e55c81d4 🤝 docs(README): Introduction to New Partners 2025-08-21 12:42:19 +08:00
CaIon
4d0037a40c fix(topup): update TradeNo field to include varchar type and index for better database performance 2025-07-20 19:20:37 +08:00
Calcium-Ion
f87054895e Merge pull request #1402 from feitianbubu/pr/ali-embedding-support-base64
fix: ali embedding support base64
2025-07-20 15:00:23 +08:00
feitianbubu
5b869376ab fix: ali embedding support base64 2025-07-20 12:05:20 +08:00
Xyfacai
c674c3561a fix(response): tools 需要处理的参数很少 使用 map 2025-07-20 11:21:57 +08:00
Xyfacai
7aa2972c3f fix(price): 未设置价格,错误返回模型价格匹配的名字 2025-07-20 10:12:36 +08:00
Xyfacai
986558fea7 fix(db): 修复 db migration 报错过多可能卡住的隐患 2025-07-20 10:11:35 +08:00
CaIon
a3059597fb fix: replace NewError with NewOpenAIError for improved error handling in multiple handlers 2025-07-19 11:29:31 +08:00
CaIon
d19a6914f9 fix: create NewOpenAIError function for improved error handling in Relay 2025-07-19 11:28:18 +08:00
CaIon
4313ede132 fix: set ErrorType to OpenAIError in RelayErrorHandler for better error categorization 2025-07-19 11:15:34 +08:00
IcedTangerine
952b679ca3 Merge pull request #1352 from wzxjohn/feature/simple_stripe
Add stripe support and fix wrong top up loading state
2025-07-18 22:00:52 +08:00
Calcium-Ion
fa02b5150c Merge pull request #1362 from KamiPasi/patch-1
🔧 refactor(user_usable_group): enhance concurrency control with mutex…
2025-07-18 20:53:29 +08:00
Calcium-Ion
63a1904242 Merge pull request #1393 from feitianbubu/pr/fix-mysql-default-false
fix: mySQL does not support default false
2025-07-18 20:50:28 +08:00
Calcium-Ion
1e3450fdcb Merge pull request #1381 from feitianbubu/pr/task-origin-name
feat: video priority use origin model name
2025-07-18 20:49:53 +08:00
Calcium-Ion
5541026b86 Merge pull request #1190 from feitianbubu/fix-nil-request-id
fix: default request ID to 'SYSTEM' for background tasks
2025-07-18 20:48:15 +08:00
Calcium-Ion
c36c920b34 Merge pull request #1349 from feitianbubu/pr/fix-kling-image-mode-name
fix: KlingText2VideoRequest image and model_name
2025-07-18 20:47:10 +08:00
Calcium-Ion
514fea65c4 Merge pull request #1363 from feitianbubu/pr/add-jimeng-image
feat: 增加即梦生图功能
2025-07-18 20:45:49 +08:00
feitianbubu
e269b3bfdd fix: mySQL does not support default false 2025-07-18 13:52:16 +08:00
feitianbubu
0862a9bfa7 feat: add jimeng image -- fix alpha 2025-07-18 11:47:27 +08:00
t0ng7u
4e2a3d61dc Merge remote-tracking branch 'origin/alpha' into alpha 2025-07-18 09:38:19 +08:00
Xyfacai
b485f2e42e fix(image): 只有 dalle模型才受 size、quality 影响价格 2025-07-18 00:30:49 +08:00
t0ng7u
16e32c3f67 📚 docs: add comprehensive Web-interface API reference (excluding Relay)
A new Markdown file `docs/api/web_api.md` has been added that documents all backend REST endpoints used by the Web UI.

Details:
• Lists every `/api`, `/dashboard`, and `/v1/dashboard` route relevant to the Web front-end
• Excludes every Relay-specific path to keep scope focused on Web operations
• Groups endpoints by functional module (initialisation, public info, user, channel, token, logging, etc.)
• Specifies HTTP method, path, required auth level, and concise description for each entry
• Includes an auth-level legend and update-date placeholder for future maintenance

No application logic was modified; this is documentation-only and improves developer onboarding and API discoverability.
2025-07-17 23:50:56 +08:00
t0ng7u
15f65bb558 🌐 feat: add configurable USD exchange-rate support across backend & frontend
Backend
- setting/payment.go: introduce default `USDExchangeRate` (7.3)
- model/option.go:
  • inject `USDExchangeRate` into `InitOptionMap`
  • persist & sync value in `updateOptionMap`
- controller/misc.go: expose `usd_exchange_rate` via `/api/status`

Frontend
- OperationSetting.js & SettingsGeneral.js:
  • extend state/inputs with `USDExchangeRate`
  • add form field “美元汇率 (non-top-up rate, pricing only)”
- ModelPricing.js already consumes `status.usd_exchange_rate`; no change needed

API
- Administrators can update the rate via `PUT /api/option` (key: `USDExchangeRate`)
- All clients receive the latest rate through `GET /api/status`

This closes the end-to-end flow for displaying model prices in both USD and CNY based on a configurable exchange rate.
2025-07-17 23:04:45 +08:00
CaIon
b161d6831f fix: 修复playground优先级失效 2025-07-17 22:26:38 +08:00
CaIon
969953039f Merge remote-tracking branch 'origin/alpha' into alpha 2025-07-17 22:25:26 +08:00
t0ng7u
f1506ed5da 💸 feat(model-pricing): add “show with recharge price” toggle and USD/CNY selector
* Introduced `showWithRecharge` switch in the actions bar to display model prices based on recharge cost.
* Added a `Select` dropdown (USD / CNY) that appears only when the recharge-price mode is enabled.
* Implemented `displayPrice()` helper to:
  * Convert USD prices to recharge prices using `status.price` and `status.usd_exchange_rate`.
  * Format output according to the selected currency.
* Updated price rendering for both quota types to use the new helper and respect K/M unit conversion.
* Removed the old currency switch from the header, retaining only the K/M unit toggle.
* Extended `SearchAndActions` memo dependencies; imported `Select` from Semi UI.
* Minor refactors and comment clean-up.

No breaking changes.
2025-07-17 22:07:06 +08:00
CaIon
9a239d9e13 refactor: initialize channel cache after channel operations to ensure data consistency 2025-07-17 20:04:26 +08:00
CaIon
a5da09dfb9 feat: 添加手动输入和文件上传模式切换功能,支持密钥搜索和高亮显示 2025-07-17 19:53:33 +08:00
CaIon
6f81f2d143 fix: 修复vertex渠道编辑密钥功能失效 2025-07-17 19:29:28 +08:00
Calcium-Ion
0b877ca8a3 Merge pull request #1383 from feitianbubu/pr/fix-gemini-and-claude-completions
fix: usage cost(any) to support claude and gemini
2025-07-17 19:16:55 +08:00
Calcium-Ion
2911b9cd04 Merge pull request #1368 from RedwindA/fix/embedding-test
fix: 修复Gemini渠道的向量模型测试
2025-07-17 19:16:10 +08:00
Calcium-Ion
6b3f1ab0e4 Merge pull request #1384 from QuantumNous/RequestOpenAI2ClaudeMessage
feat: 改进 RequestOpenAI2ClaudeMessage 和添加 claude web search 计费
2025-07-17 19:15:54 +08:00
Calcium-Ion
2c15655b08 Merge pull request #1387 from feitianbubu/alpha
fix: playground chat
2025-07-17 19:14:34 +08:00
t0ng7u
afa9c650fe 💱 feat(model-pricing): add currency (USD/CNY) & token unit (M/K) toggles to Model Pricing table
* Introduced a currency switch to toggle prices between USD and CNY.
  * CNY prices are calculated by multiplying USD prices with the site-wide `price` rate from `/api/status`.
* Added a second switch to display prices per 1 M tokens or per 1 K tokens.
  * When “K” is selected, prices are divided by 1 000 and labels are updated accordingly.
* Extended component state with `currency` and `tokenUnit` variables.
* Integrated `StatusContext` to retrieve and memoize the current exchange rate.
* Updated price rendering logic and labels to reflect selected currency and token unit.
* Minor UI tweaks: kept Switch components compact and aligned with the table header.

No breaking changes.
2025-07-17 19:07:11 +08:00
IcedTangerine
28d8d82ded Merge pull request #1369 from RedwindA/fix/xai-non-stream
fix xai-non-stream
2025-07-17 17:56:19 +08:00
feitianbubu
a100baf57f fix: playground chat 2025-07-16 23:47:59 +08:00
feitianbubu
d892bfc278 fix: usage cost(any) to support claude and gemini 2025-07-16 16:58:34 +08:00
feitianbubu
4369b18fbf feat: priority use origin model name 2025-07-16 15:38:51 +08:00
wzxjohn
fb9b5d31e8 Merge branch 'alpha' into feature/simple_stripe 2025-07-16 10:39:11 +08:00
同語
3bf0748389 refactor: layout logic to enhance front-end responsiveness
Merge pull request #1377 from QuantumNous/refactor/layout
2025-07-16 04:53:15 +08:00
t0ng7u
cf46b89814 🧹 refactor(PageLayout): remove unused state variables
Removed unused `userState` and `statusState` bindings from `PageLayout.js`
while retaining their dispatch functions for authentication and status
management. Confirmed correct use of array destructuring to skip the
unused toggle function returned by `useSidebarCollapsed`.

This change introduces no functional differences and solely improves
readability and maintainability.
2025-07-16 04:50:23 +08:00
t0ng7u
3360b34af9 🐛 fix: SSR hydration mismatch in mobile detection & clean up sidebar style
- Added a server-snapshot fallback (`() => false`) to `useIsMobile` to ensure
  consistent results between server-side rendering and the browser, preventing
  hydration mismatches.
- Removed a redundant ternary in `PageLayout` sidebar styles, replacing
  `isMobile ? 'fixed' : 'fixed'` with a single `'fixed'` value for clarity.

These changes improve SSR reliability and tidy up inline styles without
affecting runtime functionality.
2025-07-16 04:46:31 +08:00
t0ng7u
4558eb41fc 🎨 feat(sidebar): replace custom collapse button with Semi UI Button
* Replaced the handmade collapse/expand div with Semi UI `<Button>`
  * Uses `theme="outline"` and `type="tertiary"` for outlined style
  * Shows icon + text when sidebar is expanded, icon-only when collapsed
* Added `iconOnly` prop and dynamic padding to remove extra text area in collapsed state
* Ensured full-width layout with consistent padding for both states
* Updated imports to include `Button` from `@douyinfe/semi-ui`
* Maintains tooltip content for accessibility and better UX
2025-07-16 04:35:19 +08:00
t0ng7u
bbc5584f80 ♻️ refactor(auth, ui): simplify Loading component & optimize OAuth2Callback flow
* Removed `prompt` prop from `Loading` and switched to built-in Spin indicator with default size `small`
* Dropped overlay background to make the spinner more reusable
* Replaced custom text span; callers can now supply tip via their own UI if needed
* Cleaned up `OAuth2Callback`:
  - Eliminated unused state/variables
  - Added MAX_RETRIES with incremental back-off
  - Centralized error handling via try/catch
  - Streamlined navigation logic on success/failure
  - Updated imports to match new Loading signature

BREAKING CHANGE: `Loading` no longer accepts a `prompt` prop. Update all invocations accordingly.
2025-07-16 04:21:13 +08:00