forked from p15670423/monkey
Island: Rename local-ips resource to ip-addresses
This commit is contained in:
parent
8ae6bb8c73
commit
ed3c369eef
|
@ -27,10 +27,10 @@ from monkey_island.cc.resources.configuration_import import ConfigurationImport
|
|||
from monkey_island.cc.resources.edge import Edge
|
||||
from monkey_island.cc.resources.exploitations.manual_exploitation import ManualExploitation
|
||||
from monkey_island.cc.resources.exploitations.monkey_exploitation import MonkeyExploitation
|
||||
from monkey_island.cc.resources.ip_addresses import IpAddresses
|
||||
from monkey_island.cc.resources.island_configuration import IslandConfiguration
|
||||
from monkey_island.cc.resources.island_logs import IslandLog
|
||||
from monkey_island.cc.resources.island_mode import IslandMode
|
||||
from monkey_island.cc.resources.local_ips import LocalIps
|
||||
from monkey_island.cc.resources.local_run import LocalRun
|
||||
from monkey_island.cc.resources.log import Log
|
||||
from monkey_island.cc.resources.monkey import Monkey
|
||||
|
@ -172,7 +172,7 @@ def init_api_resources(api: FlaskDIWrapper):
|
|||
api.add_resource(TelemetryFeed)
|
||||
api.add_resource(Log)
|
||||
api.add_resource(IslandLog)
|
||||
api.add_resource(LocalIps)
|
||||
api.add_resource(IpAddresses)
|
||||
|
||||
# API Spec: These two should be the same resource, GET for download and POST for upload
|
||||
api.add_resource(PBAFileDownload)
|
||||
|
|
|
@ -3,8 +3,8 @@ from monkey_island.cc.resources.request_authentication import jwt_required
|
|||
from monkey_island.cc.services.utils.network_utils import local_ip_addresses
|
||||
|
||||
|
||||
class LocalIps(AbstractResource):
|
||||
urls = ["/api/island/local-ips"]
|
||||
class IpAddresses(AbstractResource):
|
||||
urls = ["/api/island/ip-addresses"]
|
||||
|
||||
@jwt_required
|
||||
def get(self):
|
||||
|
@ -15,4 +15,4 @@ class LocalIps(AbstractResource):
|
|||
"""
|
||||
local_ips = local_ip_addresses()
|
||||
|
||||
return {"local_ips": local_ips}
|
||||
return {"ip_addresses": local_ips}
|
|
@ -9,7 +9,7 @@ import {faExpandArrowsAlt} from '@fortawesome/free-solid-svg-icons';
|
|||
import RunOnIslandButton from './RunOnIslandButton';
|
||||
import AWSRunButton from './RunOnAWS/AWSRunButton';
|
||||
|
||||
const LOCAL_IPS_URL = '/api/island/local-ips';
|
||||
const IP_ADDRESSES_URL = '/api/island/ip-addresses';
|
||||
|
||||
function RunOptions(props) {
|
||||
|
||||
|
@ -21,10 +21,10 @@ function RunOptions(props) {
|
|||
|
||||
useEffect(() => {
|
||||
if (initialized === false) {
|
||||
authComponent.authFetch(LOCAL_IPS_URL)
|
||||
authComponent.authFetch(IP_ADDRESSES_URL)
|
||||
.then(res => res.json())
|
||||
.then(res => {
|
||||
let ipAddresses = res.local_ips;
|
||||
let ipAddresses = res.ip_addresses;
|
||||
setIps(ipAddresses);
|
||||
setInitialized(true);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue