From 8b4a74f06e2150ea9d064cad220c448c627009d9 Mon Sep 17 00:00:00 2001 From: andres-portainer <91705312+andres-portainer@users.noreply.github.com> Date: Tue, 25 Jan 2022 15:25:27 -0300 Subject: [PATCH] fix(fdo): generate an edgeID when the 'Enforce environment ID' setting is disabled EE-2446 (#6465) --- .../FDOProfilesDatatable/FDOProfilesDatatableActions.tsx | 2 -- app/portainer/views/devices/import/importDeviceController.js | 4 +++- app/portainer/views/endpoints/edit/endpointController.js | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatableActions.tsx b/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatableActions.tsx index 5ac8c7276..4bf77564c 100644 --- a/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatableActions.tsx +++ b/app/portainer/settings/edge-compute/FDOProfilesDatatable/FDOProfilesDatatableActions.tsx @@ -70,13 +70,11 @@ export function FDOProfilesDatatableActions({ try { const profile = selectedItems[0]; const newProfile = await duplicateProfile(profile.id); - console.log({ newProfile }); notifications.success('Profile successfully duplicated', profile.name); router.stateService.go('portainer.endpoints.profile.edit', { id: newProfile.id, }); } catch (err) { - console.log(err); notifications.error( 'Failure', err as Error, diff --git a/app/portainer/views/devices/import/importDeviceController.js b/app/portainer/views/devices/import/importDeviceController.js index 68b174b8d..fb44d5ac0 100644 --- a/app/portainer/views/devices/import/importDeviceController.js +++ b/app/portainer/views/devices/import/importDeviceController.js @@ -1,3 +1,5 @@ +import uuidv4 from 'uuid/v4'; + import { PortainerEndpointCreationTypes } from 'Portainer/models/endpoint/models'; import { configureDevice, getProfiles } from 'Portainer/hostmanagement/fdo/fdo.service'; @@ -98,7 +100,7 @@ angular suffix++; const config = { - edgeID: endpoint.EdgeID, + edgeID: endpoint.EdgeID || uuidv4(), edgeKey: endpoint.EdgeKey, name: $scope.formValues.DeviceName, profile: $scope.formValues.DeviceProfile, diff --git a/app/portainer/views/endpoints/edit/endpointController.js b/app/portainer/views/endpoints/edit/endpointController.js index 3687d6f3b..52dc6a7e0 100644 --- a/app/portainer/views/endpoints/edit/endpointController.js +++ b/app/portainer/views/endpoints/edit/endpointController.js @@ -297,11 +297,9 @@ function EndpointController( try { $scope.endpoint.ManagementInfo = JSON.parse(amtInfo.RawOutput); } catch (err) { - console.log('Failure', err, 'Unable to JSON parse AMT info: ' + amtInfo.RawOutput); clearAMTManagementInfo(amtInfo.RawOutput); } } catch (err) { - console.log('Failure', err); clearAMTManagementInfo('Unable to retrieve AMT environment details'); } }