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 LicensePage from 'components/pages/LicensePage';
|
||||||
import AuthComponent from 'components/AuthComponent';
|
import AuthComponent from 'components/AuthComponent';
|
||||||
import LoginPageComponent from 'components/pages/LoginPage';
|
import LoginPageComponent from 'components/pages/LoginPage';
|
||||||
import AttckPage from 'components/pages/AttckPage'
|
import AttckPage from 'components/pages/AttackPage'
|
||||||
|
|
||||||
import 'normalize.css/normalize.css';
|
import 'normalize.css/normalize.css';
|
||||||
import 'react-data-components/css/table-twbs.css';
|
import 'react-data-components/css/table-twbs.css';
|
||||||
|
|
|
@ -80,7 +80,6 @@ class MatrixComponent extends AuthComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
onSubmit = () => {
|
onSubmit = () => {
|
||||||
console.log(this.state.matrixData);
|
|
||||||
this.authFetch('/api/attack',
|
this.authFetch('/api/attack',
|
||||||
{
|
{
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
@ -144,7 +143,7 @@ class MatrixComponent extends AuthComponent {
|
||||||
: ''}
|
: ''}
|
||||||
</div>
|
</div>
|
||||||
<div className="text-center">
|
<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
|
Apply to configuration
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,7 +3,7 @@ import AuthComponent from '../AuthComponent';
|
||||||
import 'filepond/dist/filepond.min.css';
|
import 'filepond/dist/filepond.min.css';
|
||||||
import MatrixComponent from '../attack/MatrixComponent'
|
import MatrixComponent from '../attack/MatrixComponent'
|
||||||
|
|
||||||
class AttckComponent extends AuthComponent {
|
class AttackComponent extends AuthComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.currentSection = 'ATT&CK matrix';
|
this.currentSection = 'ATT&CK matrix';
|
||||||
|
@ -35,9 +35,13 @@ class AttckComponent extends AuthComponent {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let content;
|
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>;
|
return <div>{content}</div>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default AttckComponent;
|
export default AttackComponent;
|
Loading…
Reference in New Issue