Initial import of weiyuan frontend
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
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 LogsTable from './UsageLogsTable';
|
||||
import LogsFilters from './UsageLogsFilters';
|
||||
import ColumnSelectorModal from './modals/ColumnSelectorModal';
|
||||
import UserInfoModal from './modals/UserInfoModal';
|
||||
import UsageLogsExportModal from './modals/UsageLogsExportModal';
|
||||
import { useLogsData } from '../../../hooks/usage-logs/useUsageLogsData';
|
||||
import { useIsMobile } from '../../../hooks/common/useIsMobile';
|
||||
import { createCardProPagination } from '../../../helpers/utils';
|
||||
import './UsageLogs.css';
|
||||
|
||||
const LogsPage = ({ usageRecordMode = false }) => {
|
||||
const logsData = useLogsData();
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Modals */}
|
||||
<ColumnSelectorModal {...logsData} usageRecordMode={usageRecordMode} />
|
||||
<UserInfoModal {...logsData} />
|
||||
<UsageLogsExportModal {...logsData} usageRecordMode={usageRecordMode} />
|
||||
|
||||
{/* Main Content */}
|
||||
<CardPro
|
||||
type='type2'
|
||||
className='usage-logs-page usage-logs-panel !bg-white/[0.34] dark:!bg-neutral-950/[0.34] !border-white/50 dark:!border-white/10 !shadow-[0_24px_80px_rgba(15,23,42,0.08)] dark:!shadow-[0_24px_80px_rgba(0,0,0,0.32)] relative !backdrop-blur-2xl !backdrop-saturate-150'
|
||||
searchArea={
|
||||
<LogsFilters {...logsData} usageRecordMode={usageRecordMode} />
|
||||
}
|
||||
paginationArea={createCardProPagination({
|
||||
currentPage: logsData.activePage,
|
||||
pageSize: logsData.pageSize,
|
||||
total: logsData.logCount,
|
||||
onPageChange: logsData.handlePageChange,
|
||||
onPageSizeChange: logsData.handlePageSizeChange,
|
||||
isMobile: isMobile,
|
||||
t: logsData.t,
|
||||
})}
|
||||
t={logsData.t}
|
||||
>
|
||||
<div className='app-card usage-logs-table-shell usage-logs-glass-table mt-4 overflow-hidden'>
|
||||
<LogsTable
|
||||
{...logsData}
|
||||
compactMode={usageRecordMode ? false : logsData.compactMode}
|
||||
/>
|
||||
</div>
|
||||
</CardPro>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default LogsPage;
|
||||
Reference in New Issue
Block a user