diff --git a/monkey_island/cc/ui/src/components/pages/ReportPage.js b/monkey_island/cc/ui/src/components/pages/ReportPage.js index 404d2e374..e29d9388f 100644 --- a/monkey_island/cc/ui/src/components/pages/ReportPage.js +++ b/monkey_island/cc/ui/src/components/pages/ReportPage.js @@ -30,16 +30,29 @@ class ReportPageComponent extends React.Component { super(props); this.state = { report: {}, - graph: {nodes: [], edges: []} + graph: {nodes: [], edges: []}, + allMonkeysAreDead: false }; } componentDidMount() { this.getReportFromServer(); this.updateMapFromServer(); + this.updateMonkeysRunning(); this.interval = setInterval(this.updateMapFromServer, 1000); } + updateMonkeysRunning = () => { + fetch('/api') + .then(res => res.json()) + .then(res => { + // This check is used to prevent unnecessary re-rendering + this.setState({ + allMonkeysAreDead: (!res['completed_steps']['run_monkey']) || (res['completed_steps']['infection_done']) + }); + }); + }; + componentWillUnmount() { clearInterval(this.interval); } @@ -361,8 +374,18 @@ class ReportPageComponent extends React.Component { Infection Monkey did not find any critical security issues.
) } + { + this.state.allMonkeysAreDead ? + '' + : + (+ + Some monkeys are still running. To get the best report it's best to wait for all of them to finish + running. +
) + }- + To improve the monkey's success rate, try adding users and passwords, and enabling the "Local network scan" config value under "Basic - Network"