Skip to content

Commit

Permalink
fixing c2 profile config page skipping keystrokes
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Sep 10, 2024
1 parent 3c8243e commit 1f9581b
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 14 deletions.
6 changes: 6 additions & 0 deletions MythicReactUI/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ 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.42] - 2024-09-10

### Changed

- Updated the C2 config page to not miss keystrokes

## [0.2.41] - 2024-09-09

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,18 @@ const getInitialMode = (filename) => {
return "html";
}
export function C2ProfileConfigDialog(props) {
const [config, setConfig] = useState("");
const config = React.useRef("");
const [fetchedData, setFetchedData] = React.useState(false);
const { loading, error } = useQuery(getProfileConfigQuery, {
variables: {container_name: props.container_name, filename: props.filename},
onCompleted: data => {
if(data.containerDownloadFile.status === "error"){
setConfig("Errored trying to read file from container\n" + data.containerDownloadFile.error);
config.current = "Errored trying to read file from container\n" + data.containerDownloadFile.error;
}else{
//console.log(data);
setConfig(atob(data.containerDownloadFile.data));
config.current = atob(data.containerDownloadFile.data);
}
setFetchedData(true);
},
fetchPolicy: "network-only"
});
Expand All @@ -61,9 +63,12 @@ export function C2ProfileConfigDialog(props) {
return <div>Error! {error.message}</div>;
}
const onConfigSubmit = () => {
props.onConfigSubmit(btoa(config));
props.onConfigSubmit(btoa(config.current));
props.onClose();
}
const setConfig = (newData) => {
config.current = newData;
}

return (
<>
Expand All @@ -72,7 +77,7 @@ export function C2ProfileConfigDialog(props) {
<ResponseDisplayPlaintext
onChangeContent={setConfig}
initial_mode={initialMode.current}
plaintext={config}
plaintext={config.current}
expand={true} />
</div>
<DialogActions>
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.41";
export const mythicUIVersion = "0.2.42";

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.1e15539c.js",
"main.js": "/new/static/js/main.36337241.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.1e15539c.js.map": "/new/static/js/main.1e15539c.js.map"
"main.36337241.js.map": "/new/static/js/main.36337241.js.map"
},
"entrypoints": [
"static/css/main.602591e6.css",
"static/js/main.1e15539c.js"
"static/js/main.36337241.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.1e15539c.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.36337241.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 1f9581b

Please sign in to comment.