2020-04-10 21:54:53 +00:00
|
|
|
angular.module('portainer.docker').controller('TaskController', [
|
|
|
|
'$scope',
|
|
|
|
'$transition$',
|
|
|
|
'TaskService',
|
|
|
|
'ServiceService',
|
|
|
|
'Notifications',
|
|
|
|
function ($scope, $transition$, TaskService, ServiceService, Notifications) {
|
|
|
|
function initView() {
|
|
|
|
TaskService.task($transition$.params().id)
|
|
|
|
.then(function success(data) {
|
|
|
|
var task = data;
|
|
|
|
$scope.task = task;
|
|
|
|
return ServiceService.service(task.ServiceId);
|
|
|
|
})
|
|
|
|
.then(function success(data) {
|
|
|
|
var service = data;
|
|
|
|
$scope.service = service;
|
|
|
|
})
|
|
|
|
.catch(function error(err) {
|
|
|
|
Notifications.error('Failure', err, 'Unable to retrieve task details');
|
|
|
|
});
|
|
|
|
}
|
2016-09-23 04:54:58 +00:00
|
|
|
|
2020-04-10 21:54:53 +00:00
|
|
|
initView();
|
|
|
|
},
|
|
|
|
]);
|