forked from p34709852/monkey
cc: Add dummy code to frontend to check if ransomware report tab should be showed
This commit is contained in:
parent
2f090f0060
commit
231fa6f99f
|
@ -59,8 +59,7 @@ class ReportPageComponent extends AuthComponent {
|
||||||
this.setState({zeroTrustReport: ztReport})
|
this.setState({zeroTrustReport: ztReport})
|
||||||
});
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
ransomwareReport: {'report': '',
|
ransomwareReport: {'report': ''}})
|
||||||
'show': true}})
|
|
||||||
// this.authFetch('/api/report/ransomware')
|
// this.authFetch('/api/report/ransomware')
|
||||||
// .then(res => res.json())
|
// .then(res => res.json())
|
||||||
// .then(res => {
|
// .then(res => {
|
||||||
|
@ -68,7 +67,7 @@ class ReportPageComponent extends AuthComponent {
|
||||||
// ransomwareReport: res
|
// ransomwareReport: res
|
||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
if (this.state.ransomwareReport['show'] === true) {
|
if (this.shouldShowRansomwareReport(this.state.ransomwareReport)) {
|
||||||
this.state.sections.push({key: 'ransomware', title: 'Ransomware report'})
|
this.state.sections.push({key: 'ransomware', title: 'Ransomware report'})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,6 +98,12 @@ class ReportPageComponent extends AuthComponent {
|
||||||
return ztReport
|
return ztReport
|
||||||
};
|
};
|
||||||
|
|
||||||
|
shouldShowRansomwareReport(report) { // TODO: Add proper check
|
||||||
|
if (report) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
clearInterval(this.state.ztReportRefreshInterval);
|
clearInterval(this.state.ztReportRefreshInterval);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue