mirror of
https://github.com/portainer/portainer.git
synced 2025-07-20 13:59:40 +02:00
chore(kompose): remove from settings [EE-4741] (#8375)
This commit is contained in:
parent
00bbf4ac63
commit
5640cce4d6
25 changed files with 237 additions and 238 deletions
|
@ -1,6 +1,6 @@
|
|||
import { PortainerEndpointTypes } from '@/portainer/models/endpoint/models';
|
||||
import { EditorType } from '@/react/edge/edge-stacks/types';
|
||||
|
||||
import { getValidEditorTypes } from '@/react/edge/edge-stacks/utils';
|
||||
export class EditEdgeStackFormController {
|
||||
/* @ngInject */
|
||||
constructor($scope) {
|
||||
|
@ -57,6 +57,15 @@ export class EditEdgeStackFormController {
|
|||
checkEndpointTypes(groups) {
|
||||
const edgeGroups = groups.map((id) => this.edgeGroups.find((e) => e.Id === id));
|
||||
this.state.endpointTypes = edgeGroups.flatMap((group) => group.EndpointTypes);
|
||||
this.selectValidDeploymentType();
|
||||
}
|
||||
|
||||
selectValidDeploymentType() {
|
||||
const validTypes = getValidEditorTypes(this.state.endpointTypes);
|
||||
|
||||
if (!validTypes.includes(this.model.DeploymentType)) {
|
||||
this.onChangeDeploymentType(validTypes[0]);
|
||||
}
|
||||
}
|
||||
|
||||
removeLineBreaks(value) {
|
||||
|
@ -81,9 +90,10 @@ export class EditEdgeStackFormController {
|
|||
}
|
||||
|
||||
onChangeDeploymentType(deploymentType) {
|
||||
this.model.DeploymentType = deploymentType;
|
||||
|
||||
this.model.StackFileContent = this.fileContents[deploymentType];
|
||||
return this.$scope.$evalAsync(() => {
|
||||
this.model.DeploymentType = deploymentType;
|
||||
this.model.StackFileContent = this.fileContents[deploymentType];
|
||||
});
|
||||
}
|
||||
|
||||
validateEndpointsForDeployment() {
|
||||
|
@ -92,5 +102,6 @@ export class EditEdgeStackFormController {
|
|||
|
||||
$onInit() {
|
||||
this.checkEndpointTypes(this.model.EdgeGroups);
|
||||
this.fileContents[this.model.DeploymentType] = this.model.StackFileContent;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue