diff --git a/monkey/monkey_island/cc/ui/src/components/Main.js b/monkey/monkey_island/cc/ui/src/components/Main.js index c068b9caf..7a7851af8 100644 --- a/monkey/monkey_island/cc/ui/src/components/Main.js +++ b/monkey/monkey_island/cc/ui/src/components/Main.js @@ -155,6 +155,7 @@ class AppComponent extends AuthComponent { true)} {this.renderRoute('/configure', )} {this.renderRoute('/run-monkey', 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 26141b22c..4f1df6bab 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js @@ -31,8 +31,7 @@ class ConfigurePageComponent extends AuthComponent { super(props); this.initialConfig = {}; this.initialAttackConfig = {}; - this.sectionsOrder = this.getSectionsOrder(); - this.currentSection = this.sectionsOrder[0]; + this.currentSection = this.getSectionsOrder()[0]; this.state = { attackConfig: {}, @@ -51,18 +50,9 @@ class ConfigurePageComponent extends AuthComponent { }; } - getSectionsOrder() { // TODO: Fetch mode from API endpoint - // let mode = ""; - // this.authFetch('/api/mode') - // .then(res => res.json()) - // .then(res => { - // mode = res.mode - // } - // ); - - // let mode = 'ransomware'; - let mode = 'advanced'; - return CONFIGURATION_TABS_PER_MODE[mode]; + getSectionsOrder() { + let islandMode = this.props.islandMode ? this.props.islandMode : 'advanced' + return CONFIGURATION_TABS_PER_MODE[islandMode]; } setInitialConfig(config) { @@ -85,7 +75,7 @@ class ConfigurePageComponent extends AuthComponent { let monkeyConfig = data[0]; this.setInitialConfig(monkeyConfig.configuration); this.setInitialAttackConfig(attackConfig.configuration); - for (let sectionKey of this.sectionsOrder) { + for (let sectionKey of this.getSectionsOrder()) { if (sectionKey === 'attack') { sections.push({key: sectionKey, title: 'ATT&CK'}) } else {