Revision 6daa73a6
Added by Walden Raines about 10 years ago
engines/bastion/app/assets/javascripts/bastion/systems/system-task.factory.js | ||
---|---|---|
angular.module('Bastion.systems').factory('SystemTask',
|
||
['$resource', '$timeout',
|
||
function ($resource, $timeout) {
|
||
var resource = $resource('/api/v2/systems/tasks/:id', {id: '@uuid'}, {
|
||
var resource = $resource('/api/v2/systems/:systemId/tasks/:id', {id: '@uuid', systemId: '@systemId'}, {
|
||
get: {method: 'GET', params: {paged: false}, isArray: false}
|
||
});
|
||
resource.poll = function (task, returnFunction) {
|
||
resource.get({id: task.id}, function (data) {
|
||
resource.get({id: task.id, systemId: task.system.uuid}, function (data) {
|
||
if (data.pending) {
|
||
$timeout(function () {resource.poll(data, returnFunction)}, 1000);
|
||
}
|
Also available in: Unified diff
Fixes #4721 - passing systemId into system tasks calls to match API.