forked from p34709852/monkey
ui: Refactor scoutsuite hiding functions
This commit is contained in:
parent
6dbac85256
commit
f725efd41a
|
@ -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={() => {
|
||||||
|
|
Loading…
Reference in New Issue