fix(settings): disable save button when revert changes EE-6263 (#10543)

pull/10448/head
cmeng 1 year ago committed by GitHub
parent 6a5f44b5ba
commit 0d56504268
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,3 +1,4 @@
import _ from 'lodash-es';
import angular from 'angular';
import { configureFDO } from '@/portainer/hostmanagement/fdo/fdo.service';
@ -43,7 +44,22 @@ export default function SettingsEdgeComputeController($q, $async, $state, Notifi
function initView() {
$async(async () => {
try {
ctrl.settings = await SettingsService.settings();
const settings = await SettingsService.settings();
const defaultMTLS = {
..._.get(settings, 'Edge.MTLS', {}),
UseSeparateCert: _.get(settings, 'Edge.MTLS.UseSeparateCert', false),
};
ctrl.settings = {
...settings,
EnableEdgeComputeFeatures: !!settings.EnableEdgeComputeFeatures,
EnforceEdgeID: !!settings.EnforceEdgeID,
Edge: {
...settings.Edge,
MTLS: defaultMTLS,
},
};
} catch (err) {
Notifications.error('Failure', err, 'Unable to retrieve application settings');
}

Loading…
Cancel
Save