diff --git a/src/_services/network.service.js b/src/_services/network.service.js index 64c2be3..ab04076 100644 --- a/src/_services/network.service.js +++ b/src/_services/network.service.js @@ -35,17 +35,17 @@ function getNearestRegions(footprint, messages, errors) { return fetch(`${config.apiUrl}/me/regions/closest${footprintParam}`, util.getWithAuth()).then(util.handleCrudResponse(messages, errors)); } -function getCloudAndRegion(cloud, region) { - return (typeof cloud === 'undefined' || typeof region === 'undefined' || cloud === null || region === null) ? "" : `?cloud=${cloud}®ion=${region}`; +function getCloudAndRegion(cloud, region, exactRegion) { + return `?cloud=${cloud}®ion=${region}&exactRegion=${exactRegion}`; } -function startNetwork(userId, planId, cloud, region, messages, errors) { - const cloudAndRegion = getCloudAndRegion(cloud, region); +function startNetwork(userId, planId, cloud, region, exactRegion, messages, errors) { + const cloudAndRegion = getCloudAndRegion(cloud, region, exactRegion); return fetch(`${config.apiUrl}/users/${userId}/networks/${planId}/actions/start${cloudAndRegion}`, util.postWithAuth()).then(util.handleCrudResponse(messages, errors)); } -function forkNetwork(userId, planId, forkHost, cloud, region, messages, errors) { - const cloudAndRegion = getCloudAndRegion(cloud, region); +function forkNetwork(userId, planId, forkHost, cloud, region, exactRegion, messages, errors) { + const cloudAndRegion = getCloudAndRegion(cloud, region, exactRegion); return fetch(`${config.apiUrl}/users/${userId}/networks/${planId}/actions/fork/${forkHost}${cloudAndRegion}`, util.putWithAuth()).then(util.handleCrudResponse(messages, errors)); } diff --git a/src/_store/networks.module.js b/src/_store/networks.module.js index e446c73..668ef37 100644 --- a/src/_store/networks.module.js +++ b/src/_store/networks.module.js @@ -51,20 +51,20 @@ const actions = { error => commit('getNetworkByIdFailure', error)); }, - addPlanAndStartNetwork({ commit }, {userId, accountPlan, cloud, region, messages, errors}) { + addPlanAndStartNetwork({ commit }, {userId, accountPlan, cloud, region, exactRegion, messages, errors}) { commit('addPlanAndStartNetworkRequest'); accountPlanService.newAccountPlan(userId, accountPlan, messages, errors) .then( plan => { if (accountPlan.forkHost && accountPlan.forkHost !== '') { - networkService.forkNetwork(userId, plan.name, accountPlan.forkHost, cloud, region, messages, errors) + networkService.forkNetwork(userId, plan.name, accountPlan.forkHost, cloud, exactRegion, region, messages, errors) .then( newNodeNotification => commit('addPlanAndStartNetworkSuccess', newNodeNotification), error => commit('addPlanSuccessStartNetworkFailure', error) ); } else { - networkService.startNetwork(userId, plan.name, cloud, region, messages, errors) + networkService.startNetwork(userId, plan.name, cloud, region, exactRegion, messages, errors) .then( newNodeNotification => commit('addPlanAndStartNetworkSuccess', newNodeNotification), error => commit('addPlanSuccessStartNetworkFailure', error) diff --git a/src/account/NetworkPage.vue b/src/account/NetworkPage.vue index ee74fe1..d509d7f 100644 --- a/src/account/NetworkPage.vue +++ b/src/account/NetworkPage.vue @@ -2,6 +2,9 @@