fengsilin
d5157a779c
fix(pricing): 统一 sort_order 排序逻辑,有 meta 但未设置的不优先
之前有 meta 记录但 sort_order=999999 的模型排在没 meta 记录的模型前面,
导致部分"未设置排序"的模型仍然挤在前面。现在统一处理:不论是否有
meta 记录,sort_order=999999 的都视为未设置,排在后面。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
před 2 týdny
fengsilin
54e53108ec
fix(sort): sort_order 默认值改为 999999,简化排序逻辑
未设置排序的记录 sort_order=999999 自然排在后面,无需 CASE WHEN。
- GORM 默认值 default:0 → default:999999
- 数据库迁移:将现有 sort_order=0 的记录更新为 999999
- 回退 CASE WHEN 排序逻辑,恢复简单的 sort_order ASC, id ASC
- 前端编辑弹窗默认值同步改为 999999
- 表格列中 999999 显示为空(表示未设置)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
před 2 týdny
fengsilin
3b99c83e32
fix(sort): sort_order=0 的记录排到最后,非0值按升序排列
模型和供应商查询统一排序规则:sort_order=0 视为未设置排到最后,
非0值按升序排列。涉及 GetAllModels、SearchModels、GetAllVendors、
SearchVendors 以及 pricing 的内存排序。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
před 2 týdny
fengsilin
e507897f21
feat(pricing): updatePricing 按 sort_order 排序 vendors 和 models
- vendorsList 按 vendor.SortOrder 升序排列,相同则按 ID 排序
- pricingMap 按 model.SortOrder 升序排列,相同则按模型名字典序
- 修复默认通道设置的 API 错误响应未正确展示的问题
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
před 2 týdny
fengsilin
3a29f3772f
feat(channel): 添加模型默认通道功能,支持优先路由和卡片标识
- 新增 is_default 字段和缓存层,支持管理员为模型指定默认通道
- Distribute 中间件优先级调整:Token 指定 → 默认通道 → 亲和性 → 随机
- 模型定价卡片和详情弹窗展示默认通道 amber 标识
- 管理后台定价页面新增星标切换默认通道
- 新增 set_default / clear_default API 和 6 个单元测试
- 简化卡片价格显示(移除内联缓存价格,改为详情弹窗展示)
Co-Authored-By: Claude <noreply@anthropic.com>
před 2 týdny
fengsilin
387f6c1ae0
feat(pricing): 定价数据源切换到渠道表,新增缓存价格展示
- 后端 pricing API 从 channel_pricings 表获取实际定价,选取最便宜渠道
- 提取 applyGlobalDefault 辅助函数消除全局回退逻辑重复
- price.go 重构扩展比率为局部变量,简化回退逻辑
- 定价卡片新增缓存读取/创建价格,改为两行布局防止溢出
- ChannelPricingCard 缓存列显示实际价格而非倍率
- 修复移动端 hero 区域 padding 过大
- 默认标签页标题改为 Loading...
- 新增缓存读取/创建 i18n 翻译(7 语言)
Co-Authored-By: Claude <noreply@anthropic.com>
před 2 týdny
fengsilin
5c57f692a5
feat: enhance channel pricing with price mode and color picker
- Add "by price" sub-mode for per-token pricing (auto-calculate ratios)
- Add color picker with preset colors in tag manager
- Display tags with colors in channel pricing view and selector
- Remove unused function, extract hardcoded color constants
- Fix pricing model filter (status==0 instead of status!=1)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
před 1 měsícem
unknown
e1f10fec95
add localiazed
před 2 měsíci
winter
08164cd0ae
fix
před 2 měsíci