feat: 1.统一右侧抽屉关闭按钮布局 2.统一 UI 组件为 Ant Design 移除 radix-ui、floating-ui 组件 3. 修复 ESLint 文件格式错误的问题

This commit is contained in:
zhanjunhao
2026-11-10 14:08:10 +08:00
parent 28e924e371
commit 584728590b
202 changed files with 29195 additions and 12732 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, { useContext, useEffect, useState } from 'react';
import { API, getSystemName, showError } from '../../helpers';
import { StatusContext } from '../../context/Status';
@@ -55,9 +56,10 @@ const About = () => {
setAboutLoaded(true);
};
useEffect(() => {
const onMount = useEffectEvent(() => {
displayAbout().then();
}, []);
});
useEffect(() => onMount(), [onMount]);
const emptyStyle = {
padding: '24px',
+1 -1
View File
@@ -99,7 +99,7 @@ const AdminInvoice = () => {
} finally {
setLoading(false);
}
}, [page, pageSize, searchKeyword, statusFilter]);
}, [page, pageSize, searchKeyword, statusFilter, t]);
useEffect(() => {
fetchInvoices();
+2 -2
View File
@@ -144,12 +144,12 @@ const AdminOrder = () => {
dateRange,
appliedMinMoney,
appliedMaxMoney,
queryVersion,
t,
]);
useEffect(() => {
fetchOrders();
}, [fetchOrders]);
}, [fetchOrders, queryVersion]);
const handleSearch = () => {
const trimmedKeyword = keyword.trim();
+7 -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 { ConsolePageActions } from '../../components/console/ConsolePageContainer';
import React, {
useState,
@@ -135,7 +136,7 @@ const Analytics = () => {
const [banLogsOpen, setBanLogsOpen] = useState(true);
const [activeTab, setActiveTab] = useState(readTabFromURL);
useEffect(() => {
const onScopeChange = useEffectEvent(() => {
if (!firstVisibleTab) return;
if (!isAnalyticsTabVisible(activeTab)) {
setActiveTab(firstVisibleTab);
@@ -144,7 +145,11 @@ const Analytics = () => {
else url.searchParams.set('tab', firstVisibleTab);
window.history.replaceState(null, '', url.toString());
}
}, [activeTab, firstVisibleTab, analyticsConfig]);
});
useEffect(
() => onScopeChange(),
[onScopeChange, activeTab, firstVisibleTab, analyticsConfig],
);
// 浏览器前进/后退切到不同 ?tab= 时同步 UI(我们用 replaceState 改 URL,所以正常切换不会
// 产生 history 条目;这里主要兜底浏览器返回到带 ?tab= 的旧条目、或扩展直接改 URL 的情况)
+4 -11
View File
@@ -67,8 +67,7 @@
align-items: center;
height: 19px;
padding: 0 7px;
border: 1px solid
color-mix(in srgb, var(--ui-color-warning) 40%, transparent);
border: 1px solid color-mix(in srgb, var(--ui-color-warning) 40%, transparent);
border-radius: 999px;
background: color-mix(in srgb, var(--ui-color-warning) 12%, transparent);
color: var(--ui-color-warning);
@@ -335,11 +334,7 @@
gap: 7px;
padding: 13px;
border-radius: 14px;
background: color-mix(
in srgb,
var(--brain-sage) 7%,
var(--ui-color-fill-0)
);
background: color-mix(in srgb, var(--brain-sage) 7%, var(--ui-color-fill-0));
}
.brain-project-field label {
@@ -401,8 +396,7 @@
gap: 15px;
margin: 18px 0;
padding: 20px;
border: 1px solid
color-mix(in srgb, var(--ui-color-danger) 40%, transparent);
border: 1px solid color-mix(in srgb, var(--ui-color-danger) 40%, transparent);
border-left: 4px solid var(--ui-color-danger);
border-radius: 12px;
background: color-mix(
@@ -439,8 +433,7 @@
line-height: 1.55;
}
.brain-confirm-card details {
border: 1px solid
color-mix(in srgb, var(--ui-color-danger) 16%, transparent);
border: 1px solid color-mix(in srgb, var(--ui-color-danger) 16%, transparent);
border-radius: 10px;
background: var(--surface-card);
}
@@ -17,13 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import React, {
useState,
useEffect,
useMemo,
useRef,
useCallback,
} from 'react';
import React, { useState, useEffect, useMemo, useRef } from 'react';
import {
RadioGroup,
Radio,
@@ -414,7 +408,7 @@ const ImageGenerationForm = ({ onSubmit, loading, prefillSignal }) => {
}
};
const handleSubmit = useCallback(() => {
const handleSubmit = () => {
// 同步守卫优先于 isFormValid / loading 检查,避免快速双击造成两次 addTask
if (submittingRef.current) return;
if (!isFormValid() || loading) return;
@@ -433,21 +427,7 @@ const ImageGenerationForm = ({ onSubmit, loading, prefillSignal }) => {
n,
negativePrompt: negativePrompt.trim() || undefined,
});
}, [
isFormValid,
loading,
mode,
prompt,
referenceImage,
width,
height,
selectedModel,
quality,
n,
negativePrompt,
onSubmit,
promptHistory,
]); // eslint-disable-line react-hooks/exhaustive-deps
};
// Cmd/Ctrl + Enter 在 prompt 区生效
const handlePromptKeyDown = (e) => {
@@ -118,31 +118,31 @@ const VideoModelPanel = ({
{/* 模型价格 —— 单价为 0(含管理员隐藏价格场景)时不展示,避免误导性的 0.00 */}
{Number(modelInfo?.price) > 0 && (
<Card
title={
<div style={{ display: 'flex', alignItems: 'center', gap: '4px' }}>
<IconCreditCard />
<span>{t('模型价格')}</span>
</div>
}
bodyStyle={{ padding: '12px' }}
>
<div
style={{
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
}}
<Card
title={
<div style={{ display: 'flex', alignItems: 'center', gap: '4px' }}>
<IconCreditCard />
<span>{t('模型价格')}</span>
</div>
}
bodyStyle={{ padding: '12px' }}
>
<Text type='tertiary'>{t('单价')}</Text>
<Text
strong
style={{ fontSize: '18px', color: 'var(--ui-color-primary)' }}
<div
style={{
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
}}
>
{convertUSDToCurrency(Number(modelInfo?.price || 0), 6)}
</Text>
</div>
</Card>
<Text type='tertiary'>{t('单价')}</Text>
<Text
strong
style={{ fontSize: '18px', color: 'var(--ui-color-primary)' }}
>
{convertUSDToCurrency(Number(modelInfo?.price || 0), 6)}
</Text>
</div>
</Card>
)}
</div>
);
+16 -12
View File
@@ -17,6 +17,19 @@ 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 {
MoonshotMono as Moonshot,
OpenAIMono as OpenAI,
ZhipuColor as Zhipu,
ClaudeColor as Claude,
GeminiColor as Gemini,
WenxinColor as Wenxin,
SparkColor as Spark,
DeepSeekColor as DeepSeek,
QwenColor as Qwen,
MidjourneyMono as Midjourney,
} from '@/assets/brand-icons/primitives';
import React, {
useContext,
useEffect,
@@ -31,16 +44,6 @@ import { useActualTheme } from '../../context/Theme';
import { marked } from 'marked';
import { useTranslation } from 'react-i18next';
import { Link, useNavigate } from 'react-router-dom';
import Moonshot from '@lobehub/icons/es/Moonshot/components/Mono';
import OpenAI from '@lobehub/icons/es/OpenAI/components/Mono';
import Zhipu from '@lobehub/icons/es/Zhipu/components/Color';
import Claude from '@lobehub/icons/es/Claude/components/Color';
import Gemini from '@lobehub/icons/es/Gemini/components/Color';
import Wenxin from '@lobehub/icons/es/Wenxin/components/Color';
import Spark from '@lobehub/icons/es/Spark/components/Color';
import DeepSeek from '@lobehub/icons/es/DeepSeek/components/Color';
import Qwen from '@lobehub/icons/es/Qwen/components/Color';
import Midjourney from '@lobehub/icons/es/Midjourney/components/Mono';
import {
Cpu,
Server,
@@ -246,9 +249,10 @@ const Home = () => {
};
}, [navigate, homePageContent]);
useEffect(() => {
const onMount = useEffectEvent(() => {
displayHomePageContent().then();
}, []);
});
useEffect(() => onMount(), [onMount]);
// 核心能力数据 - 全方位 (8 items)
const capabilities = [
+3 -9
View File
@@ -487,12 +487,8 @@ const AdminMonitor = () => {
fontSize: '13px',
}}
>
<span style={{ color: 'var(--ui-color-text-1)' }}>
{item.type}
</span>
<span
style={{ fontWeight: 600, color: 'var(--ui-color-text-0)' }}
>
<span style={{ color: 'var(--ui-color-text-1)' }}>{item.type}</span>
<span style={{ fontWeight: 600, color: 'var(--ui-color-text-0)' }}>
{item.count}
</span>
</div>
@@ -543,9 +539,7 @@ const AdminMonitor = () => {
<span
style={{
color:
text > 500
? 'var(--ui-color-danger)'
: 'var(--ui-color-success)',
text > 500 ? 'var(--ui-color-danger)' : 'var(--ui-color-success)',
}}
>
{text}
+1 -5
View File
@@ -25,11 +25,7 @@ import {
Spin,
Toast,
} from '@/components/ui';
import {
IconActivity,
IconLineChart,
IconPulse,
} from '@/components/ui/icons';
import { IconActivity, IconLineChart, IconPulse } from '@/components/ui/icons';
import { useTranslation } from 'react-i18next';
import { API } from '../../helpers';
import ChannelMonitorView from './components/ChannelMonitorView';
+127 -129
View File
@@ -188,30 +188,28 @@ const OrgRegister = () => {
<GlassCard>
{/* key 随表单/凭证两态切换,触发与企业登录页一致的步骤过渡动画 */}
<div key={result ? 'result' : 'form'} className='org-step-enter'>
<AuthCardHeader
wrapperClassName='mb-6'
logo={logo}
title={result ? t('企业注册成功') : t('注册企业')}
subtitle={
result
? t('请妥善保存以下凭证')
: t('为你的团队开通企业空间')
}
/>
{result ? (
<OrgCredentialResult
creds={result}
onLogin={() =>
// 带上企业代码与登录名直达登录第二步,用户只需输入初始密码
navigate(
`/org/login?org=${encodeURIComponent(result.org_code)}&login=${encodeURIComponent(result.owner_login_name || '')}`,
)
<AuthCardHeader
wrapperClassName='mb-6'
logo={logo}
title={result ? t('企业注册成功') : t('注册企业')}
subtitle={
result ? t('请妥善保存以下凭证') : t('为你的团队开通企业空间')
}
/>
) : (
<>
<style>{`
{result ? (
<OrgCredentialResult
creds={result}
onLogin={() =>
// 带上企业代码与登录名直达登录第二步,用户只需输入初始密码
navigate(
`/org/login?org=${encodeURIComponent(result.org_code)}&login=${encodeURIComponent(result.owner_login_name || '')}`,
)
}
/>
) : (
<>
<style>{`
.org-register-form .ant-form-item {
margin-bottom: 14px !important;
padding: 0 !important;
@@ -220,122 +218,122 @@ const OrgRegister = () => {
margin-bottom: 6px !important;
}
`}</style>
<Form
className='org-register-form auth-glass-form'
getFormApi={(api) => (formApi.current = api)}
onValueChange={(v) => setValues(v)}
>
<Form.Input
field='name'
size='large'
label={t('企业名称')}
placeholder={t('请输入企业名称(登录时可用于搜索定位)')}
rules={[{ required: true, message: t('请输入企业名称') }]}
/>
<Form.Input
field='owner_login_name'
size='large'
label={t('管理员登录名')}
placeholder={t('请设置管理员登录名,如 zhang.san')}
extraText={t(
'登录企业空间使用的管理员账号名,注册后不可修改;请勿使用 admin、root 等通用名',
)}
rules={[
{ required: true, message: t('请设置管理员登录名') },
{
pattern: LOGIN_NAME_PATTERN,
message: t(
'登录名需为 3-32 位,以字母开头,仅可包含字母、数字、下划线、点或短横线',
),
},
{
validator: (rule, value) => !isReservedLoginName(value),
message: t('该登录名为系统保留名称,请换一个登录名'),
},
]}
/>
<Form.Input
field='owner_display_name'
size='large'
label={t('管理员显示名')}
placeholder={t('选填')}
/>
<Form.Input
field='contact_name'
size='large'
label={t('联系人')}
placeholder={t('选填')}
/>
<Form.Input
field='contact_email'
size='large'
label={t('联系邮箱')}
placeholder={t('用于接收通知')}
rules={
emailVerifyEnabled
? [{ required: true, message: t('请输入联系邮箱') }]
: []
}
suffix={
emailVerifyEnabled ? (
<Button
size='small'
onClick={sendCode}
loading={codeLoading}
disabled={countdown > 0}
>
{countdown > 0
? `${t('重新发送')} (${countdown})`
: t('获取验证码')}
</Button>
) : undefined
}
/>
{emailVerifyEnabled && (
<Form
className='org-register-form auth-glass-form'
getFormApi={(api) => (formApi.current = api)}
onValueChange={(v) => setValues(v)}
>
<Form.Input
field='verify_code'
field='name'
size='large'
label={t('邮箱验证码')}
placeholder={t('请输入验证码')}
rules={[{ required: true, message: t('请输入验证码') }]}
label={t('企业名称')}
placeholder={t('请输入企业名称(登录时可用于搜索定位)')}
rules={[{ required: true, message: t('请输入企业名称') }]}
/>
)}
<Form.Input
field='contact_phone'
size='large'
label={t('联系电话')}
placeholder={t('选填')}
/>
</Form>
<Form.Input
field='owner_login_name'
size='large'
label={t('管理员登录名')}
placeholder={t('请设置管理员登录名,如 zhang.san')}
extraText={t(
'登录企业空间使用的管理员账号名,注册后不可修改;请勿使用 admin、root 等通用名',
)}
rules={[
{ required: true, message: t('请设置管理员登录名') },
{
pattern: LOGIN_NAME_PATTERN,
message: t(
'登录名需为 3-32 位,以字母开头,仅可包含字母、数字、下划线、点或短横线',
),
},
{
validator: (rule, value) => !isReservedLoginName(value),
message: t('该登录名为系统保留名称,请换一个登录名'),
},
]}
/>
<Form.Input
field='owner_display_name'
size='large'
label={t('管理员显示名')}
placeholder={t('选填')}
/>
<Form.Input
field='contact_name'
size='large'
label={t('联系人')}
placeholder={t('选填')}
/>
<Form.Input
field='contact_email'
size='large'
label={t('联系邮箱')}
placeholder={t('用于接收通知')}
rules={
emailVerifyEnabled
? [{ required: true, message: t('请输入联系邮箱') }]
: []
}
suffix={
emailVerifyEnabled ? (
<Button
size='small'
onClick={sendCode}
loading={codeLoading}
disabled={countdown > 0}
>
{countdown > 0
? `${t('重新发送')} (${countdown})`
: t('获取验证码')}
</Button>
) : undefined
}
/>
{emailVerifyEnabled && (
<Form.Input
field='verify_code'
size='large'
label={t('邮箱验证码')}
placeholder={t('请输入验证码')}
rules={[{ required: true, message: t('请输入验证码') }]}
/>
)}
<Form.Input
field='contact_phone'
size='large'
label={t('联系电话')}
placeholder={t('选填')}
/>
</Form>
<div className='mt-5'>
<div className='mt-5'>
<Button
theme='solid'
size='large'
block
loading={submitting}
onClick={handleSubmit}
>
{t('提交注册')}
</Button>
</div>
<div className='mt-4 flex items-center gap-3 text-xs text-gray-400'>
<span className='h-px flex-1 bg-gray-200 dark:bg-white/10' />
<span>{t('已有企业?')}</span>
<span className='h-px flex-1 bg-gray-200 dark:bg-white/10' />
</div>
<Button
theme='solid'
theme='borderless'
size='large'
block
loading={submitting}
onClick={handleSubmit}
className='!text-brand'
onClick={() => navigate('/org/login')}
>
{t('提交注册')}
{t('去登录')}
</Button>
</div>
<div className='mt-4 flex items-center gap-3 text-xs text-gray-400'>
<span className='h-px flex-1 bg-gray-200 dark:bg-white/10' />
<span>{t('已有企业?')}</span>
<span className='h-px flex-1 bg-gray-200 dark:bg-white/10' />
</div>
<Button
theme='borderless'
size='large'
block
className='!text-brand'
onClick={() => navigate('/org/login')}
>
{t('去登录')}
</Button>
</>
)}
</>
)}
</div>
</GlassCard>
);
@@ -16,6 +16,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, { useCallback, useContext, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import {
@@ -153,7 +154,7 @@ const OrgPersonalSettings = ({ orgId }) => {
}, [fetchSummary, fetchNotifySetting]);
// 从 user.setting 初始化头像(与个人中心 PersonalSetting 同款逻辑)
useEffect(() => {
const onScopeChange = useEffectEvent(() => {
if (userState?.user?.setting) {
const settings = parseUserSetting(userState.user.setting);
setAvatarSettings({
@@ -174,7 +175,11 @@ const OrgPersonalSettings = ({ orgId }) => {
prev.avatarPreset || getDefaultAvatarPresetId(userState.user),
}));
}
}, [userState?.user?.id, userState?.user?.setting]);
});
useEffect(
() => onScopeChange(),
[onScopeChange, userState?.user?.id, userState?.user?.setting],
);
const handleAvatarSettingChange = (type, value) => {
setAvatarSettings((prev) => ({ ...prev, [type]: value }));
+4 -4
View File
@@ -127,7 +127,7 @@ const OrgRecharge = ({ orgId }) => {
const [historyLoading, setHistoryLoading] = useState(false);
const [refreshHistory, setRefreshHistory] = useState(0);
const orgHeaders = { 'X-Org-Id': String(orgId) };
const orgHeaders = useMemo(() => ({ 'X-Org-Id': String(orgId) }), [orgId]);
// 获取企业配额
const fetchOrgQuota = useCallback(async () => {
@@ -141,7 +141,7 @@ const OrgRecharge = ({ orgId }) => {
} catch (e) {
// ignore
}
}, [orgId]);
}, [orgHeaders]);
// 获取充值配置
const fetchTopUpInfo = useCallback(async () => {
@@ -180,7 +180,7 @@ const OrgRecharge = ({ orgId }) => {
} finally {
setInfoLoading(false);
}
}, [orgId]);
}, [orgHeaders, t]);
// 获取充值记录
const fetchHistory = useCallback(
@@ -206,7 +206,7 @@ const OrgRecharge = ({ orgId }) => {
setHistoryLoading(false);
}
},
[orgId, historyPageSize],
[historyPageSize, orgHeaders],
);
useEffect(() => {
@@ -23,18 +23,11 @@ For commercial licensing, please contact support@quantumnous.com
.dept-flow-cinema {
--dfc-glow: color-mix(in srgb, var(--ui-color-primary) 16%, transparent);
--dfc-glow-soft: color-mix(
in srgb,
var(--ui-color-primary) 9%,
transparent
);
--dfc-glow-soft: color-mix(in srgb, var(--ui-color-primary) 9%, transparent);
/* 不支持 color-mix 的旧内核退化为纯渐变底 */
background: linear-gradient(180deg, #f7f9fd 0%, #edf1f8 100%);
background: radial-gradient(
1100px 520px at 50% -8%,
var(--dfc-glow),
transparent 62%
),
background:
radial-gradient(1100px 520px at 50% -8%, var(--dfc-glow), transparent 62%),
radial-gradient(
900px 480px at 88% 110%,
var(--dfc-glow-soft),
@@ -45,7 +38,8 @@ For commercial licensing, please contact support@quantumnous.com
.dept-flow-cinema.dark {
background: linear-gradient(180deg, #0b1020 0%, #0d1329 55%, #090e1c 100%);
background: radial-gradient(
background:
radial-gradient(
1100px 520px at 50% -8%,
color-mix(in srgb, var(--ui-color-primary) 24%, transparent),
transparent 62%
@@ -44,7 +44,10 @@ const OrgPanel = ({
}) => {
const hasHeader = title || actions;
return (
<Card className={`org-panel ${className}`} styles={{ body: { padding: 24 } }}>
<Card
className={`org-panel ${className}`}
styles={{ body: { padding: 24 } }}
>
{hasHeader && (
<div className='flex items-start justify-between gap-3 flex-wrap border-b border-[var(--border-subtle)] px-5 py-3.5'>
<div className='flex items-center gap-2.5 min-w-0'>
@@ -82,9 +82,13 @@ const OrgScopedLimitButtons = ({
setModelModalVisible(true);
setLoadingModels(true);
try {
const res = await API.get('/api/org/models', { headers: getOrgHeaders(orgId) });
const res = await API.get('/api/org/models', {
headers: getOrgHeaders(orgId),
});
if (res.data.success) {
setOrgModels((res.data.data || []).map((m) => ({ label: m, value: m })));
setOrgModels(
(res.data.data || []).map((m) => ({ label: m, value: m })),
);
}
} catch {
/* ignore */
@@ -96,7 +100,9 @@ const OrgScopedLimitButtons = ({
setSelectedGroups(parseGroups(record?.groups));
setGroupsModalVisible(true);
try {
const res = await API.get('/api/org/info', { headers: getOrgHeaders(orgId) });
const res = await API.get('/api/org/info', {
headers: getOrgHeaders(orgId),
});
if (res.data.success) {
const org = res.data.data?.organization || {};
let groups = [];
@@ -122,7 +128,10 @@ const OrgScopedLimitButtons = ({
try {
const res = await API.put(
`${apiBase}/${record.id}/models`,
{ model_limits_enabled: enabled, model_limits: selectedModels.join(',') },
{
model_limits_enabled: enabled,
model_limits: selectedModels.join(','),
},
{ headers: getOrgHeaders(orgId) },
);
if (res.data.success) {
@@ -161,7 +170,12 @@ const OrgScopedLimitButtons = ({
return (
<>
<Tooltip content={t('设置该{{scope}}成员默认可用的模型范围(与成员/项目/部门限制取交集)', { scope: t(scopeLabel) })}>
<Tooltip
content={t(
'设置该{{scope}}成员默认可用的模型范围(与成员/项目/部门限制取交集)',
{ scope: t(scopeLabel) },
)}
>
<Button
{...(variant === 'link'
? { type: 'link' }
@@ -176,7 +190,12 @@ const OrgScopedLimitButtons = ({
{t('模型')}
</Button>
</Tooltip>
<Tooltip content={t('设置该{{scope}}成员默认可调用的分组(与成员/项目/部门限制取交集)', { scope: t(scopeLabel) })}>
<Tooltip
content={t(
'设置该{{scope}}成员默认可调用的分组(与成员/项目/部门限制取交集)',
{ scope: t(scopeLabel) },
)}
>
<Button
{...(variant === 'link'
? { type: 'link' }
@@ -42,9 +42,7 @@ const OrgStateBlock = ({
}) => {
if (loading) {
return (
<div
className={`flex items-center justify-center py-16 ${className}`}
>
<div className={`flex items-center justify-center py-16 ${className}`}>
<Spin size='large' />
</div>
);
+6 -12
View File
@@ -61,8 +61,7 @@
.knowledge-beta {
padding: 2px 7px;
border: 1px solid
color-mix(in srgb, var(--ui-color-primary) 30%, transparent);
border: 1px solid color-mix(in srgb, var(--ui-color-primary) 30%, transparent);
border-radius: 999px;
background: var(--knowledge-mint);
font-size: 9px;
@@ -616,15 +615,13 @@
}
.knowledge-doc-error.is-failed {
border: 1px solid
color-mix(in srgb, var(--ui-color-danger) 30%, transparent);
border: 1px solid color-mix(in srgb, var(--ui-color-danger) 30%, transparent);
color: var(--ui-color-danger);
background: color-mix(in srgb, var(--ui-color-danger) 7%, transparent);
}
.knowledge-doc-error.is-waiting {
border: 1px solid
color-mix(in srgb, var(--ui-color-warning) 35%, transparent);
border: 1px solid color-mix(in srgb, var(--ui-color-warning) 35%, transparent);
color: var(--ui-color-warning);
background: color-mix(in srgb, var(--ui-color-warning) 8%, transparent);
}
@@ -660,8 +657,7 @@
}
.knowledge-reindex-status.is-failed {
border: 1px solid
color-mix(in srgb, var(--ui-color-danger) 30%, transparent);
border: 1px solid color-mix(in srgb, var(--ui-color-danger) 30%, transparent);
color: var(--ui-color-danger);
background: color-mix(in srgb, var(--ui-color-danger) 7%, transparent);
}
@@ -812,8 +808,7 @@
.knowledge-hit-flag {
padding: 1px 8px;
border: 1px solid
color-mix(in srgb, var(--ui-color-warning) 40%, transparent);
border: 1px solid color-mix(in srgb, var(--ui-color-warning) 40%, transparent);
border-radius: 999px;
color: var(--ui-color-warning);
}
@@ -929,8 +924,7 @@
justify-content: space-between;
gap: 12px;
padding: 11px 12px;
border: 1px solid
color-mix(in srgb, var(--ui-color-danger) 30%, transparent);
border: 1px solid color-mix(in srgb, var(--ui-color-danger) 30%, transparent);
border-radius: 10px;
}
+4 -1
View File
@@ -105,7 +105,10 @@ const Playground = ({ isExperienceMode = false }) => {
// 用的是那一个;这里把全局应用 status 单独命名 appStatus 以避免遮蔽。
const appStatus = statusState?.status;
const isMobile = useIsMobile();
const styleState = { isMobile, isExperienceMode };
const styleState = useMemo(
() => ({ isMobile, isExperienceMode }),
[isMobile, isExperienceMode],
);
const [searchParams] = useSearchParams();
const state = usePlaygroundState({ experienceMode: isExperienceMode });
+9 -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 React, { useState, useEffect, useMemo } from 'react';
import { Button as AntButton, Empty as AntEmpty, Tag as AntTag } from 'antd';
import {
@@ -76,9 +77,13 @@ const HistoryPanel = ({ t, refreshTrigger }) => {
}
};
useEffect(() => {
const onScopeChange = useEffectEvent(() => {
loadTopups(page, pageSize);
}, [page, pageSize, keyword, refreshTrigger]);
});
useEffect(
() => onScopeChange(),
[onScopeChange, page, pageSize, keyword, refreshTrigger],
);
// 管理员补单
const handleAdminComplete = async (tradeNo) => {
@@ -120,7 +125,7 @@ const HistoryPanel = ({ t, refreshTrigger }) => {
};
// 表格列定义
const columns = useMemo(() => {
const columns = (() => {
const baseColumns = [
{
title: t('订单号'),
@@ -191,7 +196,7 @@ const HistoryPanel = ({ t, refreshTrigger }) => {
}
return baseColumns;
}, [t, userIsAdmin]);
})();
return (
<div className='rc-history'>
+7 -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 React, { useState, useEffect, useContext } from 'react';
import {
Card,
@@ -55,16 +56,18 @@ const RechargeV2 = () => {
const [wechatOrderData, setWechatOrderData] = useState(null);
// 加载支付配置
useEffect(() => {
const onMount = useEffectEvent(() => {
loadPaymentConfig();
}, []);
});
useEffect(() => onMount(), [onMount]);
// 当选择档位时自动计算
useEffect(() => {
const onScopeChange2 = useEffectEvent(() => {
if (selectedAmountOption) {
calculateAmount();
}
}, [selectedAmountOption]);
});
useEffect(() => onScopeChange2(), [onScopeChange2, selectedAmountOption]);
const loadPaymentConfig = async () => {
try {
+7 -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 React, { useEffect, useState, useContext } from 'react';
import { useLocation } from 'react-router-dom';
import { Segmented, Tabs } from 'antd';
@@ -696,13 +697,15 @@ const Recharge = ({ embedded = false }) => {
// 页面加载时始终刷新用户余额,确保显示最新数据
// (用户可能在其他页面消费或在其他设备充值,localStorage缓存的余额可能过期)
useEffect(() => {
const onMount = useEffectEvent(() => {
getUserQuota();
}, []);
});
useEffect(() => onMount(), [onMount]);
useEffect(() => {
const onMount2 = useEffectEvent(() => {
getTopupInfo();
}, []);
});
useEffect(() => onMount2(), [onMount2]);
useEffect(() => {
const result = getPayPalReturnState(window.location.search);
+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, { useState, useEffect } from 'react';
import {
Form,
@@ -45,9 +46,10 @@ const AmountOptionsManager = ({
const [editModal, setEditModal] = useState({ visible: false, data: null });
const [, setFormApi] = useState(null);
useEffect(() => {
const onScopeChange = useEffectEvent(() => {
loadOptions();
}, [apiPath]);
});
useEffect(() => onScopeChange(), [onScopeChange, apiPath]);
const loadOptions = async () => {
try {
+7 -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 React, { useEffect, useState, useRef } from 'react';
import {
Banner,
@@ -154,7 +155,7 @@ export default function SettingsChats(props) {
}
}
useEffect(() => {
const onOptionsChange = useEffectEvent(() => {
const currentInputs = {};
for (let key in props.options) {
if (Object.keys(inputs).includes(key)) {
@@ -175,13 +176,15 @@ export default function SettingsChats(props) {
// 同步到可视化配置
const configs = jsonToConfigs(currentInputs.Chats || '[]');
setChatConfigs(configs);
}, [props.options]);
});
useEffect(() => onOptionsChange(), [onOptionsChange, props.options]);
useEffect(() => {
const onScopeChange2 = useEffectEvent(() => {
if (editMode === 'visual') {
syncJsonToConfigs();
}
}, [inputs.Chats, editMode]);
});
useEffect(() => onScopeChange2(), [onScopeChange2, inputs.Chats, editMode]);
useEffect(() => {
if (refForm.current && editMode === 'json') {
@@ -203,21 +203,23 @@ const SettingsAPIInfo = ({ options, refresh }) => {
}
};
const apiInfoOption = options['console_setting.api_info'] ?? options.ApiInfo;
useEffect(() => {
const apiInfoStr = options['console_setting.api_info'] ?? options.ApiInfo;
const apiInfoStr = apiInfoOption;
if (apiInfoStr !== undefined) {
parseApiInfo(apiInfoStr);
}
}, [options['console_setting.api_info'], options.ApiInfo]);
}, [apiInfoOption]);
const panelEnabledOption = options['console_setting.api_info_enabled'];
useEffect(() => {
const enabledStr = options['console_setting.api_info_enabled'];
const enabledStr = panelEnabledOption;
setPanelEnabled(
enabledStr === undefined
? true
: enabledStr === 'true' || enabledStr === true,
);
}, [options['console_setting.api_info_enabled']]);
}, [panelEnabledOption]);
const handleToggleEnabled = async (checked) => {
const newValue = checked ? 'true' : 'false';
@@ -309,7 +311,8 @@ const SettingsAPIInfo = ({ options, refresh }) => {
setApiInfoList(newList);
setSelectedRowKeys([]);
setHasChanges(true);
showSuccess(`已删除 ${selectedRowKeys.length} 个API信息,请及时点击“保存设置”进行保存`,
showSuccess(
`已删除 ${selectedRowKeys.length} 个API信息,请及时点击“保存设置”进行保存`,
);
};
@@ -333,22 +333,24 @@ const SettingsAnnouncements = ({ options, refresh }) => {
}
};
const announcementsOption =
options['console_setting.announcements'] ?? options.Announcements;
useEffect(() => {
const annStr =
options['console_setting.announcements'] ?? options.Announcements;
const annStr = announcementsOption;
if (annStr !== undefined) {
parseAnnouncements(annStr);
}
}, [options['console_setting.announcements'], options.Announcements]);
}, [announcementsOption]);
const panelEnabledOption = options['console_setting.announcements_enabled'];
useEffect(() => {
const enabledStr = options['console_setting.announcements_enabled'];
const enabledStr = panelEnabledOption;
setPanelEnabled(
enabledStr === undefined
? true
: enabledStr === 'true' || enabledStr === true,
);
}, [options['console_setting.announcements_enabled']]);
}, [panelEnabledOption]);
const handleToggleEnabled = async (checked) => {
const newValue = checked ? 'true' : 'false';
@@ -381,7 +383,8 @@ const SettingsAnnouncements = ({ options, refresh }) => {
setAnnouncementsList(newList);
setSelectedRowKeys([]);
setHasChanges(true);
showSuccess(`已删除 ${selectedRowKeys.length} 个系统公告,请及时点击“保存设置”进行保存`,
showSuccess(
`已删除 ${selectedRowKeys.length} 个系统公告,请及时点击“保存设置”进行保存`,
);
};
@@ -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, useRef } from 'react';
import { Button, Col, Form, Row, Spin } from '@/components/ui';
import {
@@ -80,7 +81,7 @@ export default function DataDashboard(props) {
});
}
useEffect(() => {
const onOptionsChange = useEffectEvent(() => {
const currentInputs = {};
for (let key in props.options) {
if (Object.keys(inputs).includes(key)) {
@@ -94,7 +95,8 @@ export default function DataDashboard(props) {
'data_export_default_time',
String(inputs.DataExportDefaultTime),
);
}, [props.options]);
});
useEffect(() => onOptionsChange(), [onOptionsChange, props.options]);
return (
<>
+9 -6
View File
@@ -254,20 +254,22 @@ const SettingsFAQ = ({ options, refresh }) => {
}
};
const faqOption = options['console_setting.faq'];
useEffect(() => {
if (options['console_setting.faq'] !== undefined) {
parseFAQ(options['console_setting.faq']);
if (faqOption !== undefined) {
parseFAQ(faqOption);
}
}, [options['console_setting.faq']]);
}, [faqOption]);
const panelEnabledOption = options['console_setting.faq_enabled'];
useEffect(() => {
const enabledStr = options['console_setting.faq_enabled'];
const enabledStr = panelEnabledOption;
setPanelEnabled(
enabledStr === undefined
? true
: enabledStr === 'true' || enabledStr === true,
);
}, [options['console_setting.faq_enabled']]);
}, [panelEnabledOption]);
const handleToggleEnabled = async (checked) => {
const newValue = checked ? 'true' : 'false';
@@ -300,7 +302,8 @@ const SettingsFAQ = ({ options, refresh }) => {
setFaqList(newList);
setSelectedRowKeys([]);
setHasChanges(true);
showSuccess(`已删除 ${selectedRowKeys.length} 个常见问答,请及时点击“保存设置”进行保存`,
showSuccess(
`已删除 ${selectedRowKeys.length} 个常见问答,请及时点击“保存设置”进行保存`,
);
};
@@ -275,21 +275,23 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
}
};
const uptimeGroupsOption = options['console_setting.uptime_kuma_groups'];
useEffect(() => {
const groupsStr = options['console_setting.uptime_kuma_groups'];
const groupsStr = uptimeGroupsOption;
if (groupsStr !== undefined) {
parseUptimeGroups(groupsStr);
}
}, [options['console_setting.uptime_kuma_groups']]);
}, [uptimeGroupsOption]);
const panelEnabledOption = options['console_setting.uptime_kuma_enabled'];
useEffect(() => {
const enabledStr = options['console_setting.uptime_kuma_enabled'];
const enabledStr = panelEnabledOption;
setPanelEnabled(
enabledStr === undefined
? true
: enabledStr === 'true' || enabledStr === true,
);
}, [options['console_setting.uptime_kuma_enabled']]);
}, [panelEnabledOption]);
const handleToggleEnabled = async (checked) => {
const newValue = checked ? 'true' : 'false';
@@ -322,7 +324,8 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
setUptimeGroupsList(newList);
setSelectedRowKeys([]);
setHasChanges(true);
showSuccess(`已删除 ${selectedRowKeys.length} 个分类,请及时点击“保存设置”进行保存`,
showSuccess(
`已删除 ${selectedRowKeys.length} 个分类,请及时点击“保存设置”进行保存`,
);
};
@@ -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, useRef } from 'react';
import { Button, Col, Form, Row, Spin, Tag } from '@/components/ui';
import {
@@ -77,7 +78,7 @@ export default function SettingsDrawing(props) {
});
}
useEffect(() => {
const onOptionsChange = useEffectEvent(() => {
const currentInputs = {};
for (let key in props.options) {
if (Object.keys(inputs).includes(key)) {
@@ -88,7 +89,8 @@ export default function SettingsDrawing(props) {
setInputsRow(structuredClone(currentInputs));
refForm.current.setValues(currentInputs);
localStorage.setItem('mj_notify_enabled', String(inputs.MjNotifyEnabled));
}, [props.options]);
});
useEffect(() => onOptionsChange(), [onOptionsChange, props.options]);
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, useRef } from 'react';
import { Button, Col, Form, Row, Spin } from '@/components/ui';
import {
@@ -99,7 +100,7 @@ export default function SettingClaudeModel(props) {
});
}
useEffect(() => {
const onOptionsChange = useEffectEvent(() => {
const currentInputs = {};
for (let key in props.options) {
if (Object.keys(inputs).includes(key)) {
@@ -109,7 +110,8 @@ export default function SettingClaudeModel(props) {
setInputs(currentInputs);
setInputsRow(structuredClone(currentInputs));
refForm.current.setValues(currentInputs);
}, [props.options]);
});
useEffect(() => onOptionsChange(), [onOptionsChange, props.options]);
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 {
Button,
@@ -85,9 +86,10 @@ const SettingModelCategory = () => {
}
};
useEffect(() => {
const onMount = useEffectEvent(() => {
loadCategories();
}, []);
});
useEffect(() => onMount(), [onMount]);
// 选择一级分类时更新二级分类列表
const handleLevel1Select = (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, useRef, useMemo } from 'react';
import {
Button,
@@ -172,10 +173,11 @@ export default function SettingsDashboardMonitor() {
}
};
useEffect(() => {
const onMount = useEffectEvent(() => {
loadConfig();
loadGroupChannelTree();
}, []);
});
useEffect(() => onMount(), [onMount]);
// 渲染已选择的排除渠道标签
const renderSelectedTags = 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, useState } from 'react';
import {
Card,
@@ -256,10 +257,11 @@ export default function SettingsExperienceCenter({ options, refresh }) {
}
};
useEffect(() => {
const onMount = useEffectEvent(() => {
loadAllModels();
loadAllGroups();
}, []);
});
useEffect(() => onMount(), [onMount]);
// 批量保存所有配置
const handleSave = async () => {
@@ -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, useRef } from 'react';
import { Button, Col, Form, Row, Spin, Banner } from '@/components/ui';
import {
@@ -98,7 +99,7 @@ export default function SettingsFallback(props) {
});
}
useEffect(() => {
const onOptionsChange = useEffectEvent(() => {
const currentInputs = {};
for (let key in props.options) {
if (Object.keys(inputs).includes(key)) {
@@ -110,7 +111,8 @@ export default function SettingsFallback(props) {
setInputs(merged);
setInputsRow(structuredClone(merged));
refForm.current?.setValues(merged);
}, [props.options]);
});
useEffect(() => onOptionsChange(), [onOptionsChange, props.options]);
return (
<Spin spinning={loading}>
@@ -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, useContext } from 'react';
import {
Button,
@@ -265,7 +266,7 @@ export default function SettingsHeaderNavModules(props) {
loadAllGroups();
}, []);
useEffect(() => {
const onOptionsChange = useEffectEvent(() => {
if (props.options && props.options.HeaderNavModules) {
try {
const modules = JSON.parse(props.options.HeaderNavModules);
@@ -298,7 +299,8 @@ export default function SettingsHeaderNavModules(props) {
} else {
setActionButtons(defaultButtons);
}
}, [props.options, t]);
});
useEffect(() => onOptionsChange(), [onOptionsChange, props.options, t]);
// home/about 在顶栏导航中无对应消费点(导航不渲染这两项链接),
// 属于死开关,不再在 UI 展示;保存结构仍保留 key 以兼容旧配置。
+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, useRef } from 'react';
import {
Button,
@@ -178,7 +179,7 @@ export default function SettingsLog(props) {
});
}
useEffect(() => {
const onOptionsChange = useEffectEvent(() => {
const currentInputs = {};
for (let key in props.options) {
if (Object.keys(inputs).includes(key)) {
@@ -191,7 +192,8 @@ export default function SettingsLog(props) {
setInputs({ ...inputs, ...currentInputs });
setInputsRow(structuredClone(currentInputs));
refForm.current.setValues(currentInputs);
}, [props.options]);
});
useEffect(() => onOptionsChange(), [onOptionsChange, props.options]);
return (
<>
<Spin spinning={loading}>
@@ -16,6 +16,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, useRef } from 'react';
import { Banner, Button, Col, Form, Row, Spin } from '@/components/ui';
import { API, showError, showSuccess, showWarning } from '../../../helpers';
@@ -79,7 +80,7 @@ export default function SettingsMarquee(props) {
});
}
useEffect(() => {
const onOptionsChange = useEffectEvent(() => {
const currentInputs = { ...inputs };
for (let key in props.options) {
if (Object.keys(currentInputs).includes(key)) {
@@ -89,7 +90,8 @@ export default function SettingsMarquee(props) {
setInputs(currentInputs);
setInputsRow(structuredClone(currentInputs));
refForm.current?.setValues(currentInputs);
}, [props.options]);
});
useEffect(() => onOptionsChange(), [onOptionsChange, props.options]);
return (
<Spin spinning={loading}>
@@ -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, useRef } from 'react';
import { Button, Col, Form, Row, Spin } from '@/components/ui';
import {
@@ -91,7 +92,7 @@ export default function SettingsMonitoring(props) {
});
}
useEffect(() => {
const onOptionsChange = useEffectEvent(() => {
const currentInputs = {};
for (let key in props.options) {
if (Object.keys(inputs).includes(key)) {
@@ -101,7 +102,8 @@ export default function SettingsMonitoring(props) {
setInputs(currentInputs);
setInputsRow(structuredClone(currentInputs));
refForm.current.setValues(currentInputs);
}, [props.options]);
});
useEffect(() => onOptionsChange(), [onOptionsChange, props.options]);
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, useRef } from 'react';
import { Button, Col, Form, Row, Spin } from '@/components/ui';
import {
@@ -74,7 +75,7 @@ export default function SettingsSensitiveWords(props) {
});
}
useEffect(() => {
const onOptionsChange = useEffectEvent(() => {
const currentInputs = {};
for (let key in props.options) {
if (Object.keys(inputs).includes(key)) {
@@ -84,7 +85,8 @@ export default function SettingsSensitiveWords(props) {
setInputs(currentInputs);
setInputsRow(structuredClone(currentInputs));
refForm.current.setValues(currentInputs);
}, [props.options]);
});
useEffect(() => onOptionsChange(), [onOptionsChange, props.options]);
return (
<>
<Spin spinning={loading}>
+10 -10
View File
@@ -273,14 +273,14 @@ export default function SettingsTheme(props) {
// 当前生效的 token(生效预设 + 自定义覆盖),用于预览
// 依赖 presetOverridesState:管理员编辑预设模板后重算
const effectiveLight = useMemo(
() => ({ ...getEffectivePreset(selectedPreset).light, ...customLight }),
[selectedPreset, customLight, presetOverridesState],
);
const effectiveDark = useMemo(
() => ({ ...getEffectivePreset(selectedPreset).dark, ...customDark }),
[selectedPreset, customDark, presetOverridesState],
);
const effectiveLight = {
...getEffectivePreset(selectedPreset).light,
...customLight,
};
const effectiveDark = {
...getEffectivePreset(selectedPreset).dark,
...customDark,
};
const effectivePalette =
colorMode === 'light' ? effectiveLight : effectiveDark;
@@ -430,10 +430,10 @@ export default function SettingsTheme(props) {
/* ============ 编辑预设模板 ============ */
// 当前编辑预设的浅色 effective(生效预设浅色 ∪ 草稿)
const presetEditLight = useMemo(() => {
const presetEditLight = (() => {
const base = getEffectivePreset(editingPresetKey).light;
return { ...base, ...presetDraft };
}, [editingPresetKey, presetDraft, presetOverridesState]);
})();
// 切换正在编辑的预设:载入其 effective 浅色作为草稿起点
const handleSelectEditingPreset = (key) => {
@@ -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 {
Button,
@@ -184,10 +185,11 @@ export default function SettingsMembership() {
}
};
useEffect(() => {
const onMount = useEffectEvent(() => {
fetchPlans();
fetchSetting();
}, []);
});
useEffect(() => onMount(), [onMount]);
// 表格列定义
const columns = [
@@ -17,13 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import React, { useState } from 'react';
import {
Form,
Button,
Typography,
Space,
Divider,
} from '@/components/ui';
import { Form, Button, Typography, Space, Divider } from '@/components/ui';
import { API, showError, showSuccess } from '../../../helpers';
import { useTranslation } from 'react-i18next';
@@ -105,7 +99,9 @@ const SettingsPaymentAlipay = ({ options, refresh }) => {
href='https://open.alipay.com'
target='_blank'
rel='noopener noreferrer'
>{t('支付宝开放平台')}</a>{' '}
>
{t('支付宝开放平台')}
</a>{' '}
{t('获取相关配置信息。')}
</Text>
@@ -151,7 +147,9 @@ const SettingsPaymentAlipay = ({ options, refresh }) => {
placeholder={
options.AlipayPrivateKey === '***ALREADY_SET***'
? t('已设置(留空不修改,填写新内容则更新)')
: t('请粘贴完整的 RSA2 私钥内容(包含 -----BEGIN PRIVATE KEY----- 等)')
: t(
'请粘贴完整的 RSA2 私钥内容(包含 -----BEGIN PRIVATE KEY----- 等)',
)
}
rows={6}
extraText={
@@ -235,7 +233,9 @@ const SettingsPaymentAlipay = ({ options, refresh }) => {
/>
<Space style={{ marginTop: 20 }}>
<Button type='primary' htmlType='submit' loading={loading}>{t('保存配置')}</Button>
<Button type='primary' htmlType='submit' loading={loading}>
{t('保存配置')}
</Button>
</Space>
</Form>
</>
@@ -172,11 +172,19 @@ export default function SettingsPaymentGateway(props) {
href='https://dashboard.stripe.com/developers'
target='_blank'
rel='noreferrer'
>{t('点击此处')}</a>{t('进行设置,最好先在')}<a
>
{t('点击此处')}
</a>
{t('进行设置,最好先在')}
<a
href='https://dashboard.stripe.com/test/developers'
target='_blank'
rel='noreferrer'
>{t('测试环境')}</a>{t('进行测试。')}<br />
>
{t('测试环境')}
</a>
{t('进行测试。')}
<br />
</Text>
<Banner
type='info'
@@ -17,13 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import React, { useState } from 'react';
import {
Form,
Button,
Typography,
Space,
Divider,
} from '@/components/ui';
import { Form, Button, Typography, Space, Divider } from '@/components/ui';
import { API, showError, showSuccess } from '../../../helpers';
import { useTranslation } from 'react-i18next';
@@ -131,7 +125,9 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
href='https://pay.weixin.qq.com'
target='_blank'
rel='noopener noreferrer'
>{t('微信支付商户平台')}</a>{' '}
>
{t('微信支付商户平台')}
</a>{' '}
获取相关配置信息。
</Text>
@@ -234,7 +230,9 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
<Divider margin='12px' />
<Title heading={6} style={{ marginTop: 16, marginBottom: 8 }}>{t('公钥模式(2024年新商户必选)')}</Title>
<Title heading={6} style={{ marginTop: 16, marginBottom: 8 }}>
{t('公钥模式(2024年新商户必选)')}
</Title>
<Text type='tertiary' style={{ display: 'block', marginBottom: 12 }}>
2024年后注册的微信支付商户默认使用公钥模式。如果初始化失败提示"无可用的平台证书",
请从商户平台下载微信支付公钥并启用此模式。
@@ -271,8 +269,14 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
<Divider margin='12px' />
<Title heading={6} style={{ marginTop: 16, marginBottom: 8 }}>{t('高级配置:手动平台证书模式(可选)')}</Title>
<Text type='tertiary' style={{ display: 'block', marginBottom: 12 }}>{t('默认情况下,SDK 会自动下载微信平台证书,无需手动配置。仅在离线环境或网络受限时启用此选项。')}</Text>
<Title heading={6} style={{ marginTop: 16, marginBottom: 8 }}>
{t('高级配置:手动平台证书模式(可选)')}
</Title>
<Text type='tertiary' style={{ display: 'block', marginBottom: 12 }}>
{t(
'默认情况下,SDK 会自动下载微信平台证书,无需手动配置。仅在离线环境或网络受限时启用此选项。',
)}
</Text>
<Form.Switch
field='WechatUseManualCert'
@@ -342,7 +346,9 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
/>
<Space style={{ marginTop: 20 }}>
<Button type='primary' htmlType='submit' loading={loading}>{t('保存配置')}</Button>
<Button type='primary' htmlType='submit' loading={loading}>
{t('保存配置')}
</Button>
</Space>
</Form>
</>
@@ -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 { useState, useEffect, useContext } from 'react';
import { useTranslation } from 'react-i18next';
import {
@@ -187,7 +188,7 @@ export default function SettingsSidebarModulesUser() {
}
// 统一的配置加载逻辑
useEffect(() => {
const onScopeChange = useEffectEvent(() => {
const loadConfigs = async () => {
try {
// 获取管理员全局配置
@@ -245,13 +246,18 @@ export default function SettingsSidebarModulesUser() {
if (!permissionsLoading && hasSidebarSettingsPermission()) {
loadConfigs();
}
}, [
statusState,
permissionsLoading,
hasSidebarSettingsPermission,
isSidebarSectionAllowed,
isSidebarModuleAllowed,
]);
});
useEffect(
() => onScopeChange(),
[
onScopeChange,
statusState,
permissionsLoading,
hasSidebarSettingsPermission,
isSidebarSectionAllowed,
isSidebarModuleAllowed,
],
);
// 检查功能是否被管理员允许
const isAllowedByAdmin = (sectionKey, moduleKey = null) => {
@@ -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, useRef } from 'react';
import { Button, Col, Form, Row, Spin } from '@/components/ui';
import {
@@ -85,7 +86,7 @@ export default function RequestRateLimit(props) {
});
}
useEffect(() => {
const onOptionsChange = useEffectEvent(() => {
const currentInputs = {};
for (let key in props.options) {
if (Object.keys(inputs).includes(key)) {
@@ -95,7 +96,8 @@ export default function RequestRateLimit(props) {
setInputs(currentInputs);
setInputsRow(structuredClone(currentInputs));
refForm.current.setValues(currentInputs);
}, [props.options]);
});
useEffect(() => onOptionsChange(), [onOptionsChange, props.options]);
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, useRef } from 'react';
import { Banner, Button, Col, Form, Row, Spin } from '@/components/ui';
import {
@@ -87,7 +88,7 @@ export default function GroupRatioSettings(props) {
}
}
useEffect(() => {
const onOptionsChange = useEffectEvent(() => {
const currentInputs = {};
for (let key in props.options) {
if (Object.keys(inputs).includes(key)) {
@@ -97,7 +98,8 @@ export default function GroupRatioSettings(props) {
setInputs(currentInputs);
setInputsRow(structuredClone(currentInputs));
refForm.current.setValues(currentInputs);
}, [props.options]);
});
useEffect(() => onOptionsChange(), [onOptionsChange, props.options]);
return (
<Spin spinning={loading}>
@@ -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, useRef } from 'react';
import {
Button,
@@ -121,7 +122,7 @@ export default function ModelRatioSettings(props) {
}
}
useEffect(() => {
const onOptionsChange = useEffectEvent(() => {
const currentInputs = {};
for (let key in props.options) {
if (Object.keys(inputs).includes(key)) {
@@ -131,7 +132,8 @@ export default function ModelRatioSettings(props) {
setInputs(currentInputs);
setInputsRow(structuredClone(currentInputs));
refForm.current.setValues(currentInputs);
}, [props.options]);
});
useEffect(() => onOptionsChange(), [onOptionsChange, props.options]);
return (
<Spin spinning={loading}>
@@ -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 {
Table,
@@ -74,12 +75,13 @@ export default function ModelRatioNotSetEditor(props) {
}
};
useEffect(() => {
const onMount = useEffectEvent(() => {
// 获取所有启用的模型
getAllEnabledModels();
}, []);
});
useEffect(() => onMount(), [onMount]);
useEffect(() => {
const onOptionsChange2 = useEffectEvent(() => {
try {
const modelPrice = JSON.parse(props.options.ModelPrice || '{}');
const modelRatio = JSON.parse(props.options.ModelRatio || '{}');
@@ -108,7 +110,11 @@ export default function ModelRatioNotSetEditor(props) {
} catch (error) {
console.error(t('JSON解析错误:'), error);
}
}, [props.options, enabledModels]);
});
useEffect(
() => onOptionsChange2(),
[onOptionsChange2, props.options, enabledModels],
);
// 首先声明分页相关的工具函数
const getPagedData = (data, currentPage, pageSize) => {
@@ -89,6 +89,7 @@ function ConflictConfirmModal({ t, visible, items, onOk, onCancel }) {
}
export default function UpstreamRatioSync(props) {
const { refresh } = props;
const { t } = useTranslation();
const [modalVisible, setModalVisible] = useState(false);
const [loading, setLoading] = useState(false);
@@ -383,7 +384,7 @@ export default function UpstreamRatioSync(props) {
if (results.every((res) => res.data.success)) {
showSuccess(t('同步成功'));
props.refresh();
refresh();
setDifferences((prevDifferences) => {
const newDifferences = { ...prevDifferences };
@@ -413,7 +414,7 @@ export default function UpstreamRatioSync(props) {
setLoading(false);
}
},
[resolutions, props.options, props.refresh],
[resolutions, refresh, t],
);
const getCurrentPageData = (dataSource) => {
+11 -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, useState } from 'react';
import { Layout, TabPane, Tabs } from '@/components/ui';
import { useNavigate, useLocation } from 'react-router-dom';
@@ -287,7 +288,7 @@ const Setting = () => {
setTabActiveKey(key);
navigate(`?tab=${key}`);
};
useEffect(() => {
const onScopeChange = useEffectEvent(() => {
// 非 root 的可见 tab 依赖 status 中的下放配置;status 未加载前不要急于重定向,
// 否则深链到「被下放 tab」会因 panes 尚未包含它而被错误重定向走。
if (!isRoot() && !statusState?.status) {
@@ -307,7 +308,15 @@ const Setting = () => {
if (tab !== nextTab) {
navigate(`?tab=${nextTab}`, { replace: true });
}
}, [location.search, statusState?.status?.AdminDelegatedSettingTabs]);
});
useEffect(
() => onScopeChange(),
[
onScopeChange,
location.search,
statusState?.status?.AdminDelegatedSettingTabs,
],
);
return (
<div
className='settings-page app-scrollbar'
+2 -1
View File
@@ -6,7 +6,8 @@
否则 hero 标题会被跑马灯压住(与 Channel 页 mt-[60px] 同理)。
本类同时服务 /console/skill-platform 与 /console/expert-platform。 */
padding: 68px clamp(16px, 3vw, 42px) 56px;
background: radial-gradient(
background:
radial-gradient(
circle at 92% 2%,
color-mix(in srgb, var(--ui-color-success) 14%, transparent),
transparent 29rem
+11 -5
View File
@@ -108,14 +108,22 @@ const Status = () => {
height: 8,
borderRadius: '50%',
backgroundColor:
status === 1 ? 'var(--ui-color-success)' : status === 2 ? 'var(--ui-color-warning)' : 'var(--ui-color-danger)',
status === 1
? 'var(--ui-color-success)'
: status === 2
? 'var(--ui-color-warning)'
: 'var(--ui-color-danger)',
boxShadow: `0 0 4px ${status === 1 ? 'var(--ui-color-success)' : status === 2 ? 'var(--ui-color-warning)' : 'var(--ui-color-danger)'}`,
}}
/>
<Text
style={{
color:
status === 1 ? 'var(--ui-color-success)' : status === 2 ? 'var(--ui-color-warning)' : 'var(--ui-color-danger)',
status === 1
? 'var(--ui-color-success)'
: status === 2
? 'var(--ui-color-warning)'
: 'var(--ui-color-danger)',
}}
>
{text}
@@ -132,9 +140,7 @@ const Status = () => {
};
return (
<Layout
style={{ minHeight: '100vh', background: 'var(--ui-color-bg-0)' }}
>
<Layout style={{ minHeight: '100vh', background: 'var(--ui-color-bg-0)' }}>
<Content style={{ padding: '24px' }}>
<div style={{ maxWidth: 1200, margin: '0 auto' }}>
<div style={{ marginBottom: 24, textAlign: 'center' }}>
+133 -139
View File
@@ -342,158 +342,152 @@ const Subscription = () => {
}
};
const columns = useMemo(() => {
return [
{ title: 'ID', dataIndex: 'id', width: 70 },
{
title: t('用户'),
width: 180,
render: (_, r) => {
const display = r.display_name || '';
const username = r.username || '';
return (
<div className='flex flex-col'>
<span className='font-medium'>
{display || username || `User#${r.user_id}`}
</span>
<span className='text-xs text-gray-400'>
#{r.user_id}
{username ? ` @${username}` : ''}
</span>
</div>
);
},
},
{
title: t('套餐'),
width: 180,
render: (_, r) => (
<Space spacing={4} wrap>
<Tag color={planTypeColorMap[r.plan_type] || 'grey'} size='small'>
{r.plan_name || r.plan_type}
</Tag>
{r.tier ? (
<Tag
color={tierColorMap[r.tier] || 'grey'}
size='small'
type='ghost'
>
{r.tier}
</Tag>
) : null}
</Space>
),
},
{
title: t('状态'),
dataIndex: 'status',
width: 90,
render: (s) => (
<Tag color={statusColorMap[s] || 'grey'}>{t(s || '未知')}</Tag>
),
},
{
title: t('起始时间'),
dataIndex: 'start_date',
width: 110,
render: formatDateOnly,
},
{
title: t('到期时间'),
width: 160,
render: (_, r) => (
const columns = [
{ title: 'ID', dataIndex: 'id', width: 70 },
{
title: t('用户'),
width: 180,
render: (_, r) => {
const display = r.display_name || '';
const username = r.username || '';
return (
<div className='flex flex-col'>
<span>{formatDateOnly(r.end_date)}</span>
<RemainingTag endDate={r.end_date} status={r.status} t={t} />
<span className='font-medium'>
{display || username || `User#${r.user_id}`}
</span>
<span className='text-xs text-gray-400'>
#{r.user_id}
{username ? ` @${username}` : ''}
</span>
</div>
),
);
},
{
title: t('每日额度'),
dataIndex: 'daily_quota',
width: 110,
render: (v) => renderQuota(v, 2),
},
{
title: t('支付金额'),
dataIndex: 'price_paid',
width: 100,
render: (v) => (v != null ? `¥${Number(v).toFixed(2)}` : '-'),
},
{
title: t('操作'),
width: 300,
fixed: 'right',
render: (_, r) => (
<Space spacing={4} wrap>
},
{
title: t('套餐'),
width: 180,
render: (_, r) => (
<Space spacing={4} wrap>
<Tag color={planTypeColorMap[r.plan_type] || 'grey'} size='small'>
{r.plan_name || r.plan_type}
</Tag>
{r.tier ? (
<Tag
color={tierColorMap[r.tier] || 'grey'}
size='small'
type='ghost'
>
{r.tier}
</Tag>
) : null}
</Space>
),
},
{
title: t('状态'),
dataIndex: 'status',
width: 90,
render: (s) => (
<Tag color={statusColorMap[s] || 'grey'}>{t(s || '未知')}</Tag>
),
},
{
title: t('起始时间'),
dataIndex: 'start_date',
width: 110,
render: formatDateOnly,
},
{
title: t('到期时间'),
width: 160,
render: (_, r) => (
<div className='flex flex-col'>
<span>{formatDateOnly(r.end_date)}</span>
<RemainingTag endDate={r.end_date} status={r.status} t={t} />
</div>
),
},
{
title: t('每日额度'),
dataIndex: 'daily_quota',
width: 110,
render: (v) => renderQuota(v, 2),
},
{
title: t('支付金额'),
dataIndex: 'price_paid',
width: 100,
render: (v) => (v != null ? `¥${Number(v).toFixed(2)}` : '-'),
},
{
title: t('操作'),
width: 300,
fixed: 'right',
render: (_, r) => (
<Space spacing={4} wrap>
<Button size='small' theme='borderless' onClick={() => openDetail(r)}>
{t('详情')}
</Button>
{admin && r.status !== 'banned' && (
<Button
size='small'
theme='borderless'
onClick={() => openDetail(r)}
type='danger'
icon={<Ban size={12} />}
onClick={() => openBan(r)}
>
{t('详情')}
{t('封禁')}
</Button>
{admin && r.status !== 'banned' && (
)}
{admin && r.status === 'banned' && (
<Button
size='small'
theme='borderless'
type='primary'
icon={<ShieldCheck size={12} />}
onClick={() => openUnban(r)}
>
{t('解封')}
</Button>
)}
{admin && r.status !== 'canceled' && r.status !== 'banned' && (
<Button
size='small'
theme='borderless'
icon={<CalendarClock size={12} />}
onClick={() => openExtend(r)}
>
{t('延长')}
</Button>
)}
{admin && (
<Button
size='small'
theme='borderless'
icon={<Pencil size={12} />}
onClick={() => openEdit(r)}
>
{t('编辑')}
</Button>
)}
{admin && r.status === 'active' && (
<Popconfirm
title={t('确认手动补发今日额度?')}
onConfirm={() => doGrant(r)}
>
<Button
size='small'
theme='borderless'
type='danger'
icon={<Ban size={12} />}
onClick={() => openBan(r)}
icon={<Sparkles size={12} />}
>
{t('封禁')}
{t('补发')}
</Button>
)}
{admin && r.status === 'banned' && (
<Button
size='small'
theme='borderless'
type='primary'
icon={<ShieldCheck size={12} />}
onClick={() => openUnban(r)}
>
{t('解封')}
</Button>
)}
{admin && r.status !== 'canceled' && r.status !== 'banned' && (
<Button
size='small'
theme='borderless'
icon={<CalendarClock size={12} />}
onClick={() => openExtend(r)}
>
{t('延长')}
</Button>
)}
{admin && (
<Button
size='small'
theme='borderless'
icon={<Pencil size={12} />}
onClick={() => openEdit(r)}
>
{t('编辑')}
</Button>
)}
{admin && r.status === 'active' && (
<Popconfirm
title={t('确认手动补发今日额度?')}
onConfirm={() => doGrant(r)}
>
<Button
size='small'
theme='borderless'
icon={<Sparkles size={12} />}
>
{t('补发')}
</Button>
</Popconfirm>
)}
</Space>
),
},
];
}, [t, admin]);
</Popconfirm>
)}
</Space>
),
},
];
return (
<div className='console-content'>
+41 -10
View File
@@ -123,7 +123,11 @@ Video Tutorial Component Styles
.video-retry-btn {
padding: 12px 32px;
background: linear-gradient(135deg, var(--brand-primary), var(--brand-gradient-via));
background: linear-gradient(
135deg,
var(--brand-primary),
var(--brand-gradient-via)
);
border: none;
border-radius: 14px;
color: white;
@@ -157,7 +161,8 @@ Video Tutorial Component Styles
.video-retry-btn:hover {
transform: translateY(-3px) scale(1.02);
box-shadow: 0 12px 28px color-mix(in srgb, var(--brand-primary) 50%, transparent);
box-shadow: 0 12px 28px
color-mix(in srgb, var(--brand-primary) 50%, transparent);
}
/* 视频信息 */
@@ -240,7 +245,11 @@ Video Tutorial Component Styles
content: '';
width: 4px;
height: 20px;
background: linear-gradient(135deg, var(--brand-primary), var(--brand-gradient-via));
background: linear-gradient(
135deg,
var(--brand-primary),
var(--brand-gradient-via)
);
border-radius: 2px;
}
@@ -276,7 +285,11 @@ Video Tutorial Component Styles
left: 0;
width: 4px;
height: 100%;
background: linear-gradient(135deg, var(--brand-primary), var(--brand-gradient-via));
background: linear-gradient(
135deg,
var(--brand-primary),
var(--brand-gradient-via)
);
transform: scaleY(0);
transition: transform 0.3s ease;
border-radius: 0 4px 4px 0;
@@ -324,7 +337,11 @@ Video Tutorial Component Styles
right: 8px;
width: 24px;
height: 24px;
background: linear-gradient(135deg, var(--brand-primary), var(--brand-gradient-via));
background: linear-gradient(
135deg,
var(--brand-primary),
var(--brand-gradient-via)
);
border-radius: 50%;
display: flex;
align-items: center;
@@ -396,7 +413,8 @@ Video Tutorial Component Styles
font-size: 11px;
font-weight: 700;
color: white;
box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-primary) 40%, transparent);
box-shadow: 0 2px 8px
color-mix(in srgb, var(--brand-primary) 40%, transparent);
}
.video-list-duration {
@@ -461,9 +479,14 @@ Video Tutorial Component Styles
}
.video-tips-card:hover {
border-color: color-mix(in srgb, var(--brand-primary) 25%, transparent) !important;
border-color: color-mix(
in srgb,
var(--brand-primary) 25%,
transparent
) !important;
transform: translateY(-2px);
box-shadow: 0 8px 24px color-mix(in srgb, var(--brand-primary) 10%, transparent);
box-shadow: 0 8px 24px
color-mix(in srgb, var(--brand-primary) 10%, transparent);
}
.video-tips-card::before {
@@ -571,7 +594,11 @@ html.dark .video-tutorial-empty {
html.dark .video-player-card {
background: var(--ui-color-bg-1);
border-color: color-mix(in srgb, var(--brand-primary) 20%, transparent) !important;
border-color: color-mix(
in srgb,
var(--brand-primary) 20%,
transparent
) !important;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
@@ -634,7 +661,11 @@ html.dark .video-tips-card {
color-mix(in srgb, var(--brand-primary) 10%, transparent),
color-mix(in srgb, var(--brand-gradient-via) 10%, transparent)
) !important;
border-color: color-mix(in srgb, var(--brand-primary) 25%, transparent) !important;
border-color: color-mix(
in srgb,
var(--brand-primary) 25%,
transparent
) !important;
}
html.dark .video-tips-content strong {
@@ -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, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { Typography, Card, Empty, Spin, Toast } from '@/components/ui';
@@ -35,9 +36,10 @@ const VideoTutorial = () => {
const videoRef = useRef(null);
// 获取视频列表
useEffect(() => {
const onMount = useEffectEvent(() => {
loadVideos();
}, []);
});
useEffect(() => onMount(), [onMount]);
const loadVideos = async () => {
setLoading(true);
+4 -2
View File
@@ -23,7 +23,8 @@ License, or (at your option) any later version.
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(
background:
radial-gradient(
circle at 50% 50%,
color-mix(in srgb, var(--brand-primary) 5%, transparent) 0%,
transparent 50%
@@ -1600,7 +1601,8 @@ html.dark .tutorial-card-animated:hover {
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(
background:
radial-gradient(
circle at 30% 50%,
color-mix(in srgb, var(--brand-primary) 5%, transparent) 0%,
transparent 50%
+1 -7
View File
@@ -32,13 +32,7 @@ import {
Empty,
Spin,
} from '@/components/ui';
import {
Receipt,
Plus,
Download,
Eye,
X,
} from 'lucide-react';
import { Receipt, Plus, Download, Eye, X } from 'lucide-react';
import UserCenterPageHeader from '../../components/common/UserCenterPageHeader';
import { API, showError, showSuccess } from '../../helpers';
import {
+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, useState } from 'react';
import { Select } from 'antd';
import UserCenterPageHeader from '../../components/common/UserCenterPageHeader';
@@ -124,9 +125,10 @@ const UserDashboard = () => {
};
// ========== Effects ==========
useEffect(() => {
const onMount = useEffectEvent(() => {
initChart();
}, []);
});
useEffect(() => onMount(), [onMount]);
// ========== 公告弹窗检查 ==========
useEffect(() => {
+3 -10
View File
@@ -19,11 +19,7 @@
transparent
);
--wd-danger: var(--ui-color-danger);
--wd-danger-tint: color-mix(
in srgb,
var(--ui-color-danger) 8%,
transparent
);
--wd-danger-tint: color-mix(in srgb, var(--ui-color-danger) 8%, transparent);
position: relative;
color: var(--wd-ink);
}
@@ -155,11 +151,8 @@
overflow: hidden;
padding: 20px;
border-color: var(--wd-accent-line);
background: radial-gradient(
120% 160% at 100% 0%,
var(--wd-tint) 0%,
transparent 55%
),
background:
radial-gradient(120% 160% at 100% 0%, var(--wd-tint) 0%, transparent 55%),
var(--wd-card);
}
@media (min-width: 640px) {