No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

97 líneas
3.3 KiB

  1. // material-ui
  2. import {
  3. Grid,
  4. Typography,
  5. Stack,
  6. // Button
  7. } from '@mui/material';
  8. import MainCard from "components/MainCard";
  9. import { useEffect, useState } from "react";
  10. import * as DateUtils from "utils/DateUtils";
  11. import * as React from "react";
  12. import Loadable from 'components/Loadable';
  13. import { lazy } from 'react';
  14. const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent')));
  15. const SearchForm = Loadable(lazy(() => import('./AuditLogSearchForm')));
  16. const EventTable = Loadable(lazy(() => import('./AuditLogTable')));
  17. import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'
  18. const BackgroundHead = {
  19. backgroundImage: `url(${titleBackgroundImg})`,
  20. width: '100%',
  21. height: '100%',
  22. backgroundSize: 'contain',
  23. backgroundRepeat: 'no-repeat',
  24. backgroundColor: '#0C489E',
  25. backgroundPosition: 'right'
  26. }
  27. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  28. const AuditLogPage = () => {
  29. const [searchCriteria, setSearchCriteria] = useState({
  30. modifiedTo: DateUtils.dateValue(new Date()),
  31. modifiedFrom: DateUtils.dateValue(new Date().setDate(new Date().getDate()-14)),
  32. });
  33. const [onReady, setOnReady] = useState(false);
  34. const [onGridReady, setGridOnReady] = React.useState(false);
  35. useEffect(() => {
  36. setOnReady(true);
  37. }, [searchCriteria]);
  38. function applySearch(input) {
  39. setGridOnReady(true)
  40. setSearchCriteria(input);
  41. }
  42. function applyGridOnReady(input) {
  43. setGridOnReady(input);
  44. }
  45. return (
  46. !onReady ?
  47. <Grid container sx={{ minHeight: '87vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center">
  48. <Grid item>
  49. <LoadingComponent />
  50. </Grid>
  51. </Grid>
  52. :
  53. <Grid container sx={{ minHeight: '87vh', backgroundColor: "backgroundColor.default" }} direction="column">
  54. <Grid item xs={12}>
  55. <div style={BackgroundHead}>
  56. <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
  57. <Typography ml={15} color='#FFF' variant="h4" sx={{ "textShadow": "0px 0px 25px #0C489E" }}>Audit Log</Typography>
  58. </Stack>
  59. </div>
  60. </Grid>
  61. {/*row 1*/}
  62. <Grid item xs={12} md={12} lg={12} sx={{mb:-1}}>
  63. <SearchForm
  64. applySearch={applySearch}
  65. searchCriteria={searchCriteria}
  66. onGridReady={onGridReady}
  67. />
  68. </Grid>
  69. {/*row 2*/}
  70. <Grid item xs={12} md={12} lg={12}>
  71. <MainCard elevation={0}
  72. border={false}
  73. content={false}
  74. >
  75. <EventTable
  76. searchCriteria={searchCriteria}
  77. applyGridOnReady={applyGridOnReady}
  78. applySearch={applySearch}
  79. />
  80. </MainCard>
  81. </Grid>
  82. </Grid>
  83. );
  84. };
  85. export default AuditLogPage;