2018-02-01 12:27:52 +00:00
|
|
|
angular.module('portainer.docker')
|
2018-10-28 09:27:06 +00:00
|
|
|
.controller('ContainersController', ['$scope', 'ContainerService', 'Notifications', 'EndpointProvider',
|
|
|
|
function ($scope, ContainerService, Notifications, EndpointProvider) {
|
|
|
|
|
|
|
|
$scope.offlineMode = false;
|
2017-12-06 11:04:02 +00:00
|
|
|
|
2019-07-22 10:54:59 +00:00
|
|
|
$scope.getContainers = getContainers;
|
|
|
|
|
|
|
|
function getContainers() {
|
2018-04-04 00:31:04 +00:00
|
|
|
ContainerService.containers(1)
|
2017-06-20 11:00:32 +00:00
|
|
|
.then(function success(data) {
|
2018-06-11 13:13:19 +00:00
|
|
|
$scope.containers = data;
|
2018-10-28 09:27:06 +00:00
|
|
|
$scope.offlineMode = EndpointProvider.offlineMode();
|
2017-06-20 11:00:32 +00:00
|
|
|
})
|
|
|
|
.catch(function error(err) {
|
2017-12-06 11:04:02 +00:00
|
|
|
Notifications.error('Failure', err, 'Unable to retrieve containers');
|
|
|
|
$scope.containers = [];
|
2017-06-20 11:00:32 +00:00
|
|
|
});
|
2017-06-01 08:14:55 +00:00
|
|
|
}
|
|
|
|
|
2019-07-22 10:54:59 +00:00
|
|
|
function initView() {
|
|
|
|
getContainers();
|
|
|
|
}
|
|
|
|
|
2017-06-01 08:14:55 +00:00
|
|
|
initView();
|
2016-06-02 05:34:03 +00:00
|
|
|
}]);
|