2018-02-01 12:27:52 +00:00
|
|
|
angular.module('portainer.docker')
|
2018-02-28 06:19:28 +00:00
|
|
|
.controller('TaskController', ['$scope', '$transition$', 'TaskService', 'ServiceService', 'Notifications',
|
|
|
|
function ($scope, $transition$, TaskService, ServiceService, Notifications) {
|
2016-09-23 04:54:58 +00:00
|
|
|
|
2017-05-23 18:56:10 +00:00
|
|
|
function initView() {
|
2017-09-21 14:00:53 +00:00
|
|
|
TaskService.task($transition$.params().id)
|
2017-05-23 18:56:10 +00:00
|
|
|
.then(function success(data) {
|
|
|
|
var task = data;
|
|
|
|
$scope.task = task;
|
2018-02-28 06:19:28 +00:00
|
|
|
return ServiceService.service(task.ServiceId);
|
2017-05-23 18:56:10 +00:00
|
|
|
})
|
|
|
|
.then(function success(data) {
|
2018-02-28 06:19:28 +00:00
|
|
|
var service = data;
|
2017-05-23 18:56:10 +00:00
|
|
|
$scope.service = service;
|
|
|
|
})
|
|
|
|
.catch(function error(err) {
|
|
|
|
Notifications.error('Failure', err, 'Unable to retrieve task details');
|
2016-09-23 04:54:58 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-05-23 18:56:10 +00:00
|
|
|
initView();
|
2016-09-23 04:54:58 +00:00
|
|
|
}]);
|