Skip to content

Commit

Permalink
few UI CLI tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Nov 6, 2024
1 parent 96fe2e8 commit fe59952
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 29 deletions.
9 changes: 8 additions & 1 deletion MythicReactUI/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ 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.52] - 2024-11-
## [0.2.53] - 2024-11-6

### Changed

- Removed File as a tab-completable parameter on the CLI
- Updated tab-completes to use local choices over dynamic query parameters on CLI

## [0.2.52] - 2024-11-5

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ const IsCLIPossibleParameterType = (parameter_type) => {
case "TypedArray":
case "ChooseMultiple":
case "String":
case "File":
return true;
default:
return false;
Expand Down Expand Up @@ -454,7 +453,15 @@ export function CallbacksTabsTaskingInputPreMemo(props){
console.log("lastSuppliedParameter", lastSuppliedParameter, "has_value", lastSuppliedParameterHasValue);
lastValueTypedBeforeDynamicParamsRef.current = lastSuppliedParameterHasValue;
if (lastSuppliedParameter !== undefined && parsed[lastSuppliedParameter.cli_name] !== undefined && lastSuppliedParameterHasValue === ""){
if(lastSuppliedParameter.dynamic_query_function !== ""){
if (lastSuppliedParameter.choices.length > 0){
tabOptions.current = lastSuppliedParameter.choices;
tabOptionsIndex.current = 0;
tabOptionsType.current = "param_value";
let newChoice = lastSuppliedParameter.choices[0].includes(" ") ? "\"" + lastSuppliedParameter.choices[0] + "\"" : lastSuppliedParameter.choices[0];
let newMsg = message + newChoice;
setMessage(newMsg);
return;
} else if(lastSuppliedParameter.dynamic_query_function !== ""){
setBackdropOpen(true);
//snackActions.info("Querying payload type container for options...", snackMessageStyles);
getDynamicParams({variables:{
Expand All @@ -464,14 +471,6 @@ export function CallbacksTabsTaskingInputPreMemo(props){
payload_type: cmd.payloadtype.name
}});
return;
} else if (lastSuppliedParameter.choices.length > 0){
tabOptions.current = lastSuppliedParameter.choices;
tabOptionsIndex.current = 0;
tabOptionsType.current = "param_value";
let newChoice = lastSuppliedParameter.choices[0].includes(" ") ? "\"" + lastSuppliedParameter.choices[0] + "\"" : lastSuppliedParameter.choices[0];
let newMsg = message + newChoice;
setMessage(newMsg);
return;
}
}
console.log("cmdGroupNames in tab", cmdGroupNames);
Expand Down Expand Up @@ -604,7 +603,15 @@ export function CallbacksTabsTaskingInputPreMemo(props){
console.log("lastSuppliedParameter", lastSuppliedParameter)
lastValueTypedBeforeDynamicParamsRef.current = lastSuppliedParameterHasValue;
if (lastSuppliedParameter !== undefined && parsed[lastSuppliedParameter.cli_name] !== undefined){
if(lastSuppliedParameter.dynamic_query_function !== ""){
if (lastSuppliedParameter.choices.length > 0){
tabOptions.current = lastSuppliedParameter.choices;
tabOptionsIndex.current = 0;
tabOptionsType.current = "param_value";
let newChoice = lastSuppliedParameter.choices[0].includes(" ") ? "\"" + lastSuppliedParameter.choices[0] + "\"" : lastSuppliedParameter.choices[0];
let newMsg = message + newChoice;
setMessage(newMsg);
return;
} else if(lastSuppliedParameter.dynamic_query_function !== ""){
setBackdropOpen(true);
//snackActions.info("Querying payload type container for options...", snackMessageStyles);
getDynamicParams({variables:{
Expand All @@ -614,14 +621,6 @@ export function CallbacksTabsTaskingInputPreMemo(props){
payload_type: cmd.payloadtype.name
}});
return;
} else if (lastSuppliedParameter.choices.length > 0){
tabOptions.current = lastSuppliedParameter.choices;
tabOptionsIndex.current = 0;
tabOptionsType.current = "param_value";
let newChoice = lastSuppliedParameter.choices[0].includes(" ") ? "\"" + lastSuppliedParameter.choices[0] + "\"" : lastSuppliedParameter.choices[0];
let newMsg = message + newChoice;
setMessage(newMsg);
return;
}
}
return;
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.52";
export const mythicUIVersion = "0.2.53";

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.9978d25f.js",
"main.js": "/new/static/js/main.add1b9f4.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.9978d25f.js.map": "/new/static/js/main.9978d25f.js.map"
"main.add1b9f4.js.map": "/new/static/js/main.add1b9f4.js.map"
},
"entrypoints": [
"static/css/main.602591e6.css",
"static/js/main.9978d25f.js"
"static/js/main.add1b9f4.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.9978d25f.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.add1b9f4.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 fe59952

Please sign in to comment.