fengsilin
a406c94b93
feat(user-migration): add root migration dashboard
1 week ago
fengsilin
87a0f94975
refactor: remove user-channel-ratio feature
删除用户渠道倍率(UserChannelRatio)功能,清理全链路相关代码:
后端删除 model/controller/router 层实现,前端删除 UI 组件和计费展示逻辑。
同时恢复 Token 分组选择和价格侧边栏分组过滤器的注释代码。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 week ago
fengsilin
3cf84775f2
feat: add channel metrics collector, fix search pagination and vendor sort order
- Register Prometheus ChannelCollector in GetMetrics() sync.Once block
- Add MetricsMiddleware to /v1 and /v1beta relay router groups when metrics enabled
- Remove public_name field from channel creation form and validation
- Restore InvitationCard in topup page
- Extract fetchSearchPage helper in useModelsData to eliminate ~50 lines of duplication; fix setSearching with finally block; use Axios params for URL encoding; fix missing vendor_counts update during paginated search
- Fix vendor ordering in HomePricingFilters to follow vendorsMap sort_order; fix O(n²) Array.includes to use Set
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 weeks ago
fengsilin
d32050d081
fix: restore login widget bundle and guard custom nav link
3 weeks ago
fengsilin
49c6755622
feat: add customLink to navigation hook with filtering logic
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3 weeks ago
fengsilin
ea0d4e5cde
refactor: 完整删除前端渠道选择和默认通道 UI
1 month ago
fengsilin
69ed7d85d7
feat(sidebar): 添加监控外部链接菜单项
在管理员菜单区域新增「监控」入口,仅 root 用户可见,
点击后在新窗口打开外部监控面板。支持在侧边栏模块管理中切换显示/隐藏。
同时在 renderWrapper 中添加外部链接的通用支持。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 month ago
fengsilin
e6b4a06557
feat(logs): 隐藏使用日志中的分组信息展示
使用注释方式隐藏分组列和分组倍率标签,便于后续恢复:
1. 注释 UsageLogsColumnDefs.jsx 中的分组列定义
2. 注释 useUsageLogsData.jsx 中的 COLUMN_KEYS.GROUP 和默认可见性配置
3. 将计费详情中的"分组倍率"改为"倍率"
后端计费逻辑不变,仍正常应用分组倍率。
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
1 month ago
fengsilin
e1b6aff7e1
fix(log): 对普通用户隐藏 Chat ID 和 Upstream ID
后端 GetUserLogs 返回前清空 chat_id/upstream_id(omitempty 不输出),
前端搜索框和展开行详情加 isAdminUser 守卫。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 month ago
fengsilin
2d1a8d2f28
fix: 设置 chat_id + 优化日志查询参数构建
- Claude 和 OpenAI Responses 转发中设置 RelayChatID
- 日志查询使用 URLSearchParams 替代手动字符串拼接
- 日志查询日期范围改为可选,不再强制默认今天
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 month ago
fengsilin
3e86f523db
feat(playground): temperature/top_p 参数互斥设置
部分上游模型不允许同时设置 temperature 和 top_p,新增管理员可配置的
模型前缀列表,匹配的模型在 Playground 中自动互斥切换两个参数。
- 后端新增 PlaygroundSetting 配置 + GET /api/playground/config 公开端点
- 运营设置页面新增 Playground 互斥模型前缀编辑 textarea
- Playground 自动检测模型名匹配,启用一个参数自动禁用另一个
- 默认包含 deepseek-v4-flash/pro、deepseek-reasoner、o1-/o3-/o4-、gpt-5
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 month ago
fengsilin
b026f6bc04
feat: 用户倍率前端展示 + 渠道下拉选择 + 上游调试日志
- UserRatioSection 渠道 ID 输入改为带搜索的下拉选择器
- 使用日志详情、计费过程、展开行均显示用户倍率
- renderLogContent suffix 统一追加,消除 4 处重复
- 提取 dumpUpstreamRequest 辅助函数,debug 日志走 SysLog
Co-Authored-By: Claude <noreply@anthropic.com>
1 month ago
fengsilin
b2cb7bcf60
feat: record chat and upstream ids in usage logs
1 month ago
fengsilin
332d5a62f2
feat: support codex api key credentials
1 month ago
fengsilin
73d10b5799
feat: 错误日志记录上游 request-id 和响应体,Playground 渠道路由改为 header 传递
- 错误日志新增 upstream_request_id(从 Anthropic/OpenAI 响应 header 提取)和 upstream_body(截断 2KB)
- 修复 RelayErrorHandler 内部 WithOpenAIError/NewOpenAIError 分支丢失上游字段的 bug
- Playground 渠道和分组改为通过 X-Channel-Id/X-Group header 传递,而非 body 字段
- Distributor 中间件支持从 header 回退读取 channel_id 和 group
Co-Authored-By: Claude <noreply@anthropic.com>
1 month ago
fengsilin
8bb2883d7e
feat(home): 首页定价卡片添加"去体验"按钮,跳转 Playground
- PricingCardView 新增 showTryButton 属性,点击跳转 Playground 并预选模型
- 移除 PricingCardView 中未使用的 props (selectedGroup, currency 等)
- 首页页脚路由重命名: terms→user-agreement, usage-policy→privacy-policy
- i18n: "操练场"更名为"对话"
Co-Authored-By: Claude <noreply@anthropic.com>
1 month ago
fengsilin
74cc8c0d56
feat(playground): 添加渠道选择功能,支持指定渠道体验模型
- 新增 /api/user/model_channels 接口,返回模型可用渠道及默认渠道
- Playground 设置面板添加渠道选择下拉框
- Distribute 中间件支持从请求体读取 channel_id 指定渠道
- 支持 URL 参数 ?model=xxx 直接选择模型
Co-Authored-By: Claude <noreply@anthropic.com>
1 month ago
fengsilin
518f1ab87f
refactor(frontend): 移除拖拽排序,改为 sort_order 数值输入
回退 @dnd-kit 拖拽实现,改为在编辑弹窗中直接设置 sort_order 数值:
- 模型编辑弹窗新增「排序」InputNumber 字段
- 供应商编辑弹窗新增「排序」InputNumber 字段
- 模型表格新增 sort_order 显示列
- 移除 @dnd-kit 依赖及所有 DnD 相关代码
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 month ago
fengsilin
65880fc69b
feat(frontend): Vendor Tab 和 Model 表格支持拖拽排序,移除定价页字母排序
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 month ago
fengsilin
93e331b624
feat: 支持 LOGO_FILE_PATH 环境变量指定本地 Logo,优化定价与语言设置
- 新增 LOGO_FILE_PATH 环境变量,优先级高于数据库配置,支持本地文件服务
- 渠道定价高级字段(缓存/图片/音频)不再回退全局默认值,未设置直接返回 0
- 缓存价格单位从表头移到具体价格值,新增渠道 ID 复制功能
- 修复默认语言在用户已有偏好时仍被覆盖的问题
- img 标签统一添加 referrerPolicy/crossOrigin 防止跨域问题
- 新增缓存倍率和最小余额阈值的详细说明文本
Co-Authored-By: Claude <noreply@anthropic.com>
1 month ago
fengsilin
e8ade3abae
feat(payment): 集成支付宝当面付扫码支付 + 补全前端 i18n 硬编码中文
支付宝支付:
- 后端:新增 topup_alipay.go、payment_alipay.go,实现当面付(扫码支付)下单、
回调验签、订单状态查询完整流程,支持 RSA2 签名
- 前端:新增 QRCodePayModal 通用二维码支付弹窗(泛化微信支付弹窗)、
SettingsPaymentGatewayAlipay 管理配置页面、充值流程接入支付宝
- 充值历史:管理员视图新增用户邮箱列,后端 fillTopUpEmails 批量填充
i18n 补全:
- 54 个缺失翻译 key 添加到全部 7 个 locale 文件(zh-CN/zh-TW/en/fr/ja/ru/vi)
- 涵盖渠道名称、仪表盘标签、兑换码状态、控制台时间筛选、Playground 错误消息、
Dashboard 设置页面提示等
- 14 个源码文件中约 31 处 showError/showSuccess/showWarning 硬编码中文改用 t()
- ChannelsColumnDefs、helpers、services 中散落的硬编码中文统一国际化
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 months ago
fengsilin
befde35afa
feat(i18n): 全面国际化前端硬编码中文文本
将 14 个源码文件中的硬编码中文 UI 文本统一包裹到 t()/i18n.t() 调用,
覆盖登录注册、首页、设置页、工具函数等核心模块,并为 7 个语言文件
补充约 80+ 翻译键;修复 zh-CN.json 值误用繁体问题。
Co-Authored-By: Claude <noreply@anthropic.com>
2 months ago
fengsilin
a95331a85f
chore: 隐藏侧边栏聊天子菜单、账户管理及隐私价格设置
- 注释侧边栏"聊天"子菜单,保留"操练场"
- 隐藏个人设置中的账户管理模块
- 隐藏其他设置中的价格设置和隐私设置Tab
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 months ago
unknown
e1f10fec95
add localiazed
3 months ago
winter
08164cd0ae
fix
3 months ago