1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-20 22:09:41 +02:00

feat(edge/templates): introduce edge specific settings [EE-6276] (#10609)

This commit is contained in:
Chaim Lev-Ari 2023-11-15 14:43:18 +02:00 committed by GitHub
parent 68950fbb24
commit e43d076269
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 885 additions and 319 deletions

View file

@ -1,4 +1,4 @@
import { EditorType } from '@/react/edge/edge-stacks/types';
import { DeploymentType, EditorType } from '@/react/edge/edge-stacks/types';
import { getValidEditorTypes } from '@/react/edge/edge-stacks/utils';
import { STACK_NAME_VALIDATION_REGEX } from '@/react/constants';
import { confirmWebEditorDiscard } from '@@/modals/confirm';
@ -8,6 +8,8 @@ import { isBE } from '@/react/portainer/feature-flags/feature-flags.service';
import { getCustomTemplate } from '@/react/portainer/templates/custom-templates/queries/useCustomTemplate';
import { notifyError } from '@/portainer/services/notifications';
import { getCustomTemplateFile } from '@/react/portainer/templates/custom-templates/queries/useCustomTemplateFile';
import { toGitFormModel } from '@/react/portainer/gitops/types';
import { StackType } from '@/react/common/stacks/types';
export default class CreateEdgeStackViewController {
/* @ngInject */
@ -71,6 +73,21 @@ export default class CreateEdgeStackViewController {
onChangeTemplate(template) {
return this.$scope.$evalAsync(() => {
this.state.selectedTemplate = template;
this.formValues = {
...this.formValues,
DeploymentType: template.Type === StackType.Kubernetes ? DeploymentType.Kubernetes : DeploymentType.Compose,
...toGitFormModel(template.GitConfig),
...(template.EdgeSettings
? {
PrePullImage: template.EdgeSettings.PrePullImage || false,
RetryDeploy: template.EdgeSettings.RetryDeploy || false,
Registries: template.EdgeSettings.PrivateRegistryId ? [template.EdgeSettings.PrivateRegistryId] : [],
SupportRelativePath: template.EdgeSettings.RelativePathSettings.SupportRelativePath || false,
FilesystemPath: template.EdgeSettings.RelativePathSettings.FilesystemPath || '',
}
: {}),
};
});
}