feat(platform): migrate bot admins from config.yaml to database (#2289)

* feat(platform): migrate bot admins from config.yaml to database

- Add BotAdmin ORM model (bot_admins table) scoped per bot_uuid
- Add Alembic migration 0007 to create table and migrate legacy config admins
- Remove top-level admins key from config.yaml template
- Add GET/POST/DELETE /api/v1/platform/bots/<uuid>/admins endpoints
- Update cmdmgr privilege check to query bot_admins table (bot-scoped)
- Add BotAdminsPanel frontend component in bot detail sessions tab
- Add i18n keys (zh-Hans, en-US)

* fix(ci): ruff/prettier format, fix test_importutil assertion

* fix(ci): prettier format BackendClient.ts and i18n locales

* fix(ci): eslint-prettier fix BackendClient.ts single-param formatting

* refactor: move admin management into session monitor, fix session_id enum format

- Remove standalone admins tab, replace with BotAdminsDialog in session monitor
- Add admin toggle button inline in chat header next to Active status
- Add BotAdminsDialog component with useBotAdmins hook
- Fix session_id written as LauncherTypes.PERSON_xxx instead of person_xxx
  (monitoring_helper.py x4, pipelinemgr.py x1 missing .value on launcher_type)
- Fix duplicate platform/person label in session list and chat header
- Migrate existing malformed session_id records in DB

---------

Co-authored-by: dadachann <185672915+dadachann@users.noreply.github.com>
This commit is contained in:
Hyu
2026-06-27 17:18:19 +08:00
committed by GitHub
parent 48905ea080
commit b97cc800d3
14 changed files with 766 additions and 250 deletions
+20
View File
@@ -444,6 +444,26 @@ const enUS = {
userMessage: 'User',
botMessage: 'Assistant',
},
admins: {
title: 'Admins',
description:
"Launchers (person/group IDs) that have admin privilege for this bot's commands",
addAdmin: 'Add Admin',
launcherType: 'Type',
launcherId: 'ID',
typePerson: 'Person',
typeGroup: 'Group',
placeholderId: 'User or group ID',
addSuccess: 'Admin added',
addError: 'Failed to add admin: ',
deleteSuccess: 'Admin removed',
deleteError: 'Failed to remove admin: ',
noAdmins: 'No admins configured',
setAdminTitle: 'Set as admin',
adminBadge: 'Admin',
configureAdmins: 'Manage Admins',
removeAdminTitle: 'Remove admin',
},
},
plugins: {
title: 'Extensions',
+19
View File
@@ -426,6 +426,25 @@ const zhHans = {
userMessage: '用户',
botMessage: '助手',
},
admins: {
title: '管理员',
description: '拥有此机器人命令管理员权限的会话(用户/群组 ID)',
addAdmin: '添加管理员',
launcherType: '类型',
launcherId: 'ID',
typePerson: '私聊',
typeGroup: '群聊',
placeholderId: '用户或群组 ID',
addSuccess: '添加成功',
addError: '添加失败:',
deleteSuccess: '已移除',
deleteError: '移除失败:',
noAdmins: '暂无管理员',
setAdminTitle: '设为管理员',
adminBadge: '管理员',
configureAdmins: '配置管理员',
removeAdminTitle: '移除管理员权限',
},
},
plugins: {
title: '插件扩展',