diff --git a/MythicReactUI/src/components/App.js b/MythicReactUI/src/components/App.js index 8933db4c..f7e34c24 100644 --- a/MythicReactUI/src/components/App.js +++ b/MythicReactUI/src/components/App.js @@ -447,6 +447,13 @@ const getModernThemeAdditions = (themeMode, preferences = operatorSettingDefault fontSize: "0.86rem", "--DataGrid-rowBorderColor": tableBorderSoft, "--DataGrid-containerBackground": tableHeaderColor, + overflow: "hidden", + "& .MuiDataGrid-main": { + backgroundColor: backgroundPaper, + }, + "& .MuiDataGrid-virtualScroller": { + backgroundColor: backgroundPaper, + }, "& .MuiDataGrid-columnHeaders": { backgroundColor: tableHeaderColor, borderBottom: `1px solid ${borderColor}`, @@ -463,10 +470,16 @@ const getModernThemeAdditions = (themeMode, preferences = operatorSettingDefault letterSpacing: 0, textTransform: "uppercase", }, + "& .MuiDataGrid-columnSeparator": { + color: tableBorderSoft, + }, "& .MuiDataGrid-cell": { borderBottom: `1px solid ${tableBorderSoft}`, outline: "none", }, + "& .MuiDataGrid-cell:focus, & .MuiDataGrid-cell:focus-within, & .MuiDataGrid-columnHeader:focus, & .MuiDataGrid-columnHeader:focus-within": { + outline: "none", + }, "& .MuiDataGrid-row:nth-of-type(even)": { backgroundColor: tableRowStripeColor, }, @@ -482,11 +495,29 @@ const getModernThemeAdditions = (themeMode, preferences = operatorSettingDefault "& .MuiDataGrid-footerContainer": { borderTop: `1px solid ${borderColor}`, minHeight: 34, + color: textSecondary, }, "& .MuiDataGrid-toolbarContainer": { borderBottom: `1px solid ${tableBorderSoft}`, minHeight: 34, }, + "& .MuiDataGrid-overlay": { + backgroundColor: backgroundPaper, + color: textSecondary, + }, + "& .MuiTablePagination-root, & .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows": { + color: textSecondary, + fontSize: "0.78rem", + }, + "& .MuiSvgIcon-root, & .MuiIconButton-root": { + color: textSecondary, + }, + "& .MuiCheckbox-root": { + color: textSecondary, + "&.Mui-checked, &.MuiCheckbox-indeterminate": { + color: primary, + }, + }, }, }, }, diff --git a/MythicReactUI/src/components/MythicComponents/MythicDataGrid.js b/MythicReactUI/src/components/MythicComponents/MythicDataGrid.js new file mode 100644 index 00000000..e8f2638f --- /dev/null +++ b/MythicReactUI/src/components/MythicComponents/MythicDataGrid.js @@ -0,0 +1,33 @@ +import React from 'react'; +import Box from '@mui/material/Box'; +import { DataGrid } from '@mui/x-data-grid'; + +export const MythicDataGrid = ({containerSx = {}, sx = {}, density = "compact", autoPageSize = true, pageSizeOptions = [10, 25, 50, 100], ...props}) => { + return ( + + + + ); +} diff --git a/MythicReactUI/src/components/pages/Callbacks/CallbacksTabsHideMultipleDialog.js b/MythicReactUI/src/components/pages/Callbacks/CallbacksTabsHideMultipleDialog.js index ac3f0fa7..6680bf90 100644 --- a/MythicReactUI/src/components/pages/Callbacks/CallbacksTabsHideMultipleDialog.js +++ b/MythicReactUI/src/components/pages/Callbacks/CallbacksTabsHideMultipleDialog.js @@ -7,7 +7,7 @@ import {useMutation} from '@apollo/client'; import {hideCallbacksMutation} from './CallbackMutations'; import {snackActions} from "../../utilities/Snackbar"; import {CallbacksTableLastCheckinCell, CallbacksTablePayloadTypeCell, CallbacksTableIPCell} from "./CallbacksTableRow"; -import { DataGrid } from '@mui/x-data-grid'; +import {MythicDataGrid} from "../../MythicComponents/MythicDataGrid"; import DialogContentText from '@mui/material/DialogContentText'; @@ -111,8 +111,8 @@ const CustomSelectTable = ({initialData, selectedData, sortModel}) => { })); }, [initialData]); return ( -
- + { setRowSelectionModel(newRowSelectionModel); }} rowSelectionModel={rowSelectionModel} - density={"compact"} />
@@ -239,4 +238,3 @@ export function CallbacksTabsSelectMultipleDialog({onClose, onSubmit}) { ); } - diff --git a/MythicReactUI/src/components/pages/Callbacks/CallbacksTabsOpenMultipleDialog.js b/MythicReactUI/src/components/pages/Callbacks/CallbacksTabsOpenMultipleDialog.js index 1a31c012..46a7eb6d 100644 --- a/MythicReactUI/src/components/pages/Callbacks/CallbacksTabsOpenMultipleDialog.js +++ b/MythicReactUI/src/components/pages/Callbacks/CallbacksTabsOpenMultipleDialog.js @@ -4,7 +4,7 @@ import DialogActions from '@mui/material/DialogActions'; import DialogTitle from '@mui/material/DialogTitle'; import {useQuery, gql } from '@apollo/client'; import {CallbacksTableLastCheckinCell, CallbacksTablePayloadTypeCell, CallbacksTableIPCell} from "./CallbacksTableRow"; -import { DataGrid } from '@mui/x-data-grid'; +import {MythicDataGrid} from "../../MythicComponents/MythicDataGrid"; import DialogContentText from '@mui/material/DialogContentText'; @@ -98,8 +98,8 @@ const CustomSelectTable = ({initialData, selectedData, onRowClick}) => { })); }, [initialData]); return ( -
- + { }} autoPageSize onRowClick={onRowClick} - density={"compact"} />
@@ -156,4 +155,3 @@ export function CallbacksTabsOpenMultipleDialog({onClose, tabType, onOpenTabs}) ); } - diff --git a/MythicReactUI/src/components/pages/Callbacks/CallbacksTabsTaskMultipleDialog.js b/MythicReactUI/src/components/pages/Callbacks/CallbacksTabsTaskMultipleDialog.js index 81c17f82..d9848153 100644 --- a/MythicReactUI/src/components/pages/Callbacks/CallbacksTabsTaskMultipleDialog.js +++ b/MythicReactUI/src/components/pages/Callbacks/CallbacksTabsTaskMultipleDialog.js @@ -7,7 +7,7 @@ import {useQuery, gql } from '@apollo/client'; import {TaskFromUIButton} from './TaskFromUIButton'; import {CallbacksTabsTaskingInput} from "./CallbacksTabsTaskingInput"; import {CallbacksTableIPCell, CallbacksTableLastCheckinCell} from "./CallbacksTableRow"; -import { DataGrid } from '@mui/x-data-grid'; +import {MythicDataGrid} from "../../MythicComponents/MythicDataGrid"; import { validate as uuidValidate } from 'uuid'; import {snackActions} from "../../utilities/Snackbar"; import DialogContentText from '@mui/material/DialogContentText'; @@ -105,8 +105,8 @@ const CustomSelectTable = ({initialData, selectedData}) => { })); }, [initialData]); return ( -
- + { setRowSelectionModel(newRowSelectionModel); }} rowSelectionModel={rowSelectionModel} - density={"compact"} />
diff --git a/MythicReactUI/src/components/pages/Settings/SettingsOperatorTableRow.js b/MythicReactUI/src/components/pages/Settings/SettingsOperatorTableRow.js index f84905fe..5bee0901 100644 --- a/MythicReactUI/src/components/pages/Settings/SettingsOperatorTableRow.js +++ b/MythicReactUI/src/components/pages/Settings/SettingsOperatorTableRow.js @@ -32,8 +32,8 @@ import VisibilityIcon from '@mui/icons-material/Visibility'; import {gql, useMutation} from '@apollo/client'; import ContentCopyIcon from '@mui/icons-material/ContentCopy'; import {copyStringToClipboard} from "../../utilities/Clipboard"; -import { DataGrid } from '@mui/x-data-grid'; import {useMythicLazyQuery} from "../../utilities/useMythicLazyQuery"; +import {MythicDataGrid} from "../../MythicComponents/MythicDataGrid"; const createAPITokenMutation = gql` mutation createAPITokenMutation($operator_id: Int, $name: String, $scopes: [String!]){ @@ -551,8 +551,8 @@ const APITokens = ({apiTokens, onDeleteAPIToken, onToggleActive, showDeleted, me }, [])); }, [apiTokens, showDeleted]); return ( -
- +