merge: 同步 origin/ui-optimization(d224d5b6),保留 weiyuan 功能与 Semi 迁移

- 冲突以 weiyuan 功能(小程序登录、i18n 文案)为准,并保留远端 lint 重构与依赖收敛
- 删除 weiyuan 已移除、远端仅做 lint 修正的 3 个图片相关文件
- 适配远端零警告 ESLint:Monitoring/Subscription 改用 useEffectEvent,EditChannelModal 注明 t 依赖
- effect-events 单测补充 react-i18next mock
- 对合并后仍不符合 Prettier 的文件做纯格式化
This commit is contained in:
qiubaishen
2026-11-10 14:59:34 +08:00
211 changed files with 29252 additions and 12724 deletions
+4 -2
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import React, { useEffect, useState } from 'react';
import { Card, Spin } from '@/components/ui';
import { useTranslation } from 'react-i18next';
@@ -65,9 +66,10 @@ const ChatsSetting = () => {
}
}
useEffect(() => {
const onMount = useEffectEvent(() => {
onRefresh();
}, []);
});
useEffect(() => onMount(), [onMount]);
return (
<>
+4 -2
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import React, { useEffect, useState, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { Card, Spin, Modal } from '@/components/ui';
@@ -86,9 +87,10 @@ const DashboardSetting = () => {
}
}
useEffect(() => {
const onMount = useEffectEvent(() => {
onRefresh();
}, []);
});
useEffect(() => onMount(), [onMount]);
// 用于迁移检测的旧键,下个版本会删除
const hasLegacyData = useMemo(() => {
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import React, { useEffect, useRef, useState } from 'react';
import {
Banner,
@@ -364,9 +365,10 @@ export default function DataSecuritySetting() {
loadOrgConfigs();
};
useEffect(() => {
const onMount = useEffectEvent(() => {
reloadAll();
}, []);
});
useEffect(() => onMount(), [onMount]);
const onSave = async () => {
if (!configLoaded) {
+4 -2
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import React, { useEffect, useState } from 'react';
import { Card, Spin } from '@/components/ui';
import SettingsDrawing from '../../pages/Setting/Drawing/SettingsDrawing';
@@ -67,9 +68,10 @@ const DrawingSetting = () => {
}
}
useEffect(() => {
const onMount = useEffectEvent(() => {
onRefresh();
}, []);
});
useEffect(() => onMount(), [onMount]);
return (
<>
+4 -2
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import React, { useEffect, useState } from 'react';
import { Card, Spin } from '@/components/ui';
@@ -99,9 +100,10 @@ const ModelSetting = () => {
}
}
useEffect(() => {
const onMount = useEffectEvent(() => {
onRefresh();
}, []);
});
useEffect(() => onMount(), [onMount]);
return (
<>
+4 -2
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import React, { useContext, useEffect, useRef, useState } from 'react';
import { Button, Col, Form, Row, Modal, Space, Card } from '@/components/ui';
import { API, showError, showSuccess, timestamp2string } from '../../helpers';
@@ -354,9 +355,10 @@ const OtherSetting = () => {
}
};
useEffect(() => {
const onMount = useEffectEvent(() => {
getOptions();
}, []);
});
useEffect(() => onMount(), [onMount]);
// 打开官网(可配置,未配置则按钮不显示)
const officialWebsite = (statusState?.status?.official_website || '').trim();
+4 -2
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import React, { useEffect, useState } from 'react';
import { Card, Spin } from '@/components/ui';
import SettingsGeneralPayment from '../../pages/Setting/Payment/SettingsGeneralPayment';
@@ -263,9 +264,10 @@ const PaymentSetting = () => {
}
}
useEffect(() => {
const onMount = useEffectEvent(() => {
onRefresh();
}, []);
});
useEffect(() => onMount(), [onMount]);
return (
<>
+10 -4
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import { writeClipboardText } from '../../helpers/clipboard';
import React, { useContext, useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
@@ -123,7 +124,7 @@ const PersonalSetting = () => {
recordIpLog: false,
});
useEffect(() => {
const onMount = useEffectEvent(() => {
let saved = localStorage.getItem('status');
if (saved) {
const parsed = JSON.parse(saved);
@@ -161,7 +162,8 @@ const PersonalSetting = () => {
isPasskeySupported()
.then(setPasskeySupported)
.catch(() => setPasskeySupported(false));
}, []);
});
useEffect(() => onMount(), [onMount]);
useEffect(() => {
let countdownInterval = null;
@@ -176,7 +178,7 @@ const PersonalSetting = () => {
return () => clearInterval(countdownInterval);
}, [disableButton, countdown]);
useEffect(() => {
const onScopeChange2 = useEffectEvent(() => {
if (userState?.user?.setting) {
const settings = parseUserSetting(userState.user.setting);
setNotificationSettings({
@@ -214,7 +216,11 @@ const PersonalSetting = () => {
prev.avatarPreset || getDefaultAvatarPresetId(userState.user),
}));
}
}, [userState?.user?.id, userState?.user?.setting]);
});
useEffect(
() => onScopeChange2(),
[onScopeChange2, userState?.user?.id, userState?.user?.setting],
);
const handleInputChange = (name, value) => {
setInputs((inputs) => ({ ...inputs, [name]: value }));
+4 -2
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import React, { useEffect, useState } from 'react';
import { Card, Spin } from '@/components/ui';
@@ -70,9 +71,10 @@ const RateLimitSetting = () => {
}
}
useEffect(() => {
const onMount = useEffectEvent(() => {
onRefresh();
}, []);
});
useEffect(() => onMount(), [onMount]);
return (
<>
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import {
@@ -71,9 +72,10 @@ const TutorialVideoSetting = () => {
}
};
useEffect(() => {
const onMount = useEffectEvent(() => {
loadVideos();
}, []);
});
useEffect(() => onMount(), [onMount]);
// 格式化时长
const formatDuration = (seconds) => {
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { useEffectEvent } from '../../../../hooks/common/useEffectEvent';
import { writeClipboardText } from '../../../../helpers/clipboard';
import { API, showError, showSuccess, showWarning } from '../../../../helpers';
import {
@@ -78,9 +79,10 @@ const TwoFASetting = ({ t }) => {
}
};
useEffect(() => {
const onMount = useEffectEvent(() => {
fetchStatus();
}, []);
});
useEffect(() => onMount(), [onMount]);
// 初始化2FA设置
const handleSetup2FA = async () => {
@@ -18,14 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
*/
import React from 'react';
import {
Avatar,
Card,
Tag,
Divider,
Typography,
Badge,
} from '@/components/ui';
import { Avatar, Card, Tag, Divider, Typography, Badge } from '@/components/ui';
import {
isRoot,
isAdmin,