Skip to content

Commit

Permalink
small ui tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Nov 15, 2024
1 parent 0cfb6b0 commit c51b900
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 27 deletions.
7 changes: 7 additions & 0 deletions MythicReactUI/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.56] - 2024-11-14

### Changed

- Updated the initialization to save the defaults incase the database gets set to empty
- Updated some MythicTooltip pieces to forward some embedded styles

## [0.2.55] - 2024-11-14

### Changed
Expand Down
7 changes: 4 additions & 3 deletions MythicReactUI/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ query getUserSettings {
export function App(props) {
const me = useReactiveVar(meState);
const preferences = useReactiveVar(mePreferences);
const [loadingPreference, setLoadingPreferences] = React.useState(true);
const [themeMode, themeToggler] = useDarkMode();
const theme = React.useMemo(
() =>
Expand Down Expand Up @@ -124,17 +125,17 @@ export function App(props) {
fontFamily: preferences?.fontFamily
},
})),
[themeMode, preferences.topColor, preferences.fontSize, preferences.fontFamily]
[themeMode, loadingPreference]
);
const mountedRef = React.useRef(true);
const [openRefreshDialog, setOpenRefreshDialog] = React.useState(false);
const [loadingPreference, setLoadingPreferences] = React.useState(true);

useQuery(userSettingsQuery, {
onCompleted: (data) => {
//console.log("got preferences", data.getOperatorPreferences.preferences)
if(data.getOperatorPreferences.status === "success"){
if(data.getOperatorPreferences.preferences !== null){
mePreferences(data.getOperatorPreferences.preferences);
mePreferences({...preferences, ...data.getOperatorPreferences.preferences});
}
} else {
snackActions.error(`Failed to get user preferences:\n${data.getOperatorPreferences.error}`);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import React from 'react';
import {useTheme} from '@mui/material/styles';

export function MythicStyledTooltip({ children, title, enterDelay}){
export function MythicStyledTooltip({ children, title, enterDelay, tooltipStyle}){
const theme = useTheme();
return (
<span style={{display: "inline-block"}}
<span style={{display: "inline-block", ...tooltipStyle}}
data-tooltip-id={"my-tooltip"}
data-tooltip-content={title}
data-tooltip-variant={theme.palette.mode === 'dark' ? 'light' : 'dark'}
data-tooltip-delay-show={enterDelay ? enterDelay : 750}
>

{children}
</span>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { MythicStyledTooltip } from '../../MythicComponents/MythicStyledTooltip'
import { IconButton } from '@mui/material';
import PersonAddIcon from '@mui/icons-material/PersonAdd';
import {meState} from "../../../cache";
import {restartWebsockets} from "../../../index";

const newOperatorMutation = gql`
mutation NewOperator($username: String!, $password: String!) {
Expand Down Expand Up @@ -151,22 +150,22 @@ export function OperationTable(props){
Operations
</Typography>
{showDeleted ? (
<MythicStyledTooltip title={"Hide Deleted Operations"} style={{float: "right"}}>
<MythicStyledTooltip title={"Hide Deleted Operations"} tooltipStyle={{float: "right"}}>
<IconButton size="small" style={{float: "right", marginTop: "5px", marginRight: "10px"}}
variant="contained" onClick={() => setShowDeleted(!showDeleted)}>
<VisibilityIcon />
</IconButton>
</MythicStyledTooltip>

) : (
<MythicStyledTooltip title={"Show Deleted Operations"} style={{float: "right"}}>
<MythicStyledTooltip title={"Show Deleted Operations"} tooltipStyle={{float: "right"}}>
<IconButton size="small" style={{float: "right", marginTop: "5px", marginRight: "10px"}}
variant="contained" onClick={() => setShowDeleted(!showDeleted)} >
<VisibilityOffIcon />
</IconButton>
</MythicStyledTooltip>
)}
<MythicStyledTooltip title={"Create new operator"} style={{float: "right"}}>
<MythicStyledTooltip title={"Create new operator"} tooltipStyle={{float: "right"}}>
<IconButton size="small"
onClick={()=>{setOpenNewOperatorDialog(true);}}
style={{marginRight: "10px", float: "right", marginTop: "5px"}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export function PayloadBuildStepStatusDialog(props) {
return (
<React.Fragment>
<DialogTitle id="form-dialog-title">Step {props.step.step_number + 1} - {props.step.step_name}</DialogTitle>
<TableContainer component={Paper} className="mythicElement">
<TableContainer className="mythicElement">
<Table size="small" style={{ "maxWidth": "100%", "overflow": "scroll"}}>
<TableHead>
<TableRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ export function SettingsOperatorTable(props){
<Typography variant="h3" style={{textAlign: "left", display: "inline-block", marginLeft: "20px"}}>
Settings
</Typography>
<MythicStyledTooltip title={"Adjust Global Settings"} style={{float: "right", marginRight: "10px", marginLeft: "5px"}}>
<MythicStyledTooltip title={"Adjust Global Settings"} tooltipStyle={{float: "right", marginRight: "10px", marginLeft: "5px"}}>
<IconButton size="small" style={{float: "right", marginTop: "5px"}} variant="contained"
onClick={() => setOpenGlobalSettingsDialog(!openGlobalSettingsDialog)} >
<TuneIcon />
</IconButton>
</MythicStyledTooltip>
{showDeleted ? (
<MythicStyledTooltip title={"Hide Deleted Operators"} style={{float: "right"}}>
<MythicStyledTooltip title={"Hide Deleted Operators"} tooltipStyle={{float: "right"}}>
<IconButton size="small" style={{float: "right", marginTop: "5px"}} variant="contained" onClick={() => setShowDeleted(!showDeleted)}><VisibilityIcon /></IconButton>
</MythicStyledTooltip>
) : (
<MythicStyledTooltip title={"Show Deleted Operators"} style={{float: "right"}}>
<MythicStyledTooltip title={"Show Deleted Operators"} tooltipStyle={{float: "right"}}>
<IconButton size="small" style={{float: "right", marginTop: "5px"}} variant="contained" onClick={() => setShowDeleted(!showDeleted)} ><VisibilityOffIcon /></IconButton>
</MythicStyledTooltip>
)}
Expand All @@ -90,7 +90,7 @@ export function SettingsOperatorTable(props){
onClose={()=>{setOpenGlobalSettingsDialog(false);}} />}
/>
}
<MythicStyledTooltip title={"Search for API Tokens"} style={{float: "right", marginRight: "5px",}} >
<MythicStyledTooltip title={"Search for API Tokens"} tooltipStyle={{float: "right", marginRight: "5px",}} >
<IconButton size={"small"} style={{float: "right", marginTop: "5px"}} variant="contained"
onClick={() => setOpenAPITokenSearch(true)}>
<SearchIcon />
Expand All @@ -103,18 +103,18 @@ export function SettingsOperatorTable(props){
onClose={()=>{setOpenAPITokenSearch(false);}} />}
/>
}
<MythicStyledTooltip title={"Create new Bot account"} style={{float: "right", marginLeft: "5px"}}>
<MythicStyledTooltip title={"Create new Bot account"} tooltipStyle={{float: "right", marginLeft: "5px"}}>
<IconButton size={"small"} style={{float: "right", marginTop: "5px"}}
onClick={()=>{setOpenNewBotDialog(true);}} variant="contained">
<SmartToyTwoToneIcon />
</IconButton>
</MythicStyledTooltip>
<MythicStyledTooltip title={"Create new user account"} style={{float: "right", marginLeft: "5px"}}>
<MythicStyledTooltip title={"Create new user account"} tooltipStyle={{float: "right", marginLeft: "5px"}}>
<IconButton size="small" onClick={()=>{setOpenNewDialog(true);}} style={{float: "right", marginTop: "5px"}} variant="contained">
<PersonAddIcon/>
</IconButton>
</MythicStyledTooltip>
<MythicStyledTooltip title={"Manage Invite Links"} style={{float: "right", marginLeft: "5px"}}>
<MythicStyledTooltip title={"Manage Invite Links"} tooltipStyle={{float: "right", marginLeft: "5px"}}>
<IconButton size={"small"} onClick={()=>{setOpenInviteLinksDialog(true);}} variant={"contained"} style={{float: "right", marginTop: "5px"}}>
<ForwardToInboxTwoToneIcon />
</IconButton>
Expand Down
2 changes: 1 addition & 1 deletion MythicReactUI/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {snackActions} from './components/utilities/Snackbar';
import jwt_decode from 'jwt-decode';
import {meState} from './cache';

export const mythicUIVersion = "0.2.55";
export const mythicUIVersion = "0.2.56";

let fetchingNewToken = false;

Expand Down
6 changes: 3 additions & 3 deletions mythic-react-docker/mythic/public/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"files": {
"main.css": "/new/static/css/main.602591e6.css",
"main.js": "/new/static/js/main.30de1505.js",
"main.js": "/new/static/js/main.155912c7.js",
"static/media/mythic-red.png": "/new/static/media/mythic-red.203468a4e5240d239aa0.png",
"static/media/mythic_red_small.svg": "/new/static/media/mythic_red_small.793b41cc7135cdede246661ec232976b.svg",
"index.html": "/new/index.html",
"main.602591e6.css.map": "/new/static/css/main.602591e6.css.map",
"main.30de1505.js.map": "/new/static/js/main.30de1505.js.map"
"main.155912c7.js.map": "/new/static/js/main.155912c7.js.map"
},
"entrypoints": [
"static/css/main.602591e6.css",
"static/js/main.30de1505.js"
"static/js/main.155912c7.js"
]
}
2 changes: 1 addition & 1 deletion mythic-react-docker/mythic/public/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/new/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="apple-touch-icon" href="/new/logo192.png"/><link rel="manifest" href="/new/manifest.json"/><title>Mythic</title><script defer="defer" src="/new/static/js/main.30de1505.js"></script><link href="/new/static/css/main.602591e6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/new/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="apple-touch-icon" href="/new/logo192.png"/><link rel="manifest" href="/new/manifest.json"/><title>Mythic</title><script defer="defer" src="/new/static/js/main.155912c7.js"></script><link href="/new/static/css/main.602591e6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit c51b900

Please sign in to comment.