index.jsx 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. Copyright (C) 2025 QuantumNous
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <https://www.gnu.org/licenses/>.
  13. For commercial licensing, please contact support@quantumnous.com
  14. */
  15. import React from 'react';
  16. import CardPro from '../../common/ui/CardPro';
  17. import LogsTable from './UsageLogsTable';
  18. import LogsActions from './UsageLogsActions';
  19. import LogsFilters from './UsageLogsFilters';
  20. import ColumnSelectorModal from './modals/ColumnSelectorModal';
  21. import UserInfoModal from './modals/UserInfoModal';
  22. import ChannelAffinityUsageCacheModal from './modals/ChannelAffinityUsageCacheModal';
  23. import ParamOverrideModal from './modals/ParamOverrideModal';
  24. import { useLogsData } from '../../../hooks/usage-logs/useUsageLogsData';
  25. import { useIsMobile } from '../../../hooks/common/useIsMobile';
  26. import { createCardProPagination } from '../../../helpers/utils';
  27. const LogsPage = () => {
  28. const logsData = useLogsData();
  29. const isMobile = useIsMobile();
  30. return (
  31. <>
  32. {/* Modals */}
  33. <ColumnSelectorModal {...logsData} />
  34. <UserInfoModal {...logsData} />
  35. <ChannelAffinityUsageCacheModal {...logsData} />
  36. <ParamOverrideModal {...logsData} />
  37. {/* Main Content */}
  38. <CardPro
  39. type='type2'
  40. statsArea={<LogsActions {...logsData} />}
  41. searchArea={<LogsFilters {...logsData} />}
  42. paginationArea={createCardProPagination({
  43. currentPage: logsData.activePage,
  44. pageSize: logsData.pageSize,
  45. total: logsData.logCount,
  46. onPageChange: logsData.handlePageChange,
  47. onPageSizeChange: logsData.handlePageSizeChange,
  48. isMobile: isMobile,
  49. t: logsData.t,
  50. })}
  51. t={logsData.t}
  52. >
  53. <LogsTable {...logsData} />
  54. </CardPro>
  55. </>
  56. );
  57. };
  58. export default LogsPage;