diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js b/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js index 86b73dbb4..df3fd1137 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js @@ -68,7 +68,7 @@ class ReportPageComponent extends AuthComponent { // }); // }); if (this.shouldShowRansomwareReport(this.state.ransomwareReport)) { - this.state.sections.push({key: 'ransomware', title: 'Ransomware report'}) + this.addRansomwareReportTab(); } } } @@ -104,6 +104,26 @@ class ReportPageComponent extends AuthComponent { } } + addRansomwareReportTab() { // TODO: Fetch mode from API endpoint + let ransomwareTab = {key: 'ransomware', title: 'Ransomware report'}; + + // let mode = ""; + // this.authFetch('/api/mode') + // .then(res => res.json()) + // .then(res => { + // mode = res.mode + // } + // ); + + let mode = 'ransomware'; + if (mode === 'ransomware') { + this.state.sections.splice(0, 0, ransomwareTab); + } + else { + this.state.sections.push(ransomwareTab); + } + } + componentWillUnmount() { clearInterval(this.state.ztReportRefreshInterval); }