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
This commit is contained in:
iven
2026-03-31 03:07:40 +08:00
parent 3e57fadfc9
commit 9fb9c3204c
5 changed files with 168 additions and 4 deletions

View File

@@ -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 ? <Tag color="green"></Tag> : <Tag></Tag>,
},
{
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: '用户' },
]} />
</Form.Item>
<Form.Item name="llm_routing" label="LLM 路由模式">
<Select options={[
{ value: 'local', label: '本地直连' },
{ value: 'relay', label: 'SaaS 中转 (Token 池)' },
]} />
</Form.Item>
</Form>
</Modal>
</div>
)
}
import { useState } from 'react'