Skip to content

Commit

Permalink
UI updates and temp tweak for wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Nov 5, 2024
1 parent ef79c90 commit e1c37ba
Show file tree
Hide file tree
Showing 24 changed files with 500 additions and 994 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +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).

## [3.3.1-rc20] - 2024-11-5

### Changed

- Fixed an issue where some Numbers were getting saved as scientific notation floats
- Temporary update where Wrappers can identify payloads to wrap, not just payloads identifying the wrappers
- This currently is only additive

## [3.3.1-rc19] - 2024-11-1

### Changed
Expand Down
14 changes: 14 additions & 0 deletions MythicReactUI/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ 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-

### Changed

- Fixed bug where right-clicking file browser tree and issuing "list" would list current callback host instead of selected file host
- Fixed bug where selecting "original callback" -> "list" would crash for file browser
- Fixed an alignment issue with trash icons
- Fixed a bug where you could only tab complete the first parameter's options on the command line
- Updated search page for processes to indicate if a process is marked as deleted or not
- Updated process browser to only show active processes
- Updated file browser right-click context menu
- Updated file browser table row action button to not duplicate what's in the context menu for the row
- Updated process browser info buttons

## [0.2.51] - 2024-10-21

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,17 @@ const CellPreMemo = ({ VariableSizeGridProps: { style, rowIndex, columnIndex, da
contextMenuLocationRef.current.y = event.clientY;
if(data.onRowContextMenuClick){
const newMenuItems = data.onRowContextMenuClick({rowDataStatic: data.items[rowIndex][columnIndex]?.props?.rowData});
if(newMenuItems.length > 0){
setContextMenuOptions(newMenuItems);
Promise.resolve(newMenuItems).then(function(value) {
if(value.length > 0){
setContextMenuOptions(value);
setOpenContextMenu(true);
}
})
} else {
if(contextMenuOptions && contextMenuOptions.length > 0){
setOpenContextMenu(true);
return;
}
}
if(contextMenuOptions && contextMenuOptions.length > 0){
setOpenContextMenu(true);
}
},
[contextMenuOptions, data.onRowContextMenuClick] // eslint-disable-line react-hooks/exhaustive-deps
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import PlaylistAddIcon from '@mui/icons-material/PlaylistAdd';
import PlaylistRemoveIcon from '@mui/icons-material/PlaylistRemove';
import {SetMythicSetting, useMythicSetting} from "../../MythicComponents/MythicSavedUserSetting";
import {RenderSingleTask} from "../SingleTaskView/SingleTaskView";
import {loadedCommandsQuery} from "./CallbacksTabsProcessBrowser";

const fileDataFragment = gql`
fragment fileObjData on mythictree {
Expand Down Expand Up @@ -220,6 +221,8 @@ export const CallbacksTabsFileBrowserPanel = ({ index, value, tabInfo, me }) =>
group: "",
full_path_text: ""
});
const loadedCommandsRef = React.useRef({});
const loadingCommandsRef = React.useRef(false);
useQuery(rootFileQuery, {
onCompleted: (data) => {
// use an adjacency matrix but only for full_path_text -> children, not both directions
Expand Down Expand Up @@ -368,6 +371,40 @@ export const CallbacksTabsFileBrowserPanel = ({ index, value, tabInfo, me }) =>
}
}
})
const [getLoadedCommandsQuery] = useLazyQuery(loadedCommandsQuery, {
fetchPolicy: 'no-cache',
onCompleted: (data) => {
if(data.loadedcommands.length > 0){
loadedCommandsRef.current[data.loadedcommands[0].callback_id] = [...data.loadedcommands];
}
loadingCommandsRef.current = false;
},
onError: (data) => {
console.log(data);
loadingCommandsRef.current = false;
}
});
async function getLoadedCommandForUIFeature (callback_id, uifeature){
while(loadingCommandsRef.current){
await new Promise(resolve => setTimeout(resolve, 50));
}
if(loadedCommandsRef.current[callback_id] === undefined){
loadingCommandsRef.current = true;
getLoadedCommandsQuery({variables: {callback_id: callback_id}});
while(loadingCommandsRef.current){
await new Promise(resolve => setTimeout(resolve, 50));
}
}
if(loadedCommandsRef.current[callback_id] === undefined){
return undefined;
}
for(let i = 0; i < loadedCommandsRef.current[callback_id].length; i++){
if(loadedCommandsRef.current[callback_id][i].command.supported_ui_features.includes(uifeature)){
return loadedCommandsRef.current[callback_id][i];
}
}
return undefined;
}
const [getFolderData] = useLazyQuery(folderQuery, {
onError: (data) => {
console.error(data);
Expand Down Expand Up @@ -589,7 +626,7 @@ export const CallbacksTabsFileBrowserPanel = ({ index, value, tabInfo, me }) =>
const taskListing = (nodeData, callback_id, callback_display_id) => {
taskingData.current = ({
"token": localSelectedToken.current,
"parameters": {path: nodeData.full_path_text, full_path: nodeData.full_path_text, host: selectedFolderData.host, file: ""},
"parameters": {path: nodeData.full_path_text, full_path: nodeData.full_path_text, host: nodeData.host, file: ""},
"ui_feature": "file_browser:list", callback_id, callback_display_id});
setOpenTaskingButton(true);
}
Expand Down Expand Up @@ -623,6 +660,7 @@ export const CallbacksTabsFileBrowserPanel = ({ index, value, tabInfo, me }) =>
setTableData={onSetTableData}
taskListing={taskListing}
tableOpenedPathId={tableOpenedPathIdRef.current}
getLoadedCommandForUIFeature={getLoadedCommandForUIFeature}
/>

</div>
Expand Down Expand Up @@ -658,6 +696,7 @@ export const CallbacksTabsFileBrowserPanel = ({ index, value, tabInfo, me }) =>
autoTaskLsOnEmptyDirectories={autoTaskLsOnEmptyDirectoriesRef.current}
onTaskRowAction={onTaskRowAction}
onTaskRowActions={onTaskRowActions}
getLoadedCommandForUIFeature={getLoadedCommandForUIFeature}
me={me}
/>
</div>
Expand Down Expand Up @@ -768,7 +807,7 @@ const FileBrowserTableTop = ({
}
const moveIndexToNextListing = () => {
// we're getting close to index 0, the newest listing
console.log(historyIndex, history);
//console.log(historyIndex, history);
if(historyIndex <= 0){
return
}
Expand Down
Loading

0 comments on commit e1c37ba

Please sign in to comment.