Initial import of weiyuan frontend

This commit is contained in:
qiubaishen
2026-10-15 16:33:46 +08:00
commit d8f3aee261
774 changed files with 374914 additions and 0 deletions
+115
View File
@@ -0,0 +1,115 @@
/*
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 React from 'react';
import CardPro from '../../common/ui/CardPro';
import TaskLogsTable from './TaskLogsTable';
import TaskLogsActions from './TaskLogsActions';
import TaskLogsFilters from './TaskLogsFilters';
import ColumnSelectorModal from './modals/ColumnSelectorModal';
import ContentModal from './modals/ContentModal';
import { useTaskLogsData } from '../../../hooks/task-logs/useTaskLogsData';
import { useIsMobile } from '../../../hooks/common/useIsMobile';
import { createCardProPagination } from '../../../helpers/utils';
const TaskLogsPage = ({ usageRecordMode = false }) => {
const taskLogsData = useTaskLogsData();
const isMobile = useIsMobile();
return (
<div className='relative'>
{/* 装饰性网格背景 */}
<div
className='absolute inset-0 opacity-[0.015] dark:opacity-[0.03] pointer-events-none'
style={{
backgroundImage: `
linear-gradient(rgba(6, 182, 212, 0.5) 1px, transparent 1px),
linear-gradient(90deg, rgba(6, 182, 212, 0.5) 1px, transparent 1px)
`,
backgroundSize: '24px 24px',
}}
/>
{/* Modals */}
<ColumnSelectorModal
{...taskLogsData}
usageRecordMode={usageRecordMode}
/>
<ContentModal
{...taskLogsData}
isVideo={false}
usageRecordMode={usageRecordMode}
/>
{/* 视频预览弹窗 */}
<ContentModal
isModalOpen={taskLogsData.isVideoModalOpen}
setIsModalOpen={taskLogsData.setIsVideoModalOpen}
modalContent={taskLogsData.videoUrl}
sourceUrl={taskLogsData.videoSourceUrl}
isVideo={true}
usageRecordMode={usageRecordMode}
/>
{/* Main Content */}
<CardPro
type='type2'
className='!bg-transparent !border-0 !shadow-none relative'
statsArea={
<TaskLogsActions
{...taskLogsData}
logs={taskLogsData.logs}
usageRecordMode={usageRecordMode}
/>
}
searchArea={
<TaskLogsFilters
{...taskLogsData}
usageRecordMode={usageRecordMode}
/>
}
paginationArea={createCardProPagination({
currentPage: taskLogsData.activePage,
pageSize: taskLogsData.pageSize,
total: taskLogsData.logCount,
onPageChange: taskLogsData.handlePageChange,
onPageSizeChange: taskLogsData.handlePageSizeChange,
isMobile: isMobile,
t: taskLogsData.t,
})}
t={taskLogsData.t}
>
{/* 表格容器 */}
<div className='relative mt-4'>
{/* 表格装饰光晕 —— 走冷色 cyan→blue→品牌,与任务日志图标族一致 */}
<div className='absolute -inset-0.5 bg-gradient-to-r from-cyan-500/20 via-blue-500/20 to-brand-to/20 rounded-2xl opacity-50 blur-sm' />
{/* 表格内容 —— 统一 .app-card 玻璃卡(去掉散乱的 bg-white/80 + border + rounded) */}
<div className='relative app-card overflow-hidden'>
<TaskLogsTable
{...taskLogsData}
compactMode={usageRecordMode ? false : taskLogsData.compactMode}
/>
</div>
</div>
</CardPro>
</div>
);
};
export default TaskLogsPage;