2024-03-15 16:05:33 +08:00
|
|
|
|
import React, { useEffect, useState } from 'react';
|
2025-05-23 13:30:40 +08:00
|
|
|
|
import { useTranslation } from 'react-i18next';
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
import {
|
|
|
|
|
|
Palette,
|
|
|
|
|
|
ZoomIn,
|
|
|
|
|
|
Shuffle,
|
|
|
|
|
|
Move,
|
|
|
|
|
|
FileText,
|
|
|
|
|
|
Blend,
|
|
|
|
|
|
Upload,
|
|
|
|
|
|
Minimize2,
|
|
|
|
|
|
RotateCcw,
|
|
|
|
|
|
PaintBucket,
|
|
|
|
|
|
Focus,
|
|
|
|
|
|
Move3D,
|
|
|
|
|
|
Monitor,
|
|
|
|
|
|
UserCheck,
|
|
|
|
|
|
HelpCircle,
|
|
|
|
|
|
CheckCircle,
|
|
|
|
|
|
Clock,
|
|
|
|
|
|
Copy,
|
|
|
|
|
|
FileX,
|
|
|
|
|
|
Pause,
|
|
|
|
|
|
XCircle,
|
|
|
|
|
|
Loader,
|
|
|
|
|
|
AlertCircle,
|
|
|
|
|
|
Hash
|
|
|
|
|
|
} from 'lucide-react';
|
2024-03-23 21:24:39 +08:00
|
|
|
|
import {
|
|
|
|
|
|
API,
|
|
|
|
|
|
copy,
|
|
|
|
|
|
isAdmin,
|
|
|
|
|
|
showError,
|
|
|
|
|
|
showSuccess,
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
timestamp2string
|
2025-06-04 00:42:06 +08:00
|
|
|
|
} from '../../helpers';
|
2024-03-23 21:24:39 +08:00
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
|
Button,
|
2025-05-23 13:30:40 +08:00
|
|
|
|
Card,
|
|
|
|
|
|
Checkbox,
|
|
|
|
|
|
Divider,
|
2025-06-08 23:42:39 +08:00
|
|
|
|
Empty,
|
2025-06-08 18:41:04 +08:00
|
|
|
|
Form,
|
2024-03-23 21:24:39 +08:00
|
|
|
|
ImagePreview,
|
|
|
|
|
|
Layout,
|
|
|
|
|
|
Modal,
|
|
|
|
|
|
Progress,
|
2025-05-23 13:30:40 +08:00
|
|
|
|
Skeleton,
|
2024-03-23 21:24:39 +08:00
|
|
|
|
Table,
|
|
|
|
|
|
Tag,
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
Typography
|
2024-03-23 21:24:39 +08:00
|
|
|
|
} from '@douyinfe/semi-ui';
|
2025-06-08 23:42:39 +08:00
|
|
|
|
import {
|
|
|
|
|
|
IllustrationNoResult,
|
|
|
|
|
|
IllustrationNoResultDark
|
|
|
|
|
|
} from '@douyinfe/semi-illustrations';
|
2025-06-04 00:42:06 +08:00
|
|
|
|
import { ITEMS_PER_PAGE } from '../../constants';
|
2025-05-23 13:30:40 +08:00
|
|
|
|
import {
|
|
|
|
|
|
IconEyeOpened,
|
|
|
|
|
|
IconSearch,
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
IconSetting
|
2025-05-23 13:30:40 +08:00
|
|
|
|
} from '@douyinfe/semi-icons';
|
|
|
|
|
|
|
|
|
|
|
|
const { Text } = Typography;
|
2023-08-14 22:16:32 +08:00
|
|
|
|
|
2024-03-23 21:24:39 +08:00
|
|
|
|
const colors = [
|
|
|
|
|
|
'amber',
|
|
|
|
|
|
'blue',
|
|
|
|
|
|
'cyan',
|
|
|
|
|
|
'green',
|
|
|
|
|
|
'grey',
|
|
|
|
|
|
'indigo',
|
|
|
|
|
|
'light-blue',
|
|
|
|
|
|
'lime',
|
|
|
|
|
|
'orange',
|
|
|
|
|
|
'pink',
|
|
|
|
|
|
'purple',
|
|
|
|
|
|
'red',
|
|
|
|
|
|
'teal',
|
|
|
|
|
|
'violet',
|
|
|
|
|
|
'yellow',
|
2024-03-15 16:05:33 +08:00
|
|
|
|
];
|
2023-08-14 22:16:32 +08:00
|
|
|
|
|
2025-05-23 13:30:40 +08:00
|
|
|
|
// 定义列键值常量
|
|
|
|
|
|
const COLUMN_KEYS = {
|
|
|
|
|
|
SUBMIT_TIME: 'submit_time',
|
|
|
|
|
|
DURATION: 'duration',
|
|
|
|
|
|
CHANNEL: 'channel',
|
|
|
|
|
|
TYPE: 'type',
|
|
|
|
|
|
TASK_ID: 'task_id',
|
|
|
|
|
|
SUBMIT_RESULT: 'submit_result',
|
|
|
|
|
|
TASK_STATUS: 'task_status',
|
|
|
|
|
|
PROGRESS: 'progress',
|
|
|
|
|
|
IMAGE: 'image',
|
|
|
|
|
|
PROMPT: 'prompt',
|
|
|
|
|
|
PROMPT_EN: 'prompt_en',
|
|
|
|
|
|
FAIL_REASON: 'fail_reason',
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2024-12-13 19:03:14 +08:00
|
|
|
|
const LogsTable = () => {
|
|
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
|
|
|
|
const [modalContent, setModalContent] = useState('');
|
2025-05-23 13:30:40 +08:00
|
|
|
|
|
|
|
|
|
|
// 列可见性状态
|
|
|
|
|
|
const [visibleColumns, setVisibleColumns] = useState({});
|
|
|
|
|
|
const [showColumnSelector, setShowColumnSelector] = useState(false);
|
|
|
|
|
|
const isAdminUser = isAdmin();
|
|
|
|
|
|
|
|
|
|
|
|
// 加载保存的列偏好设置
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
const savedColumns = localStorage.getItem('mj-logs-table-columns');
|
|
|
|
|
|
if (savedColumns) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
const parsed = JSON.parse(savedColumns);
|
|
|
|
|
|
const defaults = getDefaultColumnVisibility();
|
|
|
|
|
|
const merged = { ...defaults, ...parsed };
|
|
|
|
|
|
setVisibleColumns(merged);
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
console.error('Failed to parse saved column preferences', e);
|
|
|
|
|
|
initDefaultColumns();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
initDefaultColumns();
|
|
|
|
|
|
}
|
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
|
|
// 获取默认列可见性
|
|
|
|
|
|
const getDefaultColumnVisibility = () => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
[COLUMN_KEYS.SUBMIT_TIME]: true,
|
|
|
|
|
|
[COLUMN_KEYS.DURATION]: true,
|
|
|
|
|
|
[COLUMN_KEYS.CHANNEL]: isAdminUser,
|
|
|
|
|
|
[COLUMN_KEYS.TYPE]: true,
|
|
|
|
|
|
[COLUMN_KEYS.TASK_ID]: true,
|
|
|
|
|
|
[COLUMN_KEYS.SUBMIT_RESULT]: isAdminUser,
|
|
|
|
|
|
[COLUMN_KEYS.TASK_STATUS]: true,
|
|
|
|
|
|
[COLUMN_KEYS.PROGRESS]: true,
|
|
|
|
|
|
[COLUMN_KEYS.IMAGE]: true,
|
|
|
|
|
|
[COLUMN_KEYS.PROMPT]: true,
|
|
|
|
|
|
[COLUMN_KEYS.PROMPT_EN]: true,
|
|
|
|
|
|
[COLUMN_KEYS.FAIL_REASON]: true,
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 初始化默认列可见性
|
|
|
|
|
|
const initDefaultColumns = () => {
|
|
|
|
|
|
const defaults = getDefaultColumnVisibility();
|
|
|
|
|
|
setVisibleColumns(defaults);
|
|
|
|
|
|
localStorage.setItem('mj-logs-table-columns', JSON.stringify(defaults));
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 处理列可见性变化
|
|
|
|
|
|
const handleColumnVisibilityChange = (columnKey, checked) => {
|
|
|
|
|
|
const updatedColumns = { ...visibleColumns, [columnKey]: checked };
|
|
|
|
|
|
setVisibleColumns(updatedColumns);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 处理全选
|
|
|
|
|
|
const handleSelectAll = (checked) => {
|
|
|
|
|
|
const allKeys = Object.keys(COLUMN_KEYS).map((key) => COLUMN_KEYS[key]);
|
|
|
|
|
|
const updatedColumns = {};
|
|
|
|
|
|
|
|
|
|
|
|
allKeys.forEach((key) => {
|
|
|
|
|
|
if ((key === COLUMN_KEYS.CHANNEL || key === COLUMN_KEYS.SUBMIT_RESULT) && !isAdminUser) {
|
|
|
|
|
|
updatedColumns[key] = false;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
updatedColumns[key] = checked;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
setVisibleColumns(updatedColumns);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 更新表格时保存列可见性
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
if (Object.keys(visibleColumns).length > 0) {
|
|
|
|
|
|
localStorage.setItem('mj-logs-table-columns', JSON.stringify(visibleColumns));
|
|
|
|
|
|
}
|
|
|
|
|
|
}, [visibleColumns]);
|
|
|
|
|
|
|
2024-12-13 19:03:14 +08:00
|
|
|
|
function renderType(type) {
|
|
|
|
|
|
switch (type) {
|
|
|
|
|
|
case 'IMAGINE':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='blue' size='large' shape='circle' prefixIcon={<Palette size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('绘图')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'UPSCALE':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='orange' size='large' shape='circle' prefixIcon={<ZoomIn size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('放大')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'VARIATION':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='purple' size='large' shape='circle' prefixIcon={<Shuffle size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('变换')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'HIGH_VARIATION':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='purple' size='large' shape='circle' prefixIcon={<Shuffle size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('强变换')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'LOW_VARIATION':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='purple' size='large' shape='circle' prefixIcon={<Shuffle size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('弱变换')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'PAN':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='cyan' size='large' shape='circle' prefixIcon={<Move size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('平移')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'DESCRIBE':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='yellow' size='large' shape='circle' prefixIcon={<FileText size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('图生文')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'BLEND':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='lime' size='large' shape='circle' prefixIcon={<Blend size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('图混合')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'UPLOAD':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='blue' size='large' shape='circle' prefixIcon={<Upload size={14} />}>
|
2025-04-04 12:00:38 +08:00
|
|
|
|
上传文件
|
|
|
|
|
|
</Tag>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
);
|
|
|
|
|
|
case 'SHORTEN':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='pink' size='large' shape='circle' prefixIcon={<Minimize2 size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('缩词')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'REROLL':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='indigo' size='large' shape='circle' prefixIcon={<RotateCcw size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('重绘')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'INPAINT':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='violet' size='large' shape='circle' prefixIcon={<PaintBucket size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('局部重绘-提交')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'ZOOM':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='teal' size='large' shape='circle' prefixIcon={<Focus size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('变焦')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'CUSTOM_ZOOM':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='teal' size='large' shape='circle' prefixIcon={<Move3D size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('自定义变焦-提交')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'MODAL':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='green' size='large' shape='circle' prefixIcon={<Monitor size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('窗口处理')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'SWAP_FACE':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='light-green' size='large' shape='circle' prefixIcon={<UserCheck size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('换脸')}
|
2024-07-31 15:48:51 +08:00
|
|
|
|
</Tag>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
);
|
|
|
|
|
|
default:
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='white' size='large' shape='circle' prefixIcon={<HelpCircle size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('未知')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
2024-03-15 16:05:33 +08:00
|
|
|
|
}
|
2025-04-04 12:00:38 +08:00
|
|
|
|
|
2024-12-13 19:03:14 +08:00
|
|
|
|
function renderCode(code) {
|
|
|
|
|
|
switch (code) {
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='green' size='large' shape='circle' prefixIcon={<CheckCircle size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('已提交')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 21:
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='lime' size='large' shape='circle' prefixIcon={<Clock size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('等待中')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 22:
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='orange' size='large' shape='circle' prefixIcon={<Copy size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('重复提交')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 0:
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='yellow' size='large' shape='circle' prefixIcon={<FileX size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('未提交')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
default:
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='white' size='large' shape='circle' prefixIcon={<HelpCircle size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('未知')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
2024-03-15 16:05:33 +08:00
|
|
|
|
}
|
2025-04-04 12:00:38 +08:00
|
|
|
|
|
2024-12-13 19:03:14 +08:00
|
|
|
|
function renderStatus(type) {
|
|
|
|
|
|
switch (type) {
|
|
|
|
|
|
case 'SUCCESS':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='green' size='large' shape='circle' prefixIcon={<CheckCircle size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('成功')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'NOT_START':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='grey' size='large' shape='circle' prefixIcon={<Pause size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('未启动')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'SUBMITTED':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='yellow' size='large' shape='circle' prefixIcon={<Clock size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('队列中')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'IN_PROGRESS':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='blue' size='large' shape='circle' prefixIcon={<Loader size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('执行中')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'FAILURE':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='red' size='large' shape='circle' prefixIcon={<XCircle size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('失败')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
case 'MODAL':
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='yellow' size='large' shape='circle' prefixIcon={<AlertCircle size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('窗口等待')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
default:
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color='white' size='large' shape='circle' prefixIcon={<HelpCircle size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('未知')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-04-04 12:00:38 +08:00
|
|
|
|
|
2024-12-13 19:03:14 +08:00
|
|
|
|
const renderTimestamp = (timestampInSeconds) => {
|
|
|
|
|
|
const date = new Date(timestampInSeconds * 1000); // 从秒转换为毫秒
|
2025-04-04 12:00:38 +08:00
|
|
|
|
|
2024-12-13 19:03:14 +08:00
|
|
|
|
const year = date.getFullYear(); // 获取年份
|
|
|
|
|
|
const month = ('0' + (date.getMonth() + 1)).slice(-2); // 获取月份,从0开始需要+1,并保证两位数
|
|
|
|
|
|
const day = ('0' + date.getDate()).slice(-2); // 获取日期,并保证两位数
|
|
|
|
|
|
const hours = ('0' + date.getHours()).slice(-2); // 获取小时,并保证两位数
|
|
|
|
|
|
const minutes = ('0' + date.getMinutes()).slice(-2); // 获取分钟,并保证两位数
|
|
|
|
|
|
const seconds = ('0' + date.getSeconds()).slice(-2); // 获取秒钟,并保证两位数
|
2025-04-04 12:00:38 +08:00
|
|
|
|
|
2024-12-13 19:03:14 +08:00
|
|
|
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; // 格式化输出
|
|
|
|
|
|
};
|
|
|
|
|
|
// 修改renderDuration函数以包含颜色逻辑
|
|
|
|
|
|
function renderDuration(submit_time, finishTime) {
|
|
|
|
|
|
if (!submit_time || !finishTime) return 'N/A';
|
|
|
|
|
|
|
|
|
|
|
|
const start = new Date(submit_time);
|
|
|
|
|
|
const finish = new Date(finishTime);
|
|
|
|
|
|
const durationMs = finish - start;
|
|
|
|
|
|
const durationSec = (durationMs / 1000).toFixed(1);
|
|
|
|
|
|
const color = durationSec > 60 ? 'red' : 'green';
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
<Tag color={color} size='large' shape='circle' prefixIcon={<Clock size={14} />}>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{durationSec} {t('秒')}
|
|
|
|
|
|
</Tag>
|
|
|
|
|
|
);
|
2024-03-15 16:05:33 +08:00
|
|
|
|
}
|
2025-05-23 13:30:40 +08:00
|
|
|
|
|
|
|
|
|
|
// 定义所有列
|
|
|
|
|
|
const allColumns = [
|
2024-03-15 16:05:33 +08:00
|
|
|
|
{
|
2025-05-23 13:30:40 +08:00
|
|
|
|
key: COLUMN_KEYS.SUBMIT_TIME,
|
2024-12-13 19:03:14 +08:00
|
|
|
|
title: t('提交时间'),
|
2024-03-15 16:05:33 +08:00
|
|
|
|
dataIndex: 'submit_time',
|
|
|
|
|
|
render: (text, record, index) => {
|
2024-03-23 21:24:39 +08:00
|
|
|
|
return <div>{renderTimestamp(text / 1000)}</div>;
|
|
|
|
|
|
},
|
2024-03-15 16:05:33 +08:00
|
|
|
|
},
|
2024-05-06 17:18:04 +08:00
|
|
|
|
{
|
2025-05-23 13:30:40 +08:00
|
|
|
|
key: COLUMN_KEYS.DURATION,
|
2024-12-13 19:03:14 +08:00
|
|
|
|
title: t('花费时间'),
|
2025-05-25 23:35:59 +08:00
|
|
|
|
dataIndex: 'finish_time',
|
2024-05-06 17:18:04 +08:00
|
|
|
|
render: (finish, record) => {
|
|
|
|
|
|
return renderDuration(record.submit_time, finish);
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2024-03-15 16:05:33 +08:00
|
|
|
|
{
|
2025-05-23 13:30:40 +08:00
|
|
|
|
key: COLUMN_KEYS.CHANNEL,
|
2024-12-13 19:03:14 +08:00
|
|
|
|
title: t('渠道'),
|
2024-03-15 16:05:33 +08:00
|
|
|
|
dataIndex: 'channel_id',
|
|
|
|
|
|
className: isAdmin() ? 'tableShow' : 'tableHiddle',
|
|
|
|
|
|
render: (text, record, index) => {
|
2025-05-23 13:30:40 +08:00
|
|
|
|
return isAdminUser ? (
|
2024-03-15 16:05:33 +08:00
|
|
|
|
<div>
|
2024-03-23 21:24:39 +08:00
|
|
|
|
<Tag
|
|
|
|
|
|
color={colors[parseInt(text) % colors.length]}
|
|
|
|
|
|
size='large'
|
2025-05-23 13:30:40 +08:00
|
|
|
|
shape='circle'
|
✨ feat: Add lucide-react icons to all table Tag components
- Add semantic icons to ChannelsTable.js for channel status, response time, and quota display
- Add status and quota icons to TokensTable.js for better visual distinction
- Add status and quota icons to RedemptionsTable.js for redemption code management
- Add role, status, and statistics icons to UsersTable.js for user management
- Import appropriate lucide-react icons for each table component
- Enhance UI consistency and user experience across all table interfaces
Icons added include:
- Status indicators: CheckCircle, XCircle, AlertCircle, HelpCircle
- Performance metrics: Zap, Timer, Clock, AlertTriangle, TestTube
- Financial data: Coins, DollarSign
- User roles: User, Shield, Crown
- Activity tracking: Activity, Users, UserPlus
This improves visual clarity and makes table data more intuitive to understand.
2025-06-08 23:13:45 +08:00
|
|
|
|
prefixIcon={<Hash size={14} />}
|
2024-03-23 21:24:39 +08:00
|
|
|
|
onClick={() => {
|
2025-05-25 23:35:59 +08:00
|
|
|
|
copyText(text);
|
2024-03-23 21:24:39 +08:00
|
|
|
|
}}
|
|
|
|
|
|
>
|
|
|
|
|
|
{' '}
|
|
|
|
|
|
{text}{' '}
|
|
|
|
|
|
</Tag>
|
2024-03-15 16:05:33 +08:00
|
|
|
|
</div>
|
2025-05-23 13:30:40 +08:00
|
|
|
|
) : (
|
|
|
|
|
|
<></>
|
2024-03-15 16:05:33 +08:00
|
|
|
|
);
|
2024-03-23 21:24:39 +08:00
|
|
|
|
},
|
2024-03-15 16:05:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-05-23 13:30:40 +08:00
|
|
|
|
key: COLUMN_KEYS.TYPE,
|
2024-12-13 19:03:14 +08:00
|
|
|
|
title: t('类型'),
|
2024-03-15 16:05:33 +08:00
|
|
|
|
dataIndex: 'action',
|
|
|
|
|
|
render: (text, record, index) => {
|
2024-03-23 21:24:39 +08:00
|
|
|
|
return <div>{renderType(text)}</div>;
|
|
|
|
|
|
},
|
2024-03-15 16:05:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-05-23 13:30:40 +08:00
|
|
|
|
key: COLUMN_KEYS.TASK_ID,
|
2024-12-13 19:03:14 +08:00
|
|
|
|
title: t('任务ID'),
|
2024-03-15 16:05:33 +08:00
|
|
|
|
dataIndex: 'mj_id',
|
|
|
|
|
|
render: (text, record, index) => {
|
2024-03-23 21:24:39 +08:00
|
|
|
|
return <div>{text}</div>;
|
|
|
|
|
|
},
|
2024-03-15 16:05:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-05-23 13:30:40 +08:00
|
|
|
|
key: COLUMN_KEYS.SUBMIT_RESULT,
|
2024-12-13 19:03:14 +08:00
|
|
|
|
title: t('提交结果'),
|
2024-03-15 16:05:33 +08:00
|
|
|
|
dataIndex: 'code',
|
|
|
|
|
|
className: isAdmin() ? 'tableShow' : 'tableHiddle',
|
|
|
|
|
|
render: (text, record, index) => {
|
2025-05-23 13:30:40 +08:00
|
|
|
|
return isAdminUser ? <div>{renderCode(text)}</div> : <></>;
|
2024-03-23 21:24:39 +08:00
|
|
|
|
},
|
2024-03-15 16:05:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-05-23 13:30:40 +08:00
|
|
|
|
key: COLUMN_KEYS.TASK_STATUS,
|
2024-12-13 19:03:14 +08:00
|
|
|
|
title: t('任务状态'),
|
2024-03-15 16:05:33 +08:00
|
|
|
|
dataIndex: 'status',
|
|
|
|
|
|
className: isAdmin() ? 'tableShow' : 'tableHiddle',
|
|
|
|
|
|
render: (text, record, index) => {
|
2024-03-23 21:24:39 +08:00
|
|
|
|
return <div>{renderStatus(text)}</div>;
|
|
|
|
|
|
},
|
2024-03-15 16:05:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-05-23 13:30:40 +08:00
|
|
|
|
key: COLUMN_KEYS.PROGRESS,
|
2024-12-13 19:03:14 +08:00
|
|
|
|
title: t('进度'),
|
2024-03-15 16:05:33 +08:00
|
|
|
|
dataIndex: 'progress',
|
|
|
|
|
|
render: (text, record, index) => {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div>
|
|
|
|
|
|
{
|
2024-03-23 21:24:39 +08:00
|
|
|
|
<Progress
|
|
|
|
|
|
stroke={
|
|
|
|
|
|
record.status === 'FAILURE'
|
|
|
|
|
|
? 'var(--semi-color-warning)'
|
|
|
|
|
|
: null
|
|
|
|
|
|
}
|
|
|
|
|
|
percent={text ? parseInt(text.replace('%', '')) : 0}
|
|
|
|
|
|
showInfo={true}
|
|
|
|
|
|
aria-label='drawing progress'
|
2025-06-08 12:23:54 +08:00
|
|
|
|
style={{ minWidth: '160px' }}
|
2024-03-23 21:24:39 +08:00
|
|
|
|
/>
|
2024-01-10 18:32:44 +08:00
|
|
|
|
}
|
2024-03-15 16:05:33 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
);
|
2024-03-23 21:24:39 +08:00
|
|
|
|
},
|
2024-03-15 16:05:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-05-23 13:30:40 +08:00
|
|
|
|
key: COLUMN_KEYS.IMAGE,
|
2024-12-13 19:03:14 +08:00
|
|
|
|
title: t('结果图片'),
|
2024-03-15 16:05:33 +08:00
|
|
|
|
dataIndex: 'image_url',
|
|
|
|
|
|
render: (text, record, index) => {
|
|
|
|
|
|
if (!text) {
|
2024-12-13 19:03:14 +08:00
|
|
|
|
return t('无');
|
2023-11-23 18:18:03 +08:00
|
|
|
|
}
|
2024-03-15 16:05:33 +08:00
|
|
|
|
return (
|
|
|
|
|
|
<Button
|
|
|
|
|
|
onClick={() => {
|
2025-05-25 23:35:59 +08:00
|
|
|
|
setModalImageUrl(text);
|
|
|
|
|
|
setIsModalOpenurl(true);
|
2024-03-15 16:05:33 +08:00
|
|
|
|
}}
|
2025-06-08 12:23:54 +08:00
|
|
|
|
className="!rounded-full"
|
2024-03-15 16:05:33 +08:00
|
|
|
|
>
|
2024-12-13 19:03:14 +08:00
|
|
|
|
{t('查看图片')}
|
2024-03-15 16:05:33 +08:00
|
|
|
|
</Button>
|
|
|
|
|
|
);
|
2024-03-23 21:24:39 +08:00
|
|
|
|
},
|
2024-03-15 16:05:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-05-23 13:30:40 +08:00
|
|
|
|
key: COLUMN_KEYS.PROMPT,
|
2024-03-15 16:05:33 +08:00
|
|
|
|
title: 'Prompt',
|
|
|
|
|
|
dataIndex: 'prompt',
|
|
|
|
|
|
render: (text, record, index) => {
|
|
|
|
|
|
if (!text) {
|
2024-12-13 19:03:14 +08:00
|
|
|
|
return t('无');
|
2023-11-23 18:18:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-03-15 16:05:33 +08:00
|
|
|
|
return (
|
|
|
|
|
|
<Typography.Text
|
|
|
|
|
|
ellipsis={{ showTooltip: true }}
|
|
|
|
|
|
style={{ width: 100 }}
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
setModalContent(text);
|
|
|
|
|
|
setIsModalOpen(true);
|
|
|
|
|
|
}}
|
|
|
|
|
|
>
|
|
|
|
|
|
{text}
|
|
|
|
|
|
</Typography.Text>
|
|
|
|
|
|
);
|
2024-03-23 21:24:39 +08:00
|
|
|
|
},
|
2024-03-15 16:05:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-05-23 13:30:40 +08:00
|
|
|
|
key: COLUMN_KEYS.PROMPT_EN,
|
2024-03-15 16:05:33 +08:00
|
|
|
|
title: 'PromptEn',
|
|
|
|
|
|
dataIndex: 'prompt_en',
|
|
|
|
|
|
render: (text, record, index) => {
|
|
|
|
|
|
if (!text) {
|
2024-12-13 19:03:14 +08:00
|
|
|
|
return t('无');
|
2023-11-23 18:18:03 +08:00
|
|
|
|
}
|
2024-03-15 16:05:33 +08:00
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<Typography.Text
|
|
|
|
|
|
ellipsis={{ showTooltip: true }}
|
|
|
|
|
|
style={{ width: 100 }}
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
setModalContent(text);
|
|
|
|
|
|
setIsModalOpen(true);
|
|
|
|
|
|
}}
|
|
|
|
|
|
>
|
|
|
|
|
|
{text}
|
|
|
|
|
|
</Typography.Text>
|
|
|
|
|
|
);
|
2024-03-23 21:24:39 +08:00
|
|
|
|
},
|
2024-03-15 16:05:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-05-23 13:30:40 +08:00
|
|
|
|
key: COLUMN_KEYS.FAIL_REASON,
|
2024-12-13 19:03:14 +08:00
|
|
|
|
title: t('失败原因'),
|
2024-03-15 16:05:33 +08:00
|
|
|
|
dataIndex: 'fail_reason',
|
2025-06-07 02:45:07 +08:00
|
|
|
|
fixed: 'right',
|
2024-03-15 16:05:33 +08:00
|
|
|
|
render: (text, record, index) => {
|
|
|
|
|
|
if (!text) {
|
2024-12-13 19:03:14 +08:00
|
|
|
|
return t('无');
|
2023-11-23 18:18:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-03-15 16:05:33 +08:00
|
|
|
|
return (
|
|
|
|
|
|
<Typography.Text
|
|
|
|
|
|
ellipsis={{ showTooltip: true }}
|
|
|
|
|
|
style={{ width: 100 }}
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
setModalContent(text);
|
|
|
|
|
|
setIsModalOpen(true);
|
|
|
|
|
|
}}
|
|
|
|
|
|
>
|
|
|
|
|
|
{text}
|
|
|
|
|
|
</Typography.Text>
|
|
|
|
|
|
);
|
2024-03-23 21:24:39 +08:00
|
|
|
|
},
|
|
|
|
|
|
},
|
2024-03-15 16:05:33 +08:00
|
|
|
|
];
|
|
|
|
|
|
|
2025-05-23 13:30:40 +08:00
|
|
|
|
// 根据可见性设置过滤列
|
|
|
|
|
|
const getVisibleColumns = () => {
|
|
|
|
|
|
return allColumns.filter((column) => visibleColumns[column.key]);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2024-03-15 16:05:33 +08:00
|
|
|
|
const [logs, setLogs] = useState([]);
|
|
|
|
|
|
const [loading, setLoading] = useState(true);
|
|
|
|
|
|
const [activePage, setActivePage] = useState(1);
|
🚀 feat(pagination): unify backend-driven pagination & improve channel tag aggregation
SUMMARY
• Migrated Token, Task, Midjourney, Channel, Redemption tables to true server-side pagination.
• Added total / page / page_size metadata in API responses; switched all affected React tables to consume new structure.
• Implemented counting helpers:
– model/token.go CountUserTokens
– model/task.go TaskCountAllTasks / TaskCountAllUserTask
– model/midjourney.go CountAllTasks / CountAllUserTask
– model/channel.go CountAllChannels / CountAllTags
• Refactored controllers (token, task, midjourney, channel) for 1-based paging & aggregated returns.
• Redesigned `ChannelsTable.js`:
– `loadChannels`, `syncPageData`, `enrichChannels` for tag-mode grouping without recursion.
– Fixed runtime white-screen (maximum call-stack) by removing child duplication.
– Pagination, search, tag-mode, idSort all hot-reload correctly.
• Removed unused `log` import in controller/midjourney.go.
BREAKING CHANGES
Front-end consumers must now expect data.items / total / page / page_size from list endpoints (`/api/channel`, `/api/task`, `/api/mj`, `/api/token`, etc.).
2025-06-12 17:25:25 +08:00
|
|
|
|
const [logCount, setLogCount] = useState(0);
|
2025-05-23 13:30:40 +08:00
|
|
|
|
const [pageSize, setPageSize] = useState(ITEMS_PER_PAGE);
|
2024-03-15 16:05:33 +08:00
|
|
|
|
const [isModalOpenurl, setIsModalOpenurl] = useState(false);
|
2024-03-15 22:15:16 +08:00
|
|
|
|
const [showBanner, setShowBanner] = useState(false);
|
2024-03-15 16:05:33 +08:00
|
|
|
|
|
|
|
|
|
|
// 定义模态框图片URL的状态和更新函数
|
|
|
|
|
|
const [modalImageUrl, setModalImageUrl] = useState('');
|
|
|
|
|
|
let now = new Date();
|
2025-06-08 18:41:04 +08:00
|
|
|
|
|
|
|
|
|
|
// Form 初始值
|
|
|
|
|
|
const formInitValues = {
|
2024-03-15 16:05:33 +08:00
|
|
|
|
channel_id: '',
|
|
|
|
|
|
mj_id: '',
|
2025-06-08 18:41:04 +08:00
|
|
|
|
dateRange: [
|
|
|
|
|
|
timestamp2string(now.getTime() / 1000 - 2592000),
|
|
|
|
|
|
timestamp2string(now.getTime() / 1000 + 3600)
|
|
|
|
|
|
],
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Form API 引用
|
|
|
|
|
|
const [formApi, setFormApi] = useState(null);
|
2024-03-15 16:05:33 +08:00
|
|
|
|
|
|
|
|
|
|
const [stat, setStat] = useState({
|
|
|
|
|
|
quota: 0,
|
2024-03-23 21:24:39 +08:00
|
|
|
|
token: 0,
|
2024-03-15 16:05:33 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
2025-06-08 18:41:04 +08:00
|
|
|
|
// 获取表单值的辅助函数
|
|
|
|
|
|
const getFormValues = () => {
|
|
|
|
|
|
const formValues = formApi ? formApi.getValues() : {};
|
|
|
|
|
|
|
|
|
|
|
|
// 处理时间范围
|
|
|
|
|
|
let start_timestamp = timestamp2string(now.getTime() / 1000 - 2592000);
|
|
|
|
|
|
let end_timestamp = timestamp2string(now.getTime() / 1000 + 3600);
|
|
|
|
|
|
|
|
|
|
|
|
if (formValues.dateRange && Array.isArray(formValues.dateRange) && formValues.dateRange.length === 2) {
|
|
|
|
|
|
start_timestamp = formValues.dateRange[0];
|
|
|
|
|
|
end_timestamp = formValues.dateRange[1];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
channel_id: formValues.channel_id || '',
|
|
|
|
|
|
mj_id: formValues.mj_id || '',
|
|
|
|
|
|
start_timestamp,
|
|
|
|
|
|
end_timestamp,
|
|
|
|
|
|
};
|
2024-03-15 16:05:33 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
🚀 feat(pagination): unify backend-driven pagination & improve channel tag aggregation
SUMMARY
• Migrated Token, Task, Midjourney, Channel, Redemption tables to true server-side pagination.
• Added total / page / page_size metadata in API responses; switched all affected React tables to consume new structure.
• Implemented counting helpers:
– model/token.go CountUserTokens
– model/task.go TaskCountAllTasks / TaskCountAllUserTask
– model/midjourney.go CountAllTasks / CountAllUserTask
– model/channel.go CountAllChannels / CountAllTags
• Refactored controllers (token, task, midjourney, channel) for 1-based paging & aggregated returns.
• Redesigned `ChannelsTable.js`:
– `loadChannels`, `syncPageData`, `enrichChannels` for tag-mode grouping without recursion.
– Fixed runtime white-screen (maximum call-stack) by removing child duplication.
– Pagination, search, tag-mode, idSort all hot-reload correctly.
• Removed unused `log` import in controller/midjourney.go.
BREAKING CHANGES
Front-end consumers must now expect data.items / total / page / page_size from list endpoints (`/api/channel`, `/api/task`, `/api/mj`, `/api/token`, etc.).
2025-06-12 17:25:25 +08:00
|
|
|
|
const enrichLogs = (items) => {
|
|
|
|
|
|
return items.map((log) => ({
|
|
|
|
|
|
...log,
|
|
|
|
|
|
timestamp2string: timestamp2string(log.created_at),
|
|
|
|
|
|
key: '' + log.id,
|
|
|
|
|
|
}));
|
2024-03-15 16:05:33 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
🚀 feat(pagination): unify backend-driven pagination & improve channel tag aggregation
SUMMARY
• Migrated Token, Task, Midjourney, Channel, Redemption tables to true server-side pagination.
• Added total / page / page_size metadata in API responses; switched all affected React tables to consume new structure.
• Implemented counting helpers:
– model/token.go CountUserTokens
– model/task.go TaskCountAllTasks / TaskCountAllUserTask
– model/midjourney.go CountAllTasks / CountAllUserTask
– model/channel.go CountAllChannels / CountAllTags
• Refactored controllers (token, task, midjourney, channel) for 1-based paging & aggregated returns.
• Redesigned `ChannelsTable.js`:
– `loadChannels`, `syncPageData`, `enrichChannels` for tag-mode grouping without recursion.
– Fixed runtime white-screen (maximum call-stack) by removing child duplication.
– Pagination, search, tag-mode, idSort all hot-reload correctly.
• Removed unused `log` import in controller/midjourney.go.
BREAKING CHANGES
Front-end consumers must now expect data.items / total / page / page_size from list endpoints (`/api/channel`, `/api/task`, `/api/mj`, `/api/token`, etc.).
2025-06-12 17:25:25 +08:00
|
|
|
|
const syncPageData = (payload) => {
|
|
|
|
|
|
const items = enrichLogs(payload.items || []);
|
|
|
|
|
|
setLogs(items);
|
|
|
|
|
|
setLogCount(payload.total || 0);
|
|
|
|
|
|
setActivePage(payload.page || 1);
|
|
|
|
|
|
setPageSize(payload.page_size || pageSize);
|
|
|
|
|
|
};
|
2024-03-15 16:05:33 +08:00
|
|
|
|
|
🚀 feat(pagination): unify backend-driven pagination & improve channel tag aggregation
SUMMARY
• Migrated Token, Task, Midjourney, Channel, Redemption tables to true server-side pagination.
• Added total / page / page_size metadata in API responses; switched all affected React tables to consume new structure.
• Implemented counting helpers:
– model/token.go CountUserTokens
– model/task.go TaskCountAllTasks / TaskCountAllUserTask
– model/midjourney.go CountAllTasks / CountAllUserTask
– model/channel.go CountAllChannels / CountAllTags
• Refactored controllers (token, task, midjourney, channel) for 1-based paging & aggregated returns.
• Redesigned `ChannelsTable.js`:
– `loadChannels`, `syncPageData`, `enrichChannels` for tag-mode grouping without recursion.
– Fixed runtime white-screen (maximum call-stack) by removing child duplication.
– Pagination, search, tag-mode, idSort all hot-reload correctly.
• Removed unused `log` import in controller/midjourney.go.
BREAKING CHANGES
Front-end consumers must now expect data.items / total / page / page_size from list endpoints (`/api/channel`, `/api/task`, `/api/mj`, `/api/token`, etc.).
2025-06-12 17:25:25 +08:00
|
|
|
|
const loadLogs = async (page = 1, size = pageSize) => {
|
|
|
|
|
|
setLoading(true);
|
2025-06-08 18:41:04 +08:00
|
|
|
|
const { channel_id, mj_id, start_timestamp, end_timestamp } = getFormValues();
|
2024-03-15 16:05:33 +08:00
|
|
|
|
let localStartTimestamp = Date.parse(start_timestamp);
|
|
|
|
|
|
let localEndTimestamp = Date.parse(end_timestamp);
|
🚀 feat(pagination): unify backend-driven pagination & improve channel tag aggregation
SUMMARY
• Migrated Token, Task, Midjourney, Channel, Redemption tables to true server-side pagination.
• Added total / page / page_size metadata in API responses; switched all affected React tables to consume new structure.
• Implemented counting helpers:
– model/token.go CountUserTokens
– model/task.go TaskCountAllTasks / TaskCountAllUserTask
– model/midjourney.go CountAllTasks / CountAllUserTask
– model/channel.go CountAllChannels / CountAllTags
• Refactored controllers (token, task, midjourney, channel) for 1-based paging & aggregated returns.
• Redesigned `ChannelsTable.js`:
– `loadChannels`, `syncPageData`, `enrichChannels` for tag-mode grouping without recursion.
– Fixed runtime white-screen (maximum call-stack) by removing child duplication.
– Pagination, search, tag-mode, idSort all hot-reload correctly.
• Removed unused `log` import in controller/midjourney.go.
BREAKING CHANGES
Front-end consumers must now expect data.items / total / page / page_size from list endpoints (`/api/channel`, `/api/task`, `/api/mj`, `/api/token`, etc.).
2025-06-12 17:25:25 +08:00
|
|
|
|
const url = isAdminUser
|
|
|
|
|
|
? `/api/mj/?p=${page}&page_size=${size}&channel_id=${channel_id}&mj_id=${mj_id}&start_timestamp=${localStartTimestamp}&end_timestamp=${localEndTimestamp}`
|
|
|
|
|
|
: `/api/mj/self/?p=${page}&page_size=${size}&mj_id=${mj_id}&start_timestamp=${localStartTimestamp}&end_timestamp=${localEndTimestamp}`;
|
2024-03-15 16:05:33 +08:00
|
|
|
|
const res = await API.get(url);
|
|
|
|
|
|
const { success, message, data } = res.data;
|
|
|
|
|
|
if (success) {
|
🚀 feat(pagination): unify backend-driven pagination & improve channel tag aggregation
SUMMARY
• Migrated Token, Task, Midjourney, Channel, Redemption tables to true server-side pagination.
• Added total / page / page_size metadata in API responses; switched all affected React tables to consume new structure.
• Implemented counting helpers:
– model/token.go CountUserTokens
– model/task.go TaskCountAllTasks / TaskCountAllUserTask
– model/midjourney.go CountAllTasks / CountAllUserTask
– model/channel.go CountAllChannels / CountAllTags
• Refactored controllers (token, task, midjourney, channel) for 1-based paging & aggregated returns.
• Redesigned `ChannelsTable.js`:
– `loadChannels`, `syncPageData`, `enrichChannels` for tag-mode grouping without recursion.
– Fixed runtime white-screen (maximum call-stack) by removing child duplication.
– Pagination, search, tag-mode, idSort all hot-reload correctly.
• Removed unused `log` import in controller/midjourney.go.
BREAKING CHANGES
Front-end consumers must now expect data.items / total / page / page_size from list endpoints (`/api/channel`, `/api/task`, `/api/mj`, `/api/token`, etc.).
2025-06-12 17:25:25 +08:00
|
|
|
|
syncPageData(data);
|
2024-03-15 16:05:33 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
showError(message);
|
|
|
|
|
|
}
|
|
|
|
|
|
setLoading(false);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
🚀 feat(pagination): unify backend-driven pagination & improve channel tag aggregation
SUMMARY
• Migrated Token, Task, Midjourney, Channel, Redemption tables to true server-side pagination.
• Added total / page / page_size metadata in API responses; switched all affected React tables to consume new structure.
• Implemented counting helpers:
– model/token.go CountUserTokens
– model/task.go TaskCountAllTasks / TaskCountAllUserTask
– model/midjourney.go CountAllTasks / CountAllUserTask
– model/channel.go CountAllChannels / CountAllTags
• Refactored controllers (token, task, midjourney, channel) for 1-based paging & aggregated returns.
• Redesigned `ChannelsTable.js`:
– `loadChannels`, `syncPageData`, `enrichChannels` for tag-mode grouping without recursion.
– Fixed runtime white-screen (maximum call-stack) by removing child duplication.
– Pagination, search, tag-mode, idSort all hot-reload correctly.
• Removed unused `log` import in controller/midjourney.go.
BREAKING CHANGES
Front-end consumers must now expect data.items / total / page / page_size from list endpoints (`/api/channel`, `/api/task`, `/api/mj`, `/api/token`, etc.).
2025-06-12 17:25:25 +08:00
|
|
|
|
const pageData = logs;
|
2023-11-23 18:18:03 +08:00
|
|
|
|
|
2024-03-23 21:24:39 +08:00
|
|
|
|
const handlePageChange = (page) => {
|
🚀 feat(pagination): unify backend-driven pagination & improve channel tag aggregation
SUMMARY
• Migrated Token, Task, Midjourney, Channel, Redemption tables to true server-side pagination.
• Added total / page / page_size metadata in API responses; switched all affected React tables to consume new structure.
• Implemented counting helpers:
– model/token.go CountUserTokens
– model/task.go TaskCountAllTasks / TaskCountAllUserTask
– model/midjourney.go CountAllTasks / CountAllUserTask
– model/channel.go CountAllChannels / CountAllTags
• Refactored controllers (token, task, midjourney, channel) for 1-based paging & aggregated returns.
• Redesigned `ChannelsTable.js`:
– `loadChannels`, `syncPageData`, `enrichChannels` for tag-mode grouping without recursion.
– Fixed runtime white-screen (maximum call-stack) by removing child duplication.
– Pagination, search, tag-mode, idSort all hot-reload correctly.
• Removed unused `log` import in controller/midjourney.go.
BREAKING CHANGES
Front-end consumers must now expect data.items / total / page / page_size from list endpoints (`/api/channel`, `/api/task`, `/api/mj`, `/api/token`, etc.).
2025-06-12 17:25:25 +08:00
|
|
|
|
loadLogs(page, pageSize).then();
|
2024-03-15 16:05:33 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2025-05-23 13:30:40 +08:00
|
|
|
|
const handlePageSizeChange = async (size) => {
|
|
|
|
|
|
localStorage.setItem('mj-page-size', size + '');
|
🚀 feat(pagination): unify backend-driven pagination & improve channel tag aggregation
SUMMARY
• Migrated Token, Task, Midjourney, Channel, Redemption tables to true server-side pagination.
• Added total / page / page_size metadata in API responses; switched all affected React tables to consume new structure.
• Implemented counting helpers:
– model/token.go CountUserTokens
– model/task.go TaskCountAllTasks / TaskCountAllUserTask
– model/midjourney.go CountAllTasks / CountAllUserTask
– model/channel.go CountAllChannels / CountAllTags
• Refactored controllers (token, task, midjourney, channel) for 1-based paging & aggregated returns.
• Redesigned `ChannelsTable.js`:
– `loadChannels`, `syncPageData`, `enrichChannels` for tag-mode grouping without recursion.
– Fixed runtime white-screen (maximum call-stack) by removing child duplication.
– Pagination, search, tag-mode, idSort all hot-reload correctly.
• Removed unused `log` import in controller/midjourney.go.
BREAKING CHANGES
Front-end consumers must now expect data.items / total / page / page_size from list endpoints (`/api/channel`, `/api/task`, `/api/mj`, `/api/token`, etc.).
2025-06-12 17:25:25 +08:00
|
|
|
|
await loadLogs(1, size);
|
2025-05-23 13:30:40 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2024-03-15 16:05:33 +08:00
|
|
|
|
const refresh = async () => {
|
🚀 feat(pagination): unify backend-driven pagination & improve channel tag aggregation
SUMMARY
• Migrated Token, Task, Midjourney, Channel, Redemption tables to true server-side pagination.
• Added total / page / page_size metadata in API responses; switched all affected React tables to consume new structure.
• Implemented counting helpers:
– model/token.go CountUserTokens
– model/task.go TaskCountAllTasks / TaskCountAllUserTask
– model/midjourney.go CountAllTasks / CountAllUserTask
– model/channel.go CountAllChannels / CountAllTags
• Refactored controllers (token, task, midjourney, channel) for 1-based paging & aggregated returns.
• Redesigned `ChannelsTable.js`:
– `loadChannels`, `syncPageData`, `enrichChannels` for tag-mode grouping without recursion.
– Fixed runtime white-screen (maximum call-stack) by removing child duplication.
– Pagination, search, tag-mode, idSort all hot-reload correctly.
• Removed unused `log` import in controller/midjourney.go.
BREAKING CHANGES
Front-end consumers must now expect data.items / total / page / page_size from list endpoints (`/api/channel`, `/api/task`, `/api/mj`, `/api/token`, etc.).
2025-06-12 17:25:25 +08:00
|
|
|
|
await loadLogs(1, pageSize);
|
2024-03-15 16:05:33 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const copyText = async (text) => {
|
|
|
|
|
|
if (await copy(text)) {
|
2025-05-23 13:30:40 +08:00
|
|
|
|
showSuccess(t('已复制:') + text);
|
2024-03-15 16:05:33 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
// setSearchKeyword(text);
|
2025-05-23 13:30:40 +08:00
|
|
|
|
Modal.error({ title: t('无法复制到剪贴板,请手动复制'), content: text });
|
2024-03-15 16:05:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
2025-05-23 13:30:40 +08:00
|
|
|
|
const localPageSize = parseInt(localStorage.getItem('mj-page-size')) || ITEMS_PER_PAGE;
|
|
|
|
|
|
setPageSize(localPageSize);
|
🚀 feat(pagination): unify backend-driven pagination & improve channel tag aggregation
SUMMARY
• Migrated Token, Task, Midjourney, Channel, Redemption tables to true server-side pagination.
• Added total / page / page_size metadata in API responses; switched all affected React tables to consume new structure.
• Implemented counting helpers:
– model/token.go CountUserTokens
– model/task.go TaskCountAllTasks / TaskCountAllUserTask
– model/midjourney.go CountAllTasks / CountAllUserTask
– model/channel.go CountAllChannels / CountAllTags
• Refactored controllers (token, task, midjourney, channel) for 1-based paging & aggregated returns.
• Redesigned `ChannelsTable.js`:
– `loadChannels`, `syncPageData`, `enrichChannels` for tag-mode grouping without recursion.
– Fixed runtime white-screen (maximum call-stack) by removing child duplication.
– Pagination, search, tag-mode, idSort all hot-reload correctly.
• Removed unused `log` import in controller/midjourney.go.
BREAKING CHANGES
Front-end consumers must now expect data.items / total / page / page_size from list endpoints (`/api/channel`, `/api/task`, `/api/mj`, `/api/token`, etc.).
2025-06-12 17:25:25 +08:00
|
|
|
|
loadLogs(1, localPageSize).then();
|
2025-06-08 18:41:04 +08:00
|
|
|
|
}, []);
|
2024-03-15 16:05:33 +08:00
|
|
|
|
|
2024-03-15 22:15:16 +08:00
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
const mjNotifyEnabled = localStorage.getItem('mj_notify_enabled');
|
|
|
|
|
|
if (mjNotifyEnabled !== 'true') {
|
|
|
|
|
|
setShowBanner(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
}, []);
|
2024-03-15 16:05:33 +08:00
|
|
|
|
|
2025-05-23 13:30:40 +08:00
|
|
|
|
// 列选择器模态框
|
|
|
|
|
|
const renderColumnSelector = () => {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<Modal
|
|
|
|
|
|
title={t('列设置')}
|
|
|
|
|
|
visible={showColumnSelector}
|
|
|
|
|
|
onCancel={() => setShowColumnSelector(false)}
|
|
|
|
|
|
footer={
|
|
|
|
|
|
<div className="flex justify-end">
|
|
|
|
|
|
<Button
|
|
|
|
|
|
theme="light"
|
|
|
|
|
|
onClick={() => initDefaultColumns()}
|
|
|
|
|
|
className="!rounded-full"
|
|
|
|
|
|
>
|
|
|
|
|
|
{t('重置')}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
theme="light"
|
|
|
|
|
|
onClick={() => setShowColumnSelector(false)}
|
|
|
|
|
|
className="!rounded-full"
|
|
|
|
|
|
>
|
|
|
|
|
|
{t('取消')}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
type='primary'
|
|
|
|
|
|
onClick={() => setShowColumnSelector(false)}
|
|
|
|
|
|
className="!rounded-full"
|
|
|
|
|
|
>
|
|
|
|
|
|
{t('确定')}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
}
|
|
|
|
|
|
>
|
|
|
|
|
|
<div style={{ marginBottom: 20 }}>
|
|
|
|
|
|
<Checkbox
|
|
|
|
|
|
checked={Object.values(visibleColumns).every((v) => v === true)}
|
|
|
|
|
|
indeterminate={
|
|
|
|
|
|
Object.values(visibleColumns).some((v) => v === true) &&
|
|
|
|
|
|
!Object.values(visibleColumns).every((v) => v === true)
|
|
|
|
|
|
}
|
|
|
|
|
|
onChange={(e) => handleSelectAll(e.target.checked)}
|
|
|
|
|
|
>
|
|
|
|
|
|
{t('全选')}
|
|
|
|
|
|
</Checkbox>
|
|
|
|
|
|
</div>
|
2025-05-25 01:46:45 +08:00
|
|
|
|
<div className="flex flex-wrap max-h-96 overflow-y-auto rounded-lg p-4" style={{ border: '1px solid var(--semi-color-border)' }}>
|
2025-05-23 13:30:40 +08:00
|
|
|
|
{allColumns.map((column) => {
|
|
|
|
|
|
// 为非管理员用户跳过管理员专用列
|
|
|
|
|
|
if (
|
|
|
|
|
|
!isAdminUser &&
|
|
|
|
|
|
(column.key === COLUMN_KEYS.CHANNEL ||
|
|
|
|
|
|
column.key === COLUMN_KEYS.SUBMIT_RESULT)
|
|
|
|
|
|
) {
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div key={column.key} className="w-1/2 mb-4 pr-2">
|
|
|
|
|
|
<Checkbox
|
|
|
|
|
|
checked={!!visibleColumns[column.key]}
|
|
|
|
|
|
onChange={(e) =>
|
|
|
|
|
|
handleColumnVisibilityChange(column.key, e.target.checked)
|
|
|
|
|
|
}
|
|
|
|
|
|
>
|
|
|
|
|
|
{column.title}
|
|
|
|
|
|
</Checkbox>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
})}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2024-03-15 16:05:33 +08:00
|
|
|
|
return (
|
|
|
|
|
|
<>
|
2025-05-23 13:30:40 +08:00
|
|
|
|
{renderColumnSelector()}
|
2024-03-15 16:05:33 +08:00
|
|
|
|
<Layout>
|
2025-05-23 13:30:40 +08:00
|
|
|
|
<Card
|
2025-06-07 02:45:07 +08:00
|
|
|
|
className="!rounded-2xl mb-4"
|
2025-05-23 13:30:40 +08:00
|
|
|
|
title={
|
|
|
|
|
|
<div className="flex flex-col w-full">
|
|
|
|
|
|
<div className="flex flex-col md:flex-row justify-between items-center">
|
|
|
|
|
|
<div className="flex items-center text-orange-500 mb-2 md:mb-0">
|
|
|
|
|
|
<IconEyeOpened className="mr-2" />
|
|
|
|
|
|
{loading ? (
|
|
|
|
|
|
<Skeleton.Title
|
|
|
|
|
|
style={{
|
|
|
|
|
|
width: 300,
|
|
|
|
|
|
marginBottom: 0,
|
|
|
|
|
|
marginTop: 0
|
|
|
|
|
|
}}
|
|
|
|
|
|
/>
|
|
|
|
|
|
) : (
|
|
|
|
|
|
<Text>
|
|
|
|
|
|
{isAdminUser && showBanner
|
|
|
|
|
|
? t('当前未开启Midjourney回调,部分项目可能无法获得绘图结果,可在运营设置中开启。')
|
|
|
|
|
|
: t('Midjourney 任务记录')}
|
|
|
|
|
|
</Text>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<Divider margin="12px" />
|
|
|
|
|
|
|
|
|
|
|
|
{/* 搜索表单区域 */}
|
2025-06-08 18:41:04 +08:00
|
|
|
|
<Form
|
|
|
|
|
|
initValues={formInitValues}
|
|
|
|
|
|
getFormApi={(api) => setFormApi(api)}
|
|
|
|
|
|
onSubmit={refresh}
|
|
|
|
|
|
allowEmpty={true}
|
|
|
|
|
|
autoComplete="off"
|
|
|
|
|
|
layout="vertical"
|
|
|
|
|
|
trigger="change"
|
|
|
|
|
|
stopValidateWithError={false}
|
|
|
|
|
|
>
|
|
|
|
|
|
<div className="flex flex-col gap-4">
|
|
|
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
|
|
|
|
{/* 时间选择器 */}
|
|
|
|
|
|
<div className="col-span-1 lg:col-span-2">
|
|
|
|
|
|
<Form.DatePicker
|
|
|
|
|
|
field='dateRange'
|
|
|
|
|
|
className="w-full"
|
|
|
|
|
|
type='dateTimeRange'
|
|
|
|
|
|
placeholder={[t('开始时间'), t('结束时间')]}
|
|
|
|
|
|
showClear
|
|
|
|
|
|
pure
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/* 任务 ID */}
|
|
|
|
|
|
<Form.Input
|
|
|
|
|
|
field='mj_id'
|
2025-05-23 13:30:40 +08:00
|
|
|
|
prefix={<IconSearch />}
|
2025-06-08 18:41:04 +08:00
|
|
|
|
placeholder={t('任务 ID')}
|
2025-05-23 13:30:40 +08:00
|
|
|
|
className="!rounded-full"
|
|
|
|
|
|
showClear
|
2025-06-08 18:41:04 +08:00
|
|
|
|
pure
|
2025-05-23 13:30:40 +08:00
|
|
|
|
/>
|
|
|
|
|
|
|
2025-06-08 18:41:04 +08:00
|
|
|
|
{/* 渠道 ID - 仅管理员可见 */}
|
|
|
|
|
|
{isAdminUser && (
|
|
|
|
|
|
<Form.Input
|
|
|
|
|
|
field='channel_id'
|
|
|
|
|
|
prefix={<IconSearch />}
|
|
|
|
|
|
placeholder={t('渠道 ID')}
|
|
|
|
|
|
className="!rounded-full"
|
|
|
|
|
|
showClear
|
|
|
|
|
|
pure
|
|
|
|
|
|
/>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/* 操作按钮区域 */}
|
2025-06-09 18:22:18 +08:00
|
|
|
|
<div className="flex justify-between items-center">
|
2025-06-08 18:41:04 +08:00
|
|
|
|
<div></div>
|
|
|
|
|
|
<div className="flex gap-2">
|
|
|
|
|
|
<Button
|
|
|
|
|
|
type='primary'
|
|
|
|
|
|
htmlType='submit'
|
|
|
|
|
|
loading={loading}
|
|
|
|
|
|
className="!rounded-full"
|
|
|
|
|
|
>
|
|
|
|
|
|
{t('查询')}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
theme='light'
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
if (formApi) {
|
|
|
|
|
|
formApi.reset();
|
|
|
|
|
|
// 重置后立即查询,使用setTimeout确保表单重置完成
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
refresh();
|
|
|
|
|
|
}, 100);
|
|
|
|
|
|
}
|
|
|
|
|
|
}}
|
|
|
|
|
|
className="!rounded-full"
|
|
|
|
|
|
>
|
|
|
|
|
|
{t('重置')}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button
|
|
|
|
|
|
theme='light'
|
|
|
|
|
|
type='tertiary'
|
|
|
|
|
|
icon={<IconSetting />}
|
|
|
|
|
|
onClick={() => setShowColumnSelector(true)}
|
|
|
|
|
|
className="!rounded-full"
|
|
|
|
|
|
>
|
|
|
|
|
|
{t('列设置')}
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</div>
|
2025-05-23 13:30:40 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-06-08 18:41:04 +08:00
|
|
|
|
</Form>
|
2025-05-23 13:30:40 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
}
|
2025-06-07 00:53:29 +08:00
|
|
|
|
shadows='always'
|
|
|
|
|
|
bordered={false}
|
2025-05-23 13:30:40 +08:00
|
|
|
|
>
|
2025-06-07 02:51:38 +08:00
|
|
|
|
<Table
|
|
|
|
|
|
columns={getVisibleColumns()}
|
🚀 feat(pagination): unify backend-driven pagination & improve channel tag aggregation
SUMMARY
• Migrated Token, Task, Midjourney, Channel, Redemption tables to true server-side pagination.
• Added total / page / page_size metadata in API responses; switched all affected React tables to consume new structure.
• Implemented counting helpers:
– model/token.go CountUserTokens
– model/task.go TaskCountAllTasks / TaskCountAllUserTask
– model/midjourney.go CountAllTasks / CountAllUserTask
– model/channel.go CountAllChannels / CountAllTags
• Refactored controllers (token, task, midjourney, channel) for 1-based paging & aggregated returns.
• Redesigned `ChannelsTable.js`:
– `loadChannels`, `syncPageData`, `enrichChannels` for tag-mode grouping without recursion.
– Fixed runtime white-screen (maximum call-stack) by removing child duplication.
– Pagination, search, tag-mode, idSort all hot-reload correctly.
• Removed unused `log` import in controller/midjourney.go.
BREAKING CHANGES
Front-end consumers must now expect data.items / total / page / page_size from list endpoints (`/api/channel`, `/api/task`, `/api/mj`, `/api/token`, etc.).
2025-06-12 17:25:25 +08:00
|
|
|
|
dataSource={logs}
|
2025-06-07 02:51:38 +08:00
|
|
|
|
rowKey='key'
|
|
|
|
|
|
loading={loading}
|
|
|
|
|
|
scroll={{ x: 'max-content' }}
|
|
|
|
|
|
className="rounded-xl overflow-hidden"
|
|
|
|
|
|
size="middle"
|
2025-06-08 23:42:39 +08:00
|
|
|
|
empty={
|
|
|
|
|
|
<Empty
|
|
|
|
|
|
image={<IllustrationNoResult style={{ width: 150, height: 150 }} />}
|
|
|
|
|
|
darkModeImage={<IllustrationNoResultDark style={{ width: 150, height: 150 }} />}
|
|
|
|
|
|
description={t('搜索无结果')}
|
|
|
|
|
|
style={{ padding: 30 }}
|
|
|
|
|
|
/>
|
|
|
|
|
|
}
|
2025-06-07 02:51:38 +08:00
|
|
|
|
pagination={{
|
|
|
|
|
|
formatPageText: (page) =>
|
|
|
|
|
|
t('第 {{start}} - {{end}} 条,共 {{total}} 条', {
|
|
|
|
|
|
start: page.currentStart,
|
|
|
|
|
|
end: page.currentEnd,
|
|
|
|
|
|
total: logCount,
|
|
|
|
|
|
}),
|
|
|
|
|
|
currentPage: activePage,
|
|
|
|
|
|
pageSize: pageSize,
|
|
|
|
|
|
total: logCount,
|
|
|
|
|
|
pageSizeOptions: [10, 20, 50, 100],
|
|
|
|
|
|
showSizeChanger: true,
|
🚀 feat(pagination): unify backend-driven pagination & improve channel tag aggregation
SUMMARY
• Migrated Token, Task, Midjourney, Channel, Redemption tables to true server-side pagination.
• Added total / page / page_size metadata in API responses; switched all affected React tables to consume new structure.
• Implemented counting helpers:
– model/token.go CountUserTokens
– model/task.go TaskCountAllTasks / TaskCountAllUserTask
– model/midjourney.go CountAllTasks / CountAllUserTask
– model/channel.go CountAllChannels / CountAllTags
• Refactored controllers (token, task, midjourney, channel) for 1-based paging & aggregated returns.
• Redesigned `ChannelsTable.js`:
– `loadChannels`, `syncPageData`, `enrichChannels` for tag-mode grouping without recursion.
– Fixed runtime white-screen (maximum call-stack) by removing child duplication.
– Pagination, search, tag-mode, idSort all hot-reload correctly.
• Removed unused `log` import in controller/midjourney.go.
BREAKING CHANGES
Front-end consumers must now expect data.items / total / page / page_size from list endpoints (`/api/channel`, `/api/task`, `/api/mj`, `/api/token`, etc.).
2025-06-12 17:25:25 +08:00
|
|
|
|
onPageSizeChange: handlePageSizeChange,
|
2025-06-07 02:51:38 +08:00
|
|
|
|
onPageChange: handlePageChange,
|
|
|
|
|
|
}}
|
|
|
|
|
|
/>
|
2025-05-23 13:30:40 +08:00
|
|
|
|
</Card>
|
|
|
|
|
|
|
2024-03-15 16:05:33 +08:00
|
|
|
|
<Modal
|
|
|
|
|
|
visible={isModalOpen}
|
|
|
|
|
|
onOk={() => setIsModalOpen(false)}
|
|
|
|
|
|
onCancel={() => setIsModalOpen(false)}
|
|
|
|
|
|
closable={null}
|
|
|
|
|
|
bodyStyle={{ height: '400px', overflow: 'auto' }} // 设置模态框内容区域样式
|
|
|
|
|
|
width={800} // 设置模态框宽度
|
|
|
|
|
|
>
|
|
|
|
|
|
<p style={{ whiteSpace: 'pre-line' }}>{modalContent}</p>
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
<ImagePreview
|
|
|
|
|
|
src={modalImageUrl}
|
|
|
|
|
|
visible={isModalOpenurl}
|
|
|
|
|
|
onVisibleChange={(visible) => setIsModalOpenurl(visible)}
|
|
|
|
|
|
/>
|
|
|
|
|
|
</Layout>
|
|
|
|
|
|
</>
|
|
|
|
|
|
);
|
2023-08-14 22:16:32 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default LogsTable;
|