fix(fdo): generate an edgeID when the 'Enforce environment ID' setting is disabled EE-2446 (#6466)
This commit is contained in:
-2
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user