mirror of
https://github.com/its-a-feature/Mythic
synced 2026-06-08 14:55:38 +00:00
updating some of the modal rendering conditionals
This commit is contained in:
@@ -9,9 +9,9 @@ import Tooltip from '@mui/material/Tooltip';
|
||||
import SearchIcon from '@mui/icons-material/Search';
|
||||
import MythicTextField from './MythicTextField';
|
||||
|
||||
export const MythicTableToolbar = ({children, className = "", style = {}}) => {
|
||||
export const MythicTableToolbar = ({children, className = "", style = {}, variant}) => {
|
||||
return (
|
||||
<Box className={`mythic-table-toolbar ${className}`.trim()} style={style}>
|
||||
<Box className={`mythic-table-toolbar ${variant ? `mythic-table-toolbar-${variant}` : ""} ${className}`.trim()} style={style}>
|
||||
{children}
|
||||
</Box>
|
||||
);
|
||||
@@ -77,7 +77,7 @@ export const MythicSearchField = ({
|
||||
onClick={onSearch}
|
||||
size="small"
|
||||
>
|
||||
<SearchIcon color="info" fontSize="small" />
|
||||
<SearchIcon fontSize="small" />
|
||||
</IconButton>
|
||||
</span>
|
||||
</Tooltip>
|
||||
|
||||
@@ -93,8 +93,9 @@ function CallbackSearchTableRow(props){
|
||||
return (
|
||||
<React.Fragment>
|
||||
<TableRow hover style={{backgroundColor: props.color}}>
|
||||
<MythicConfirmDialog onClose={() => {setOpenDeleteDialog(false);}} onSubmit={onAcceptDelete} open={openDeleteDialog} acceptText={props.active ? "Hide" : "Restore" }/>
|
||||
|
||||
{openDeleteDialog &&
|
||||
<MythicConfirmDialog onClose={() => {setOpenDeleteDialog(false);}} onSubmit={onAcceptDelete} open={openDeleteDialog} acceptText={props.active ? "Hide" : "Restore" }/>
|
||||
}
|
||||
<MythicStyledTableCell>{!props.active ? (
|
||||
<MythicStyledTooltip title="Restore Callback for Tasking">
|
||||
<IconButton className="mythic-table-row-icon-action mythic-table-row-icon-action-danger" size="small" onClick={()=>{setOpenDeleteDialog(true);}}><VisibilityOffIcon fontSize="small" /></IconButton>
|
||||
|
||||
@@ -313,7 +313,9 @@ function CredentialTableRow(props){
|
||||
return (
|
||||
<React.Fragment>
|
||||
<TableRow hover>
|
||||
<MythicConfirmDialog onClose={() => {setOpenDeleteDialog(false);}} onSubmit={onAcceptDelete} open={openDeleteDialog} acceptText={props.deleted ? "Restore" : "Remove" }/>
|
||||
{openDeleteDialog &&
|
||||
<MythicConfirmDialog onClose={() => {setOpenDeleteDialog(false);}} onSubmit={onAcceptDelete} open={openDeleteDialog} acceptText={props.deleted ? "Restore" : "Remove" }/>
|
||||
}
|
||||
{editCommentDialogOpen &&
|
||||
<MythicDialog fullWidth={true} maxWidth="md" open={editCommentDialogOpen}
|
||||
onClose={()=>{setEditCommentDialogOpen(false);}}
|
||||
|
||||
@@ -230,7 +230,7 @@ const SearchTabCallbacksSearchPanel = (props) => {
|
||||
}
|
||||
}, [props.value, props.index])
|
||||
return (
|
||||
<MythicTableToolbar>
|
||||
<MythicTableToolbar variant="search">
|
||||
<MythicTableToolbarGroup grow>
|
||||
<MythicSearchField value={search} onChange={handleSearchValueChange} onEnter={submitSearch} onSearch={submitSearch} />
|
||||
</MythicTableToolbarGroup>
|
||||
|
||||
@@ -216,7 +216,7 @@ const SearchTabCredentialsSearchPanel = (props) => {
|
||||
}
|
||||
}, [props.value, props.index])
|
||||
return (
|
||||
<MythicTableToolbar>
|
||||
<MythicTableToolbar variant="search">
|
||||
<MythicTableToolbarGroup grow>
|
||||
<MythicSearchField value={search} onChange={handleSearchValueChange} onEnter={submitSearch} onSearch={submitSearch} />
|
||||
</MythicTableToolbarGroup>
|
||||
|
||||
@@ -552,7 +552,7 @@ const SearchTabFilesSearchPanel = (props) => {
|
||||
}
|
||||
}, [props.value, props.index]);
|
||||
return (
|
||||
<MythicTableToolbar>
|
||||
<MythicTableToolbar variant="search">
|
||||
<MythicTableToolbarGroup style={{minWidth: "13rem"}}>
|
||||
<MythicSearchField placeholder="Host Name Search..." name="Host" value={searchHost}
|
||||
onChange={handleSearchHostValueChange} onEnter={submitSearch}/>
|
||||
|
||||
@@ -138,11 +138,7 @@ const SearchTabPayloadsSearchPanel = (props) => {
|
||||
props.onChangeAutogeneratedField(!showAutogenerated);
|
||||
}
|
||||
const handleSearchValueChange = (name, value, error) => {
|
||||
switch(name){
|
||||
case "Search...":
|
||||
setSearch(value);
|
||||
break;
|
||||
}
|
||||
setSearch(value);
|
||||
}
|
||||
const handleSearchFieldChange = (event) => {
|
||||
setSearchField(event.target.value);
|
||||
@@ -235,7 +231,7 @@ const SearchTabPayloadsSearchPanel = (props) => {
|
||||
fetchOptions();
|
||||
}, []);
|
||||
return (
|
||||
<MythicTableToolbar>
|
||||
<MythicTableToolbar variant="search">
|
||||
<MythicTableToolbarGroup grow>
|
||||
<MythicSearchField value={search} onChange={handleSearchValueChange} onEnter={submitSearch} onSearch={submitSearch} />
|
||||
</MythicTableToolbarGroup>
|
||||
|
||||
@@ -256,7 +256,7 @@ const SearchTabTasksSearchPanel = (props) => {
|
||||
}
|
||||
}, [props.value, props.index]);
|
||||
return (
|
||||
<MythicTableToolbar>
|
||||
<MythicTableToolbar variant="search">
|
||||
<MythicTableToolbarGroup style={{minWidth: "12rem"}}>
|
||||
<MythicSearchField disabled={props.alreadySearching} placeholder="Host..." name="Host" value={host}
|
||||
onChange={handleHostValueChange} onEnter={submitSearch}/>
|
||||
|
||||
@@ -136,7 +136,9 @@ function TokenTableRow(props){
|
||||
return (
|
||||
<React.Fragment>
|
||||
<TableRow hover>
|
||||
<MythicConfirmDialog onClose={() => {setOpenDeleteDialog(false);}} onSubmit={onAcceptDelete} open={openDeleteDialog} acceptText={props.deleted ? "Restore" : "Hide" }/>
|
||||
{openDeleteDialog &&
|
||||
<MythicConfirmDialog onClose={() => {setOpenDeleteDialog(false);}} onSubmit={onAcceptDelete} open={openDeleteDialog} acceptText={props.deleted ? "Restore" : "Hide" }/>
|
||||
}
|
||||
|
||||
<MythicStyledTableCell>{props.deleted ? (
|
||||
<MythicStyledTooltip title="Restore Token for use in Tasking">
|
||||
|
||||
@@ -474,6 +474,12 @@ tspan {
|
||||
padding: 0.5rem;
|
||||
width: 100%;
|
||||
}
|
||||
.mythic-table-toolbar-search {
|
||||
align-items: stretch;
|
||||
background-color: ${(props) => props.theme.palette.mode === "dark" ? "rgba(255,255,255,0.028)" : "rgba(0,0,0,0.012)"};
|
||||
gap: 0.45rem;
|
||||
padding: 0.45rem;
|
||||
}
|
||||
.mythic-table-toolbar-group {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
@@ -483,6 +489,9 @@ tspan {
|
||||
max-width: 100%;
|
||||
min-width: min(100%, 9rem);
|
||||
}
|
||||
.mythic-table-toolbar-search .mythic-table-toolbar-group {
|
||||
gap: 0.35rem;
|
||||
}
|
||||
.mythic-table-toolbar-group-grow {
|
||||
flex: 1 1 20rem;
|
||||
min-width: min(100%, 16rem);
|
||||
@@ -497,6 +506,10 @@ tspan {
|
||||
min-width: min(100%, 10rem);
|
||||
width: 100%;
|
||||
}
|
||||
.mythic-table-toolbar-search .mythic-toolbar-select,
|
||||
.mythic-table-toolbar-search .MythicTextField-root .MuiInputBase-root {
|
||||
background-color: ${(props) => props.theme.palette.background.paper};
|
||||
}
|
||||
.mythic-toolbar-button {
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -516,11 +529,34 @@ tspan {
|
||||
color: ${(props) => props.theme.palette.success.main} !important;
|
||||
}
|
||||
.mythic-toolbar-toggle {
|
||||
background-color: ${(props) => props.theme.palette.mode === "dark" ? "rgba(255,255,255,0.035)" : "rgba(0,0,0,0.025)"} !important;
|
||||
border: 1px solid ${(props) => props.theme.table?.borderSoft || props.theme.borderColor} !important;
|
||||
border-radius: ${(props) => props.theme.shape.borderRadius}px !important;
|
||||
color: ${(props) => props.theme.palette.text.secondary} !important;
|
||||
gap: 0.35rem;
|
||||
min-height: 32px;
|
||||
text-transform: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.mythic-toolbar-toggle.Mui-selected {
|
||||
background-color: ${(props) => props.theme.palette.primary.main + "18"} !important;
|
||||
border-color: ${(props) => props.theme.palette.primary.main + "55"} !important;
|
||||
color: ${(props) => props.theme.palette.primary.main} !important;
|
||||
}
|
||||
.mythic-toolbar-toggle:hover,
|
||||
.mythic-toolbar-toggle.Mui-selected:hover {
|
||||
background-color: ${(props) => props.theme.palette.primary.main + "22"} !important;
|
||||
border-color: ${(props) => props.theme.palette.primary.main + "77"} !important;
|
||||
color: ${(props) => props.theme.palette.primary.main} !important;
|
||||
}
|
||||
.mythic-toolbar-icon-button {
|
||||
color: ${(props) => props.theme.palette.text.secondary} !important;
|
||||
margin-right: 2px;
|
||||
}
|
||||
.mythic-toolbar-icon-button:hover {
|
||||
background-color: ${(props) => props.theme.palette.primary.main + "16"} !important;
|
||||
color: ${(props) => props.theme.palette.primary.main} !important;
|
||||
}
|
||||
.mythic-dialog-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
Reference in New Issue
Block a user