2021-12-14 09:34:54 +02:00
|
|
|
angular.module('portainer.docker').controller('ContainersController', ContainersController);
|
2018-10-28 10:27:06 +01:00
|
|
|
|
2021-12-14 09:34:54 +02:00
|
|
|
/* @ngInject */
|
|
|
|
function ContainersController($scope, ContainerService, Notifications, endpoint) {
|
|
|
|
$scope.offlineMode = endpoint.Status !== 1;
|
|
|
|
$scope.endpoint = endpoint;
|
2017-12-06 12:04:02 +01:00
|
|
|
|
2021-12-14 09:34:54 +02:00
|
|
|
$scope.getContainers = getContainers;
|
2019-07-22 12:54:59 +02:00
|
|
|
|
2021-12-14 09:34:54 +02:00
|
|
|
function getContainers() {
|
|
|
|
ContainerService.containers(1)
|
|
|
|
.then(function success(data) {
|
|
|
|
$scope.containers = data;
|
|
|
|
})
|
|
|
|
.catch(function error(err) {
|
|
|
|
Notifications.error('Failure', err, 'Unable to retrieve containers');
|
|
|
|
$scope.containers = [];
|
|
|
|
});
|
|
|
|
}
|
2017-06-01 10:14:55 +02:00
|
|
|
|
2021-12-14 09:34:54 +02:00
|
|
|
function initView() {
|
|
|
|
getContainers();
|
|
|
|
}
|
|
|
|
|
|
|
|
initView();
|
|
|
|
}
|