sync: 同步 monkey-ai@weiyuan(ddc5b9443) 的 web/ 到 ui-optimization

- 合入 weiyuan 新功能前端:分佣 V2 / 伙伴工作台、智能路由、企业资金与分析、官网设置与预约演示等,
  semi-ui 已全部迁移到 antd 6 / @/components/ui,不重新引入 Semi
- 分佣二级菜单与页头去重、伙伴入口探测(企业伙伴走企业中心「企业分佣」)、超管侧栏入口恢复
- 适配层 DatePicker / TimePicker 统一 onChange(Date|Date[]|null, 文本) 契约;生产构建剔除调试日志
- 图片链接刷新:同任务请求复用、后台刷新不弹全局错误、离页停止批量请求
- 恢复 bun.lock(与 package-lock.json 共存);docs 规范与 CHANGELOG 更新
- 停止跟踪 .env.playwright.local(本地登录凭据,已加入 .gitignore)
This commit is contained in:
qiubaishen
2026-11-18 10:22:02 +08:00
parent 737c353d84
commit db3dba1e96
157 changed files with 29960 additions and 1197 deletions
+73
View File
@@ -76,6 +76,10 @@ const ORG_FEATURE_KEYS = [
{ key: 'approval', label: '审批中心' },
{ key: 'analytics', label: '用量分析' },
{ key: 'quality_monitor', label: '调用质量' },
// 智能模型路由:功能键只表示可用,企业出境同意由企业所有者在企业中心授权(§9.5)
{ key: 'smart_router', label: '智能路由' },
{ key: 'smart_router_jev', label: '智能路由 · Jev 判定(可用)' },
{ key: 'smart_router_eval', label: '智能路由 · 质量评估(可用)' },
{ key: 'enterprise_login', label: '企业登录入口' },
{ key: 'org_only_mode', label: '仅企业资源模式' },
{ key: 'content_moderation', label: '内容审核' },
@@ -95,6 +99,9 @@ import {
ConsoleFilterActions,
} from '../../components/console/ConsoleModuleFilters';
// 与后端 model.OrgMaxConcurrencyCeiling 保持一致,超出后端会直接拒绝
const ORG_MAX_CONCURRENCY_CEILING = 100000;
const AdminOrganizations = () => {
const { t } = useTranslation();
const navigate = useNavigate();
@@ -124,6 +131,7 @@ const AdminOrganizations = () => {
max_members: 50,
max_tokens: 100,
cloud_brain_concurrency: 12,
max_concurrency: 0,
sales_rep: '',
});
const [createCredentialResult, setCreateCredentialResult] = useState(null);
@@ -138,6 +146,7 @@ const AdminOrganizations = () => {
max_members: 50,
max_tokens: 100,
cloud_brain_concurrency: 12,
max_concurrency: 0,
default_member_quota: 0,
description: '',
contact_name: '',
@@ -305,6 +314,7 @@ const AdminOrganizations = () => {
max_members: 50,
max_tokens: 100,
cloud_brain_concurrency: 12,
max_concurrency: 0,
sales_rep: '',
});
};
@@ -545,6 +555,8 @@ const AdminOrganizations = () => {
data.max_tokens = createForm.max_tokens;
if (createForm.cloud_brain_concurrency != null)
data.cloud_brain_concurrency = createForm.cloud_brain_concurrency;
if (createForm.max_concurrency != null)
data.max_concurrency = createForm.max_concurrency;
if ((createForm.sales_rep || '').trim())
data.sales_rep = createForm.sales_rep.trim();
const res = await API.post('/api/admin/organizations/', data);
@@ -578,6 +590,7 @@ const AdminOrganizations = () => {
max_members: record.max_members ?? 50,
max_tokens: record.max_tokens ?? 100,
cloud_brain_concurrency: record.cloud_brain_concurrency ?? 12,
max_concurrency: record.max_concurrency ?? 0,
default_member_quota: record.default_member_quota || 0,
description: record.description || '',
contact_name: record.contact_name || '',
@@ -617,6 +630,11 @@ const AdminOrganizations = () => {
editForm.cloud_brain_concurrency != null
? editForm.cloud_brain_concurrency
: undefined,
// 后端是指针字段,0(不限制)也必须真的发出去,不能被 falsy 判断吞掉
max_concurrency:
editForm.max_concurrency != null
? Math.max(0, Number(editForm.max_concurrency) || 0)
: undefined,
default_member_quota:
editForm.default_member_quota != null
? Math.max(0, Number(editForm.default_member_quota) || 0)
@@ -812,6 +830,18 @@ const AdminOrganizations = () => {
</span>
),
},
{
title: t('API 并发'),
width: 90,
render: (_, record) =>
record.max_concurrency > 0 ? (
<Tag size='small' color='orange'>
{record.max_concurrency}
</Tag>
) : (
<span className='text-xs text-gray-400'>{t('不限制')}</span>
),
},
{
title: t('创建时间'),
dataIndex: 'created_at',
@@ -1386,8 +1416,33 @@ const AdminOrganizations = () => {
max={1000}
placeholder='12'
/>
<div className='mt-1 text-xs text-gray-400'>
{t(
'限制云端大脑异步任务的同时排队/运行数,与下方 API 并发无关',
)}
</div>
</div>
)}
<div>
<label className='block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5'>
{t('API 最大并发')}
</label>
<InputNumber
value={createForm.max_concurrency}
onChange={(v) =>
setCreateForm({ ...createForm, max_concurrency: v })
}
style={{ width: '100%' }}
min={0}
max={ORG_MAX_CONCURRENCY_CEILING}
placeholder='0'
/>
<div className='mt-1 text-xs text-gray-400'>
{t(
'企业同时在飞的 API 转发请求上限,超出直接返回 429。0 表示不限制',
)}
</div>
</div>
</div>
)}
</Modal>
@@ -1515,6 +1570,24 @@ const AdminOrganizations = () => {
</p>
</div>
)}
<div>
<label className='block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5'>
{t('API 最大并发')}
</label>
<InputNumber
value={editForm.max_concurrency}
onChange={(v) => setEditForm({ ...editForm, max_concurrency: v })}
style={{ width: '100%' }}
min={0}
max={ORG_MAX_CONCURRENCY_CEILING}
placeholder='0'
/>
<p className='text-xs text-gray-500 mt-1'>
{t(
'企业同时在飞的 API 转发请求上限,超出直接返回 429。0 表示不限制;当前占用可在运营看板「企业用量分析」中查看。',
)}
</p>
</div>
<div>
<label className='block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5'>
{t('企业描述')}