ui: Refactor scoutsuite hiding functions

This commit is contained in:
Ilija Lazoroski 2021-07-14 16:30:41 +02:00
parent 6dbac85256
commit f725efd41a
1 changed files with 7 additions and 9 deletions

View File

@ -58,20 +58,18 @@ function RunOptions(props) {
} }
function getIslandMode() { function getIslandMode() {
let mode = ''; let mode = 'advanced';
authComponent.authFetch(MODE_URL) authComponent.authFetch(MODE_URL)
.then(res => res.json()) .then(res => res.json())
.then(res => { .then(res => {
mode = res.mode mode = res.mode
} }
); );
return mode;
}
if (mode === 'ransomware') { function shouldShowScoutsuite(){
return false; return getIslandMode() === 'advanced';
}
else {
return true;
}
} }
function defaultContents() { function defaultContents() {
@ -87,8 +85,8 @@ function RunOptions(props) {
setComponent(LocalManualRunOptions, setComponent(LocalManualRunOptions,
{ips: ips, setComponent: setComponent}) {ips: ips, setComponent: setComponent})
}}/> }}/>
{getIslandMode() && <AWSRunButton setComponent={setComponent}/> } {shouldShowScoutsuite() && <AWSRunButton setComponent={setComponent}/> }
{getIslandMode() && <NextSelectionButton title={'Cloud security scan'} {shouldShowScoutsuite() && <NextSelectionButton title={'Cloud security scan'}
description={'Explains how to enable cloud security scan.'} description={'Explains how to enable cloud security scan.'}
icon={faCloud} icon={faCloud}
onButtonClick={() => { onButtonClick={() => {