Matrix reset bugfix

This commit is contained in:
VakarisZ 2019-05-07 14:49:17 +03:00
parent 4c0f73cb91
commit fd551a49b1
3 changed files with 7 additions and 18 deletions

View File

@ -75,19 +75,6 @@ class MatrixComponent extends AuthComponent {
}
};
resetConfig = () => {
this.authFetch('/api/attack',
{
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify('reset_attack_matrix')
})
.then(res => res.json())
.then(res => {
this.updateStateFromConfig(res.configuration, 'reset')
});
};
getTableData = (config) => {
let configCopy = JSON.parse(JSON.stringify(config));
let maxTechniques = MatrixComponent.findMaxTechniques(Object.values(configCopy));

View File

@ -274,12 +274,14 @@ class ConfigurePageComponent extends AuthComponent {
});
this.setInitialConfig(res.configuration);
this.props.onStatusChange();
}).then(this.authFetch(ATTACK_URL,{ method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify('reset_attack_matrix')}))
});
this.authFetch(ATTACK_URL,{ method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify('reset_attack_matrix')})
.then(res => res.json())
.then(res => {
this.setState({attackConfig: res.configuration})
this.setState({attackConfig: res.configuration});
this.setInitialAttackConfig(res.configuration);
})
};

View File

@ -70,7 +70,7 @@ $black: #000000;
position: absolute;
top: 50%;
left: 50%;
width: 50%;
width: 100%;
transform: translate3d(-50%, -50%, 0); // center center by default
// set the square