feat: 1.统一右侧抽屉关闭按钮布局 2.统一 UI 组件为 Ant Design 移除 radix-ui、floating-ui 组件 3. 修复 ESLint 文件格式错误的问题
This commit is contained in:
@@ -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 SettingsChats from '../../pages/Setting/Chat/SettingsChats';
|
||||
@@ -63,9 +64,10 @@ const ChatsSetting = () => {
|
||||
}
|
||||
}
|
||||
|
||||
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, { 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,
|
||||
@@ -362,9 +363,10 @@ export default function DataSecuritySetting() {
|
||||
loadOrgConfigs();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const onMount = useEffectEvent(() => {
|
||||
reloadAll();
|
||||
}, []);
|
||||
});
|
||||
useEffect(() => onMount(), [onMount]);
|
||||
|
||||
const onSave = async () => {
|
||||
if (!configLoaded) {
|
||||
|
||||
@@ -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';
|
||||
@@ -65,9 +66,10 @@ const DrawingSetting = () => {
|
||||
}
|
||||
}
|
||||
|
||||
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, { useEffect, useState } from 'react';
|
||||
import { Card, Spin } from '@/components/ui';
|
||||
|
||||
@@ -98,9 +99,10 @@ const ModelSetting = () => {
|
||||
}
|
||||
}
|
||||
|
||||
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, { 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();
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
|
||||
@@ -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 }));
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user