forked from p15670423/monkey
cc: Add ransomware report tab to reports page depending on mode
This commit is contained in:
parent
e5160a5fb4
commit
278a09e039
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue