1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 07:49:41 +02:00

feat(global): introduce user teams and new UAC system (#868)

This commit is contained in:
Anthony Lapenna 2017-05-23 20:56:10 +02:00 committed by GitHub
parent a380fd9adc
commit 5523fc9023
160 changed files with 7112 additions and 3166 deletions

View file

@ -1,29 +1,26 @@
angular.module('task', [])
.controller('TaskController', ['$scope', '$stateParams', '$state', 'Task', 'Service', 'Notifications',
function ($scope, $stateParams, $state, Task, Service, Notifications) {
.controller('TaskController', ['$scope', '$stateParams', 'TaskService', 'Service', 'Notifications',
function ($scope, $stateParams, TaskService, Service, Notifications) {
$scope.task = {};
$scope.serviceName = 'service';
$scope.isTaskRunning = false;
function fetchTaskDetails() {
function initView() {
$('#loadingViewSpinner').show();
Task.get({id: $stateParams.id}, function (d) {
$scope.task = d;
fetchAssociatedServiceDetails(d.ServiceID);
TaskService.task($stateParams.id)
.then(function success(data) {
var task = data;
$scope.task = task;
return Service.get({ id: task.ServiceId }).$promise;
})
.then(function success(data) {
var service = new ServiceViewModel(data);
$scope.service = service;
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to retrieve task details');
})
.finally(function final() {
$('#loadingViewSpinner').hide();
}, function (e) {
Notifications.error("Failure", e, "Unable to retrieve task details");
});
}
function fetchAssociatedServiceDetails(serviceId) {
Service.get({id: serviceId}, function (d) {
$scope.serviceName = d.Spec.Name;
}, function (e) {
Notifications.error("Failure", e, "Unable to retrieve associated service details");
});
}
fetchTaskDetails();
initView();
}]);