forked from p15670423/monkey
Matrix submit bugfix
This commit is contained in:
parent
88229e74c9
commit
f5da1bf3b6
|
@ -14,7 +14,7 @@ import ReportPage from 'components/pages/ReportPage';
|
|||
import LicensePage from 'components/pages/LicensePage';
|
||||
import AuthComponent from 'components/AuthComponent';
|
||||
import LoginPageComponent from 'components/pages/LoginPage';
|
||||
import AttckPage from 'components/pages/AttckPage'
|
||||
import AttckPage from 'components/pages/AttackPage'
|
||||
|
||||
import 'normalize.css/normalize.css';
|
||||
import 'react-data-components/css/table-twbs.css';
|
||||
|
|
|
@ -80,7 +80,6 @@ class MatrixComponent extends AuthComponent {
|
|||
};
|
||||
|
||||
onSubmit = () => {
|
||||
console.log(this.state.matrixData);
|
||||
this.authFetch('/api/attack',
|
||||
{
|
||||
method: 'POST',
|
||||
|
@ -144,7 +143,7 @@ class MatrixComponent extends AuthComponent {
|
|||
: ''}
|
||||
</div>
|
||||
<div className="text-center">
|
||||
<button onClick={this.onSubmit} className="btn btn-success btn-lg" style={{margin: '5px'}}>
|
||||
<button type="button" onClick={this.onSubmit} className="btn btn-success btn-lg" style={{margin: '5px'}}>
|
||||
Apply to configuration
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,7 @@ import AuthComponent from '../AuthComponent';
|
|||
import 'filepond/dist/filepond.min.css';
|
||||
import MatrixComponent from '../attack/MatrixComponent'
|
||||
|
||||
class AttckComponent extends AuthComponent {
|
||||
class AttackComponent extends AuthComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.currentSection = 'ATT&CK matrix';
|
||||
|
@ -35,9 +35,13 @@ class AttckComponent extends AuthComponent {
|
|||
|
||||
render() {
|
||||
let content;
|
||||
content = (<MatrixComponent configuration={this.state.configuration} />);
|
||||
if (Object.keys(this.state.configuration).length === 0) {
|
||||
content = (<h1>Fetching configuration...</h1>);
|
||||
} else {
|
||||
content = (<MatrixComponent configuration={this.state.configuration} />);
|
||||
}
|
||||
return <div>{content}</div>;
|
||||
}
|
||||
}
|
||||
|
||||
export default AttckComponent;
|
||||
export default AttackComponent;
|
Loading…
Reference in New Issue