2021-12-14 07:34:54 +00:00
|
|
|
angular.module('portainer.docker').controller('ContainersController', ContainersController);
|
2018-10-28 09:27:06 +00:00
|
|
|
|
2021-12-14 07:34:54 +00:00
|
|
|
/* @ngInject */
|
|
|
|
function ContainersController($scope, ContainerService, Notifications, endpoint) {
|
|
|
|
$scope.offlineMode = endpoint.Status !== 1;
|
|
|
|
$scope.endpoint = endpoint;
|
2017-12-06 11:04:02 +00:00
|
|
|
|
2021-12-14 07:34:54 +00:00
|
|
|
$scope.getContainers = getContainers;
|
2019-07-22 10:54:59 +00:00
|
|
|
|
2021-12-14 07:34:54 +00: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 08:14:55 +00:00
|
|
|
|
2021-12-14 07:34:54 +00:00
|
|
|
function initView() {
|
|
|
|
getContainers();
|
|
|
|
}
|
|
|
|
|
|
|
|
initView();
|
|
|
|
}
|