forked from p15670423/monkey
Take IPs for Run Monkey -> Manual page from configuration
This commit is contained in:
parent
bc3283c4a5
commit
11e6b9e281
|
@ -10,6 +10,8 @@ import RunOnIslandButton from './RunOnIslandButton';
|
||||||
import AWSRunButton from './RunOnAWS/AWSRunButton';
|
import AWSRunButton from './RunOnAWS/AWSRunButton';
|
||||||
import CloudOptions from './scoutsuite-setup/CloudOptions';
|
import CloudOptions from './scoutsuite-setup/CloudOptions';
|
||||||
|
|
||||||
|
const CONFIG_URL = '/api/configuration/island';
|
||||||
|
|
||||||
function RunOptions(props) {
|
function RunOptions(props) {
|
||||||
|
|
||||||
const [currentContent, setCurrentContent] = useState(loadingContents());
|
const [currentContent, setCurrentContent] = useState(loadingContents());
|
||||||
|
@ -20,10 +22,14 @@ function RunOptions(props) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (initialized === false) {
|
if (initialized === false) {
|
||||||
authComponent.authFetch('/api')
|
authComponent.authFetch(CONFIG_URL)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(res => {
|
.then(res => {
|
||||||
setIps([res['ip_addresses']][0]);
|
let commandServers = res.configuration.internal.island_server.command_servers;
|
||||||
|
let ipAddresses = commandServers.map(ip => {
|
||||||
|
return ip.split(":", 1);
|
||||||
|
});
|
||||||
|
setIps(ipAddresses);
|
||||||
setInitialized(true);
|
setInitialized(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue