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