merge: 合入总仓库 weiyuan(bfdfb339) web/ 新功能,保留 ui-optimization 的 UI 重构

来源:luoguang/monkey-ai weiyuan@bfdfb339 的 web/(经 sync/main-weiyuan-web-bfdfb339 同步)
同步基准:总仓库 a2ca13cb = 本仓库初始导入 d8f3aee2

冲突处理原则:保留 ui-optimization 的 UI(样式/结构/组件),嫁接 weiyuan 的功能逻辑。
- i18n:按键三方合并;ours 的「令牌→密钥」改名键上移植 theirs 的术语修订
- task-logs / OrgLogs:ours 已手工移植同一功能(6ad95e2),保留 ours
- 删除:OrgCreate(theirs 下线 /org/create)、旧 image 组件与 VideoRegenerateModal(theirs 体验中心重写)、
  OrgAvatarSection / PricingBentoPage / CommissionConsole(ours 重构中已移除)
- 测试:users-pagination 的 i18next mock 补 t();theirs 新增文件补 license header
This commit is contained in:
qiubaishen
2026-11-10 12:01:21 +08:00
266 changed files with 38432 additions and 7570 deletions
+26 -9
View File
@@ -54,7 +54,7 @@ import {
showSuccess,
getModelCategories,
} from '../../helpers';
import { useNavigate } from 'react-router-dom';
import { useLocation, useNavigate } from 'react-router-dom';
import PageBackground from '../../components/common/PageBackground';
import UserCenterPageHeader from '../../components/common/UserCenterPageHeader';
import TableColumnSettings from '../../components/common/table/ColumnSettings';
@@ -62,6 +62,10 @@ import { CUSTOMER_SERVICE_OPEN_EVENT } from '../../components/customer-service';
import { StatusContext } from '../../context/Status';
import { UserContext } from '../../context/User';
import { isHeaderActionButtonVisible } from '../../helpers/navigationVisibility';
import {
flushCreationEvents,
trackCreationEvent,
} from '../../helpers/creationEvents';
import './key-management.css';
const KEY_MASK = '••••••••••••••••';
@@ -473,6 +477,17 @@ const ModelsDrawer = ({ visible, onClose, token, t }) => {
const KeyManagement = ({ embedded = false }) => {
const navigate = useNavigate();
const location = useLocation();
// 从新创作台"获取 API 代码 → 创建密钥"进入(WP C-1):创建成功记 key_created_from_studio(每次进入一次)
const fromStudioRef = useRef(
new URLSearchParams(location.search).get('from') === 'creation_studio',
);
const handleTokenCreated = (count) => {
if (!fromStudioRef.current) return;
fromStudioRef.current = false;
trackCreationEvent('key_created_from_studio', { count });
flushCreationEvents();
};
const [statusState] = useContext(StatusContext);
const [userState] = useContext(UserContext);
const openFluentNotificationRef = useRef(null);
@@ -673,9 +688,10 @@ const KeyManagement = ({ embedded = false }) => {
const handleToggle = (token) => {
const action = token.status === 1 ? 'disable' : 'enable';
Modal.confirm({
title: t(
action === 'disable' ? '确定要禁用此密钥吗?' : '确定要启用此密钥吗?',
),
title:
action === 'disable'
? t('确定要禁用此密钥吗?')
: t('确定要启用此密钥吗?'),
onOk: () => manageToken(token.id, action, token),
});
};
@@ -799,11 +815,11 @@ const KeyManagement = ({ embedded = false }) => {
},
}}
locale={{
back: '上一步',
close: '关闭',
last: '开始使用 🚀',
next: '下一步 →',
skip: '跳过',
back: t('上一步'),
close: t('关闭'),
last: `${t('开始使用')} 🚀`,
next: `${t('下一步')} →`,
skip: t('跳过'),
}}
floaterProps={{
disableAnimation: false,
@@ -959,6 +975,7 @@ const KeyManagement = ({ embedded = false }) => {
handleClose={closeEdit}
labelReplace='密钥'
presentation='drawer'
onCreated={handleTokenCreated}
/>
{/* 可用模型列表抽屉 */}