feat(app): push pull templates create stacks

pull/3393/head
xAt0mZ 2019-11-22 01:13:55 +01:00
parent 51d9b2b9ec
commit 213592e97c
1 changed files with 3 additions and 5 deletions

View File

@ -94,7 +94,6 @@ function ($scope, $q, $state, $transition$, $anchorScroll, ContainerService, Ima
});
}
// TODO CHANGE
function createComposeStackFromTemplate(template, userId, accessControlData) {
var stackName = $scope.formValues.name;
@ -113,7 +112,7 @@ function ($scope, $q, $state, $transition$, $anchorScroll, ContainerService, Ima
var endpointId = EndpointProvider.endpointID();
StackService.createComposeStackFromGitRepository(stackName, repositoryOptions, template.Env, endpointId)
.then(function success(data) {
const resourceControl = data.Portainer.ResourceControl;
const resourceControl = data.ResourceControl;
return ResourceControlService.applyResourceControl(userId, accessControlData, resourceControl);
})
.then(function success() {
@ -128,7 +127,6 @@ function ($scope, $q, $state, $transition$, $anchorScroll, ContainerService, Ima
});
}
// TODO CHANGE
function createStackFromTemplate(template, userId, accessControlData) {
var stackName = $scope.formValues.name;
var env =_.filter(
@ -152,7 +150,7 @@ function ($scope, $q, $state, $transition$, $anchorScroll, ContainerService, Ima
var endpointId = EndpointProvider.endpointID();
StackService.createSwarmStackFromGitRepository(stackName, repositoryOptions, env, endpointId)
.then(function success(data) {
const resourceControl = data.Portainer.ResourceControl;
const resourceControl = data.ResourceControl;
return ResourceControlService.applyResourceControl(userId, accessControlData, resourceControl);
})
.then(function success() {
@ -160,7 +158,7 @@ function ($scope, $q, $state, $transition$, $anchorScroll, ContainerService, Ima
$state.go('portainer.stacks');
})
.catch(function error(err) {
Notifications.warning('Deployment error', err.err.data.err);
Notifications.warning('Deployment error', err.data.err);
})
.finally(function final() {
$scope.state.actionInProgress = false;