Skip to content

feat: 模型多选弹窗、密钥卡片优化、Discord 服务器拉黑 - #1

Merged
mzrodyu merged 1 commit into
mainfrom
feat/channel-model-picker-and-discord-blocklist
Sep 10, 2026
Merged

feat: 模型多选弹窗、密钥卡片优化、Discord 服务器拉黑#1
mzrodyu merged 1 commit into
mainfrom
feat/channel-model-picker-and-discord-blocklist

Conversation

@mzrodyu

@mzrodyu mzrodyu commented Sep 10, 2026

Copy link
Copy Markdown
Owner

概述

本次改动包含三块 UI 优化 + 一个新功能(Discord 服务器拉黑)。

UI 修复

  • 用户中心 API 密钥卡片:修复"正常"状态徽章错位(.account-key-list span { display: block } 覆盖了徽章的 inline-flex 导致内部失去垂直居中),并把卡片做得更丰富(钥匙图标 + 等宽前缀)。
  • 新增渠道表单:改用独立的两列栅格,字段不再留下参差的空列。
  • 拉取模型弹窗:新增 newapi 风格的模型选择弹窗——把上游模型列表拉进一个可搜索的多选对话框,勾选后再导入,而不是一次性导入全部。

新功能:Discord 服务器拉黑

  • 后台 Discord 设置新增「拉黑服务器 ID」(也支持 DISCORD_BLOCKED_GUILD_IDS 环境变量)。
  • 用户若加入了黑名单中的任意 Discord 服务器,将被禁止注册 / 登录(优先于允许规则,绑定账号也会被拦)。
  • 仅在配置了黑名单时才请求 guilds OAuth 授权,登录前先校验。

后端

  • 新增只读预览接口 POST /api/channels/:id/upstream-modelssync-models 现支持 {models:[...]} 显式选择。

测试

  • 预览不落库、显式选择只保存所选、黑名单成员拒绝 / 非成员放行。
  • go test ./... ✅、npm run build

🤖 Generated with Claude Code

UI:
- Fix API key status badge misalignment in the user center (a global
  .account-key-list span rule was overriding the badge's inline-flex,
  breaking vertical centering) and enrich the key card (icon + mono prefix).
- Give the "new channel" form its own two-column grid so fields no longer
  leave ragged empty columns.
- Add a newapi-style model picker dialog: pull the upstream model list into a
  searchable multi-select modal instead of importing every model at once.

Discord server blacklist:
- New blocked-guild list (admin Discord settings + DISCORD_BLOCKED_GUILD_IDS
  env): users who belong to any blacklisted Discord server are denied
  registration/login. Requests the "guilds" OAuth scope only when a blacklist
  is configured, and enforces the check before any login or registration.

Backend:
- Read-only POST /api/channels/:id/upstream-models preview endpoint; the
  sync-models endpoint now accepts an explicit {models:[...]} selection.

Tests: preview endpoint, explicit-selection sync, blocked-guild deny/allow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mzrodyu
mzrodyu merged commit 565b5d2 into main Sep 10, 2026
1 check passed
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.

1 participant