mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-27 16:04:21 +00:00
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)
This commit is contained in:
@@ -394,6 +394,18 @@ export class BackendClient extends BaseHttpClient {
|
||||
return this.delete(`/api/v1/platform/bots/${uuid}`);
|
||||
}
|
||||
|
||||
public getBotAdmins(botId: string): Promise<{ admins: Array<{ id: number; launcher_type: string; launcher_id: string }> }> {
|
||||
return this.get(`/api/v1/platform/bots/${botId}/admins`);
|
||||
}
|
||||
|
||||
public addBotAdmin(botId: string, launcher_type: string, launcher_id: string): Promise<{ id: number }> {
|
||||
return this.post(`/api/v1/platform/bots/${botId}/admins`, { launcher_type, launcher_id });
|
||||
}
|
||||
|
||||
public deleteBotAdmin(botId: string, adminId: number): Promise<object> {
|
||||
return this.delete(`/api/v1/platform/bots/${botId}/admins/${adminId}`);
|
||||
}
|
||||
|
||||
public getBotLogs(
|
||||
botId: string,
|
||||
request: GetBotLogsRequest,
|
||||
|
||||
Reference in New Issue
Block a user