1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-08 23:35:31 +02:00

refactor(docker/containers): remove EndpointProvider from container service [EE-6180] (#10392)

This commit is contained in:
Chaim Lev-Ari 2023-10-11 10:26:44 +03:00 committed by GitHub
parent b80fcb0467
commit 8e1417b4e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 102 additions and 106 deletions

View file

@ -126,10 +126,10 @@ angular.module('portainer.app').factory('StackService', [
return deferred.promise;
};
service.externalComposeStacks = function () {
service.externalComposeStacks = function (environmentId) {
var deferred = $q.defer();
ContainerService.containers(1)
ContainerService.containers(environmentId, 1)
.then(function success(containers) {
deferred.resolve(StackHelper.getExternalStacksFromContainers(containers));
})
@ -160,7 +160,7 @@ angular.module('portainer.app').factory('StackService', [
$q.all({
stacks: Stack.query({ filters: filters }).$promise,
externalStacks: includeExternalStacks ? service.externalComposeStacks() : [],
externalStacks: includeExternalStacks ? service.externalComposeStacks(endpointId) : [],
})
.then(function success(data) {
var stacks = data.stacks.map(function (item) {

View file

@ -345,7 +345,7 @@ angular
$scope.composeSyntaxMaxVersion = endpoint.ComposeSyntaxMaxVersion;
try {
const containers = await ContainerService.containers(true);
const containers = await ContainerService.containers(endpoint.Id, true);
$scope.containerNames = ContainerHelper.getContainerNames(containers);
} catch (err) {
Notifications.error('Failure', err, 'Unable to retrieve Containers');

View file

@ -332,7 +332,7 @@ angular.module('portainer.app').controller('StackController', [
$q.all({
stack: StackService.stack(id),
groups: GroupService.groups(),
containers: ContainerService.containers(true),
containers: ContainerService.containers(endpoint.Id, true),
})
.then(function success(data) {
var stack = data.stack;
@ -386,7 +386,7 @@ angular.module('portainer.app').controller('StackController', [
return $q.all({
services: ServiceService.services(stackFilter),
tasks: TaskService.tasks(stackFilter),
containers: agentProxy ? ContainerService.containers(1) : [],
containers: agentProxy ? ContainerService.containers(endpoint.Id, 1) : [],
nodes: NodeService.nodes(),
});
}
@ -419,7 +419,7 @@ angular.module('portainer.app').controller('StackController', [
};
return $q.all({
containers: ContainerService.containers(1, stackFilter),
containers: ContainerService.containers(endpoint.Id, 1, stackFilter),
});
}

View file

@ -110,7 +110,7 @@ angular.module('portainer.app').controller('TemplatesController', [
return ImageService.pullImage(template.RegistryModel, true);
})
.then(function success() {
return ContainerService.createAndStartContainer(templateConfiguration);
return ContainerService.createAndStartContainer(endpoint.Id, templateConfiguration);
})
.then(function success(data) {
const resourceControl = data.Portainer.ResourceControl;