feat: 参考原型图 ui优化提交 个人端-用户中心 相关的页面
This commit is contained in:
@@ -265,10 +265,10 @@ export const useAdminTokensData = () => {
|
||||
|
||||
const handleRow = (record) => {
|
||||
if (record.DeletedAt !== null && record.DeletedAt !== undefined) {
|
||||
return { style: { background: 'var(--semi-color-disabled-border)' } };
|
||||
return { style: { background: 'var(--ui-color-disabled-border)' } };
|
||||
}
|
||||
if (record.status !== 1) {
|
||||
return { style: { background: 'var(--semi-color-fill-0)' } };
|
||||
return { style: { background: 'var(--ui-color-fill-0)' } };
|
||||
}
|
||||
return {};
|
||||
};
|
||||
|
||||
@@ -701,7 +701,7 @@ export const useChannelsData = () => {
|
||||
if (record.status !== 1) {
|
||||
return {
|
||||
style: {
|
||||
background: 'var(--semi-color-disabled-border)',
|
||||
background: 'var(--ui-color-disabled-border)',
|
||||
},
|
||||
};
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
Copyright (C) 2025 QuantumNous
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { useCallback, useContext, useSyncExternalStore } from 'react';
|
||||
import { StatusContext } from '../../context/Status';
|
||||
|
||||
const STORAGE_KEY = 'marquee_dismissed_content';
|
||||
const listeners = new Set();
|
||||
|
||||
const readDismissed = () => {
|
||||
try {
|
||||
return sessionStorage.getItem(STORAGE_KEY) || '';
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
const subscribe = (listener) => {
|
||||
listeners.add(listener);
|
||||
return () => listeners.delete(listener);
|
||||
};
|
||||
|
||||
// 公告栏内容与关闭状态:关闭仅对当前会话、当前公告内容生效,公告内容变更后自动重新显示。
|
||||
export const useMarquee = () => {
|
||||
const [statusState] = useContext(StatusContext);
|
||||
const content = statusState?.status?.marquee_content?.trim() || '';
|
||||
const dismissed = useSyncExternalStore(subscribe, readDismissed);
|
||||
|
||||
const dismiss = useCallback(() => {
|
||||
try {
|
||||
sessionStorage.setItem(STORAGE_KEY, content);
|
||||
} catch (e) {
|
||||
// 存储不可用时仅本次内存态无法记忆,忽略
|
||||
}
|
||||
listeners.forEach((listener) => listener());
|
||||
}, [content]);
|
||||
|
||||
return { visible: !!content && dismissed !== content, dismiss };
|
||||
};
|
||||
@@ -109,7 +109,7 @@ export const useNavigation = (
|
||||
{
|
||||
text: t('秘钥管理'),
|
||||
itemKey: 'keyManagement',
|
||||
to: '/key-management',
|
||||
to: '/user-center/key-management',
|
||||
requireAuth: getHeaderModuleRequireAuth(modules, 'keyManagement'),
|
||||
},
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useState, useCallback, useEffect } from 'react';
|
||||
import { initVChartSemiTheme } from '@visactor/vchart-semi-theme';
|
||||
import { initVChartTheme } from '@/components/ui/chartTheme';
|
||||
import {
|
||||
modelColorMap,
|
||||
renderNumber,
|
||||
@@ -887,7 +887,7 @@ export const useDashboardCharts = (
|
||||
|
||||
// ========== 初始化图表主题 ==========
|
||||
useEffect(() => {
|
||||
initVChartSemiTheme({
|
||||
initVChartTheme({
|
||||
isWatchingThemeSwitch: true,
|
||||
});
|
||||
}, []);
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
IconStopwatchStroked,
|
||||
IconTypograph,
|
||||
IconSend,
|
||||
} from '@douyinfe/semi-icons';
|
||||
} from '@/components/ui/icons';
|
||||
import { renderNumber, renderQuota } from '../../helpers';
|
||||
import { createSectionTitle } from '../../helpers/dashboard';
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Modal } from '@douyinfe/semi-ui';
|
||||
import { Modal } from '@/components/ui';
|
||||
import {
|
||||
API,
|
||||
copy,
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
showInfo,
|
||||
showSuccess,
|
||||
} from '../../helpers';
|
||||
import { Modal } from '@douyinfe/semi-ui';
|
||||
import { Modal } from '@/components/ui';
|
||||
import { UserContext } from '../../context/User';
|
||||
import { StatusContext } from '../../context/Status';
|
||||
|
||||
|
||||
@@ -358,7 +358,7 @@ export const useModelsData = () => {
|
||||
record.status !== 1
|
||||
? {
|
||||
style: {
|
||||
background: 'var(--semi-color-disabled-border)',
|
||||
background: 'var(--ui-color-disabled-border)',
|
||||
},
|
||||
}
|
||||
: {};
|
||||
@@ -367,7 +367,7 @@ export const useModelsData = () => {
|
||||
...rowStyle,
|
||||
onClick: (event) => {
|
||||
// Don't trigger row selection when clicking on buttons
|
||||
if (event.target.closest('button, .semi-button')) {
|
||||
if (event.target.closest('button, .ant-btn')) {
|
||||
return;
|
||||
}
|
||||
const newSelectedKeys = selectedKeys.some(
|
||||
|
||||
@@ -19,7 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import { useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Toast } from '@douyinfe/semi-ui';
|
||||
import { Toast } from '@/components/ui';
|
||||
import { SSE } from 'sse.js';
|
||||
import {
|
||||
API_ENDPOINTS,
|
||||
|
||||
@@ -35,7 +35,7 @@ const NEAR_BOTTOM_PX = 80;
|
||||
const findScrollable = (rootEl) => {
|
||||
if (!rootEl) return null;
|
||||
try {
|
||||
const direct = rootEl.querySelector('[class*="semi-chat-container"]');
|
||||
const direct = rootEl.querySelector('[class*="ui-chat-container"]');
|
||||
if (direct && direct.scrollHeight > direct.clientHeight) return direct;
|
||||
if (direct) {
|
||||
const inner = Array.from(direct.querySelectorAll('*')).find((el) => {
|
||||
|
||||
@@ -28,7 +28,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
// - 失败/超时一律不抛错、不打断用户;会话切换后只跳过内存 setState,PUT 仍写回原会话。
|
||||
|
||||
import { useCallback } from 'react';
|
||||
import { Toast } from '@douyinfe/semi-ui';
|
||||
import { Toast } from '@/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { API_ENDPOINTS } from '../../constants/playground.constants';
|
||||
import {
|
||||
|
||||
@@ -18,7 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useCallback, useRef, useState } from 'react';
|
||||
import { Toast } from '@douyinfe/semi-ui';
|
||||
import { Toast } from '@/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { API } from '../../helpers';
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useCallback } from 'react';
|
||||
import { Toast, Modal } from '@douyinfe/semi-ui';
|
||||
import { Toast, Modal } from '@/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { getTextContent } from '../../helpers';
|
||||
import { ERROR_MESSAGES } from '../../constants/playground.constants';
|
||||
|
||||
@@ -18,7 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useCallback, useState, useRef } from 'react';
|
||||
import { Toast, Modal } from '@douyinfe/semi-ui';
|
||||
import { Toast, Modal } from '@/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
getTextContent,
|
||||
|
||||
@@ -19,7 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import { useState, useCallback, useRef, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Toast } from '@douyinfe/semi-ui';
|
||||
import { Toast } from '@/components/ui';
|
||||
import {
|
||||
getDefaultMessages,
|
||||
DEFAULT_CONFIG,
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
REDEMPTION_ACTIONS,
|
||||
REDEMPTION_STATUS,
|
||||
} from '../../constants/redemption.constants';
|
||||
import { Modal } from '@douyinfe/semi-ui';
|
||||
import { Modal } from '@/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useTableCompactMode } from '../common/useTableCompactMode';
|
||||
|
||||
@@ -217,7 +217,7 @@ export const useRedemptionsData = () => {
|
||||
if (record.status !== REDEMPTION_STATUS.UNUSED || isExpired(record)) {
|
||||
return {
|
||||
style: {
|
||||
background: 'var(--semi-color-disabled-border)',
|
||||
background: 'var(--ui-color-disabled-border)',
|
||||
},
|
||||
};
|
||||
} else {
|
||||
|
||||
@@ -19,7 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import { useState, useEffect, useRef, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Modal } from '@douyinfe/semi-ui';
|
||||
import { Modal } from '@/components/ui';
|
||||
import {
|
||||
API,
|
||||
copy,
|
||||
|
||||
@@ -19,7 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Modal } from '@douyinfe/semi-ui';
|
||||
import { Modal } from '@/components/ui';
|
||||
import {
|
||||
API,
|
||||
copy,
|
||||
@@ -247,7 +247,7 @@ export const useTokensData = (openFluentNotification) => {
|
||||
if (record.status !== 1) {
|
||||
return {
|
||||
style: {
|
||||
background: 'var(--semi-color-disabled-border)',
|
||||
background: 'var(--ui-color-disabled-border)',
|
||||
},
|
||||
};
|
||||
} else {
|
||||
|
||||
@@ -19,7 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Modal } from '@douyinfe/semi-ui';
|
||||
import { Modal } from '@/components/ui';
|
||||
import {
|
||||
API,
|
||||
getTodayStartTimestamp,
|
||||
|
||||
@@ -224,7 +224,7 @@ export const useUsersData = () => {
|
||||
if (record.DeletedAt !== null || record.status !== 1) {
|
||||
return {
|
||||
style: {
|
||||
background: 'var(--semi-color-disabled-border)',
|
||||
background: 'var(--ui-color-disabled-border)',
|
||||
},
|
||||
};
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user