From 9fb9c3204cc01f14ad2654a36eb445ae9c51b57b Mon Sep 17 00:00:00 2001 From: iven Date: Tue, 31 Mar 2026 03:07:40 +0800 Subject: [PATCH] feat(admin-v2): add LLM routing to accounts, upgrade Key Pool CRUD, extend agent template fields - Add llm_routing field (relay/local) to AccountPublic type and Accounts page table + edit modal - Upgrade Providers Key Pool from read-only to full CRUD with add/toggle/delete mutations - Extend AgentTemplate type with soul_content, scenarios, welcome_message, quick_commands, personality, communication_style, emoji, version, source_id fields - Add AgentTemplateAvailable lightweight interface - Add emoji column and extended form fields (emoji, personality, soul_content, welcome_message, communication_style, source_id) to Agent Templates page - Add getFull method to agent-templates service - Fix misplaced useState import in Accounts.tsx --- admin-v2/src/pages/Accounts.tsx | 19 ++++- admin-v2/src/pages/AgentTemplates.tsx | 24 ++++++ admin-v2/src/pages/Providers.tsx | 102 ++++++++++++++++++++++- admin-v2/src/services/agent-templates.ts | 7 +- admin-v2/src/types/index.ts | 20 +++++ 5 files changed, 168 insertions(+), 4 deletions(-) diff --git a/admin-v2/src/pages/Accounts.tsx b/admin-v2/src/pages/Accounts.tsx index b6e6ece..a31cffb 100644 --- a/admin-v2/src/pages/Accounts.tsx +++ b/admin-v2/src/pages/Accounts.tsx @@ -2,6 +2,7 @@ // 账号管理 // ============================================================ +import { useState } from 'react' import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query' import { Button, message, Tag, Modal, Form, Input, Select, Popconfirm, Space } from 'antd' import { PlusOutlined } from '@ant-design/icons' @@ -88,6 +89,16 @@ export default function Accounts() { width: 80, render: (_, record) => record.totp_enabled ? 已启用 : 未启用, }, + { + title: 'LLM 路由', + dataIndex: 'llm_routing', + width: 120, + valueType: 'select', + valueEnum: { + relay: { text: 'SaaS 中转', status: 'Success' }, + local: { text: '本地直连', status: 'Default' }, + }, + }, { title: '最后登录', dataIndex: 'last_login_at', @@ -161,10 +172,14 @@ export default function Accounts() { { value: 'user', label: '用户' }, ]} /> + + + + +