feat(ui): 设置页重设计 + 全站表格配色统一为亮色变量
- 设置页:移除暗色残留,统一页头/卡片/图标块/按钮样式 - 模型管理:照 vivid 重排——模型名等宽显示,子行展示渠道名+权重, 定价胶囊「档位+普通价+代理价」,配置列统一灰色等宽标签, 操作列加宽修复删除按钮被挤 - 后端 ModelsView 返回每个模型绑定的渠道名列表(channel_models JOIN) - 全站 scoped 样式里的硬编码白值(rgb(255 255 255/white)批量替换为 主题变量,修复亮色模式下表头/开关/操作按钮不可见(如渠道表头) - 关于页:联系卡片统一等高布局,链接/非链接卡片对齐一致 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -183,6 +183,26 @@ func (r *ChannelRepository) RoutableModelIDs(ctx context.Context) (map[string]st
|
||||
return out, err
|
||||
}
|
||||
|
||||
// ChannelNamesByModel returns model_id -> bound channel display names in one
|
||||
// JOIN query — used by the admin models table to annotate each row with the
|
||||
// channel(s) it was synced from.
|
||||
func (r *ChannelRepository) ChannelNamesByModel(ctx context.Context) (map[string][]string, error) {
|
||||
var rows []struct {
|
||||
ModelID string `gorm:"column:model_id"`
|
||||
Name string `gorm:"column:name"`
|
||||
}
|
||||
err := r.db.WithContext(ctx).
|
||||
Table("channel_models").
|
||||
Select("channel_models.model_id, channels.name").
|
||||
Joins("JOIN channels ON channels.id = channel_models.channel_id").
|
||||
Scan(&rows).Error
|
||||
out := make(map[string][]string, len(rows))
|
||||
for _, row := range rows {
|
||||
out[row.ModelID] = append(out[row.ModelID], row.Name)
|
||||
}
|
||||
return out, err
|
||||
}
|
||||
|
||||
// ChannelIDsByModel lists channel ids bound to a model (any enabled state).
|
||||
func (r *ChannelRepository) ChannelIDsByModel(ctx context.Context, modelID string) ([]string, error) {
|
||||
var ids []string
|
||||
|
||||
Reference in New Issue
Block a user