UI: Add formatting to StolenPasswordsComponent

This component was used in security and attack report with
two different sets of data. The first one is from the
credentials endpoint which needed formatting and the second
from the telemetry which was already formatted.
This commit is contained in:
Ilija Lazoroski 2022-07-18 08:27:35 +02:00
parent 27c0b838c4
commit 5e1adbb877
3 changed files with 12 additions and 3 deletions

View File

@ -18,7 +18,9 @@ class T1003 extends React.Component {
<br/>
{this.props.data.status === ScanStatus.USED ?
<StolenPasswordsComponent
data={this.props.data.stolen_creds}/>
data={this.props.data.stolen_creds}
format={false}
/>
: ''}
<MitigationsComponent mitigations={this.props.data.mitigations}/>
</div>

View File

@ -537,7 +537,10 @@ class ReportPageComponent extends AuthComponent {
</div>
<div style={{marginBottom: '20px'}}>
<StolenPasswords data={this.state.stolenCredentials}/>
<StolenPasswords
data={this.state.stolenCredentials}
format={true}
/>
</div>
<div>
<StrongUsers data={this.state.report.glance.strong_users}/>

View File

@ -22,7 +22,11 @@ class StolenPasswordsComponent extends React.Component {
render() {
let defaultPageSize = this.props.data.length > pageSize ? pageSize : this.props.data.length;
let showPagination = this.props.data.length > pageSize;
let table_data = getCredentialsTableData(this.props.data);
let table_data = this.props.data;
if(this.props.format) {
table_data = getCredentialsTableData(this.props.data);
}
return (
<div className="data-table-container">
<ReactTable