Skip to content

Commit

Permalink
updates to invite links
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Nov 26, 2024
1 parent f941764 commit 82b335c
Show file tree
Hide file tree
Showing 19 changed files with 576 additions and 99 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ 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-rc27] - 2024-11-26

### Changed

- Added more functionality to invite links
- you can now specify a specific operation and role to assign the new operator to
- you can now specify (and change) the maximum number of usages that the invite link has
- Updated mythic-cli to properly pass in the environment's mythic_server_allow_invite_links setting

## [3.3.1-rc26]

### Changed
Expand Down
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.60] - 2024-11-26

### Changed

- Updated how invite links work in the UI allowing more flexibility
- Updated the main dashboard/home page to refresh every minute

## [0.2.59] - 2024-11-20

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class MythicTextField extends React.Component {
inline: PropTypes.bool,
marginBottom: PropTypes.string,
value: PropTypes.any,
disabled: PropTypes.bool,
}
onChange = evt => {
const name = this.props.name;
Expand Down
16 changes: 13 additions & 3 deletions MythicReactUI/src/components/pages/Home/CallbacksCard.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Paper from '@mui/material/Paper';
import { useQuery, gql} from '@apollo/client';
import { useLazyQuery, gql} from '@apollo/client';
import { PieChart, pieArcLabelClasses } from '@mui/x-charts/PieChart';
import {useTheme} from '@mui/material/styles';
import { useDrawingArea } from '@mui/x-charts/hooks';
Expand All @@ -20,7 +20,9 @@ import MythicTableCell from "../../MythicComponents/MythicTableCell";
import {useNavigate} from 'react-router-dom';
import { BarChart } from '@mui/x-charts/BarChart';
import {getStringSize} from "../Callbacks/ResponseDisplayTable";
import {toLocalTime} from "../../utilities/Time";
import {useInterval} from "../../utilities/Time";
import {isJWTValid, JWTTimeLeft} from "../../../index";
import {FailedRefresh} from "../../../cache";

const GetCallbacks = gql`
query GetCallbacks {
Expand Down Expand Up @@ -146,6 +148,7 @@ const errorColors = [
]
export function CallbacksCard({me}) {
const theme = useTheme();
const mountedRef = React.useRef(true);
const navigate = useNavigate();
const [active, setActive] = React.useState({"active": 0, "recent": 0, "total": 0});
const [tags, setTags] = React.useState([]);
Expand Down Expand Up @@ -198,7 +201,7 @@ export function CallbacksCard({me}) {
}

}
useQuery(GetCallbacks, {fetchPolicy: "network-only",
const [fetchData] = useLazyQuery(GetCallbacks, {fetchPolicy: "network-only",
onCompleted: (data) => {
let callbackData = {};
let recent = 0;
Expand Down Expand Up @@ -598,6 +601,13 @@ export function CallbacksCard({me}) {

}
});
React.useEffect( () => {
fetchData();
}, []);
useInterval( () => {
// interval should run every 1 minutes (60000 milliseconds) to check JWT status
fetchData();
}, 60000, mountedRef, mountedRef);
return (
<>
<div style={{display: "flex"}}>
Expand Down
Loading

0 comments on commit 82b335c

Please sign in to comment.