From fd551a49b130ac8bd80eaf096baec9f843a14637 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Tue, 7 May 2019 14:49:17 +0300 Subject: [PATCH] Matrix reset bugfix --- .../cc/ui/src/components/attack/MatrixComponent.js | 13 ------------- .../cc/ui/src/components/pages/ConfigurePage.js | 10 ++++++---- monkey/monkey_island/cc/ui/src/styles/Checkbox.scss | 2 +- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/attack/MatrixComponent.js b/monkey/monkey_island/cc/ui/src/components/attack/MatrixComponent.js index aae3dc4e8..2e7ef4fc3 100644 --- a/monkey/monkey_island/cc/ui/src/components/attack/MatrixComponent.js +++ b/monkey/monkey_island/cc/ui/src/components/attack/MatrixComponent.js @@ -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)); diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js index e95866c68..c484cf3e0 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js @@ -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); }) }; diff --git a/monkey/monkey_island/cc/ui/src/styles/Checkbox.scss b/monkey/monkey_island/cc/ui/src/styles/Checkbox.scss index 03cd38370..3bf0281f6 100644 --- a/monkey/monkey_island/cc/ui/src/styles/Checkbox.scss +++ b/monkey/monkey_island/cc/ui/src/styles/Checkbox.scss @@ -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