forked from p15670423/monkey
UI: Use local_ips endpoint to get command_servers
This commit is contained in:
parent
d76fad9e17
commit
8af665c0a8
|
@ -9,7 +9,7 @@ import {faExpandArrowsAlt} from '@fortawesome/free-solid-svg-icons';
|
||||||
import RunOnIslandButton from './RunOnIslandButton';
|
import RunOnIslandButton from './RunOnIslandButton';
|
||||||
import AWSRunButton from './RunOnAWS/AWSRunButton';
|
import AWSRunButton from './RunOnAWS/AWSRunButton';
|
||||||
|
|
||||||
const CONFIG_URL = '/api/configuration/island';
|
const LOCAL_IPS_URL = '/api/island/local-ips';
|
||||||
|
|
||||||
function RunOptions(props) {
|
function RunOptions(props) {
|
||||||
|
|
||||||
|
@ -21,13 +21,10 @@ function RunOptions(props) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (initialized === false) {
|
if (initialized === false) {
|
||||||
authComponent.authFetch(CONFIG_URL)
|
authComponent.authFetch(LOCAL_IPS_URL)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(res => {
|
.then(res => {
|
||||||
let commandServers = res.configuration.internal.island_server.command_servers;
|
let ipAddresses = res.local_ips;
|
||||||
let ipAddresses = commandServers.map(ip => {
|
|
||||||
return ip.split(':', 1);
|
|
||||||
});
|
|
||||||
setIps(ipAddresses);
|
setIps(ipAddresses);
|
||||||
setInitialized(true);
|
setInitialized(true);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue