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:
parent
b80fcb0467
commit
8e1417b4e9
20 changed files with 102 additions and 106 deletions
|
@ -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) {
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue