Compare commits

..

6 Commits

Author SHA1 Message Date
yi-portainer d48980e85b Merge branch 'release/2.5' 2021-05-28 10:22:50 +12:00
yi-portainer 1d46f2bb35 * update portainer version to 2.5.1 2021-05-28 10:21:29 +12:00
yi-portainer 80d3fcc40b Merge branch 'release/2.5' 2021-05-28 10:17:05 +12:00
cong meng ee403ca32a fix(image) Confirmation modal on builder output view EE-816 (#5114)
Co-authored-by: Simon Meng <simon.meng@portainer.io>
2021-05-27 13:52:02 +12:00
fhanportainer d7fcfee2a2 fix(templates): checking windows endpoint and template properties. (#5108)
* fix(templates): checking windows endpoint and template properties.

* fix(templates): removed debug code.

* fix(templates): fixed type issue in custom template.
2021-05-27 08:56:13 +12:00
fhanportainer 6bfbf58cdb fix(template): fixed disabled deploy button EE-812 (#5105) 2021-05-25 18:55:50 +02:00
6 changed files with 46 additions and 8 deletions
+1 -1
View File
@@ -1327,7 +1327,7 @@ type (
const (
// APIVersion is the version number of the Portainer API
APIVersion = "2.5.0"
APIVersion = "2.5.1"
// DBVersion is the version number of the Portainer database
DBVersion = 27
// ComposeSyntaxMaxVersion is a maximum supported version of the docker compose syntax
@@ -79,6 +79,7 @@ angular.module('portainer.docker').controller('BuildImageController', [
Notifications.error('An error occured during build', { msg: 'Please check build logs output' });
} else {
Notifications.success('Image successfully built');
$scope.state.isEditorDirty = false;
}
})
.catch(function error(err) {
@@ -55,7 +55,7 @@
<button
type="button"
class="btn btn-primary btn-sm"
ng-disabled="$ctrl.state.actionInProgress || !$ctrl.formValues.name || $ctrl.state.provider !== $ctrl.template.Type"
ng-disabled="$ctrl.state.actionInProgress || !$ctrl.formValues.name || !$ctrl.state.deployable"
ng-click="$ctrl.createTemplate()"
button-spinner="$ctrl.state.actionInProgress"
>
@@ -64,7 +64,7 @@
</button>
<button type="button" class="btn btn-sm btn-default" ng-click="$ctrl.unselectTemplate($ctrl.template)">Hide</button>
<div class="cols-sm-12 small text-danger" ng-if="$ctrl.state.formValidationError" style="margin-left: 5px; margin-top: 5px;">{{ $ctrl.state.formValidationError }}</div>
<div class="cols-sm-12 small text-danger" ng-if="$ctrl.state.provider !== $ctrl.template.Type" style="margin-left: 5px; margin-top: 5px;"
<div class="cols-sm-12 small text-danger" ng-if="!$ctrl.state.deployable" style="margin-left: 5px; margin-top: 5px;"
>This template type cannot be deployed on this endpoint.</div
>
</div>
@@ -34,13 +34,16 @@ class CustomTemplatesViewController {
this.StateManager = StateManager;
this.StackService = StackService;
this.DOCKER_STANDALONE = 'DOCKER_STANDALONE';
this.DOCKER_SWARM_MODE = 'DOCKER_SWARM_MODE';
this.state = {
selectedTemplate: null,
showAdvancedOptions: false,
formValidationError: '',
actionInProgress: false,
isEditorVisible: false,
provider: 0,
deployable: false,
};
this.currentUser = {
@@ -182,7 +185,8 @@ class CustomTemplatesViewController {
this.formValues.name = template.Title ? template.Title : '';
this.state.selectedTemplate = template;
this.$anchorScroll('view-top');
const applicationState = this.StateManager.getState();
this.state.deployable = this.isDeployable(applicationState.endpoint, template.Type);
const file = await this.CustomTemplateService.customTemplateFile(template.Id);
this.formValues.fileContent = file;
}
@@ -224,6 +228,21 @@ class CustomTemplatesViewController {
this.formValues.fileContent = cm.getValue();
}
isDeployable(endpoint, templateType) {
let deployable = false;
switch (templateType) {
case 1:
deployable = endpoint.mode.provider === this.DOCKER_SWARM_MODE;
break;
case 2:
deployable = endpoint.mode.provider === this.DOCKER_STANDALONE;
break;
}
return deployable;
}
$onInit() {
const applicationState = this.StateManager.getState();
@@ -232,7 +251,6 @@ class CustomTemplatesViewController {
apiVersion,
} = applicationState;
this.state.provider = endpointMode.provider === 'DOCKER_STANDALONE' ? 2 : 1;
this.getTemplates(endpointMode);
this.getNetworks(endpointMode.provider, apiVersion);
@@ -36,6 +36,9 @@ angular.module('portainer.app').controller('TemplatesController', [
StackService,
endpoint
) {
const DOCKER_STANDALONE = 'DOCKER_STANDALONE';
const DOCKER_SWARM_MODE = 'DOCKER_SWARM_MODE';
$scope.state = {
selectedTemplate: null,
showAdvancedOptions: false,
@@ -240,9 +243,26 @@ angular.module('portainer.app').controller('TemplatesController', [
$scope.formValues.name = template.Name ? template.Name : '';
$scope.state.selectedTemplate = template;
$scope.state.deployable = isDeployable($scope.applicationState.endpoint, template.Type);
$anchorScroll('view-top');
};
function isDeployable(endpoint, templateType) {
let deployable = false;
switch (templateType) {
case 1:
deployable = endpoint.mode.provider === DOCKER_SWARM_MODE || endpoint.mode.provider === DOCKER_STANDALONE;
break;
case 2:
deployable = endpoint.mode.provider === DOCKER_SWARM_MODE;
break;
case 3:
deployable = endpoint.mode.provider === DOCKER_STANDALONE;
break;
}
return deployable;
}
function createTemplateConfiguration(template) {
var network = $scope.formValues.network;
var name = $scope.formValues.name;
@@ -254,7 +274,6 @@ angular.module('portainer.app').controller('TemplatesController', [
var endpointMode = $scope.applicationState.endpoint.mode;
var apiVersion = $scope.applicationState.endpoint.apiVersion;
$scope.state.provider = endpointMode.provider === 'DOCKER_STANDALONE' ? 2 : 1;
$q.all({
templates: TemplateService.templates(),
+1 -1
View File
@@ -2,7 +2,7 @@
"author": "Portainer.io",
"name": "portainer",
"homepage": "http://portainer.io",
"version": "2.5.0",
"version": "2.5.1",
"repository": {
"type": "git",
"url": "git@github.com:portainer/portainer.git"