mirror of
https://github.com/ansible/awx.git
synced 2026-03-23 20:05:03 -02:30
error handling for job-result route
for when there are no job_events for a job
This commit is contained in:
@@ -1,91 +1,91 @@
|
|||||||
<<<<<<< 4cf6a946a1aa14b7d64a8e1e8dabecfd3d056f27
|
// <<<<<<< 4cf6a946a1aa14b7d64a8e1e8dabecfd3d056f27
|
||||||
//<<<<<<< bc59236851902d7c768aa26abdb7dc9c9dc27a5a
|
// //<<<<<<< bc59236851902d7c768aa26abdb7dc9c9dc27a5a
|
||||||
/*************************************************
|
|
||||||
* Copyright (c) 2016 Ansible, Inc.
|
|
||||||
*
|
|
||||||
* All Rights Reserved
|
|
||||||
*************************************************/
|
|
||||||
|
|
||||||
// <<<<<<< a3d9eea2c9ddb4e16deec9ec38dea16bf37c559d
|
|
||||||
// import { templateUrl } from '../shared/template-url/template-url.factory';
|
|
||||||
//
|
|
||||||
// export default {
|
|
||||||
// name: 'jobDetail',
|
|
||||||
// url: '/jobs/{id: int}',
|
|
||||||
// ncyBreadcrumb: {
|
|
||||||
// parent: 'jobs',
|
|
||||||
// label: "{{ job.id }} - {{ job.name }}"
|
|
||||||
// },
|
|
||||||
// data: {
|
|
||||||
// socket: {
|
|
||||||
// "groups": {
|
|
||||||
// "jobs": ["status_changed", "summary"],
|
|
||||||
// "job_events": []
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// templateUrl: templateUrl('job-detail/job-detail'),
|
|
||||||
// controller: 'JobDetailController'
|
|
||||||
// };
|
|
||||||
// =======
|
|
||||||
// import {templateUrl} from '../shared/template-url/template-url.factory';
|
|
||||||
//
|
|
||||||
// export default {
|
|
||||||
// name: 'jobDetail',
|
|
||||||
// url: '/jobs/:id',
|
|
||||||
// ncyBreadcrumb: {
|
|
||||||
// parent: 'jobs',
|
|
||||||
// label: "{{ job.id }} - {{ job.name }}"
|
|
||||||
// },
|
|
||||||
// socket: {
|
|
||||||
// "groups":{
|
|
||||||
// "jobs": ["status_changed", "summary"],
|
|
||||||
// "job_events": []
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// templateUrl: templateUrl('job-detail/job-detail'),
|
|
||||||
// controller: 'JobDetailController'
|
|
||||||
// };
|
|
||||||
//=======
|
|
||||||
=======
|
|
||||||
>>>>>>> Rebase of devel (w/ channels) + socket rework for new job details
|
|
||||||
// /*************************************************
|
// /*************************************************
|
||||||
// * Copyright (c) 2016 Ansible, Inc.
|
// * Copyright (c) 2016 Ansible, Inc.
|
||||||
// *
|
// *
|
||||||
// * All Rights Reserved
|
// * All Rights Reserved
|
||||||
// *************************************************/
|
// *************************************************/
|
||||||
//
|
//
|
||||||
// import {templateUrl} from '../shared/template-url/template-url.factory';
|
// // <<<<<<< a3d9eea2c9ddb4e16deec9ec38dea16bf37c559d
|
||||||
//
|
// // import { templateUrl } from '../shared/template-url/template-url.factory';
|
||||||
// export default {
|
// //
|
||||||
// name: 'jobDetail',
|
// // export default {
|
||||||
// url: '/jobs/:id',
|
// // name: 'jobDetail',
|
||||||
// ncyBreadcrumb: {
|
// // url: '/jobs/{id: int}',
|
||||||
// parent: 'jobs',
|
// // ncyBreadcrumb: {
|
||||||
// label: "{{ job.id }} - {{ job.name }}"
|
// // parent: 'jobs',
|
||||||
// },
|
// // label: "{{ job.id }} - {{ job.name }}"
|
||||||
// socket: {
|
// // },
|
||||||
// "groups":{
|
// // data: {
|
||||||
// "jobs": ["status_changed", "summary"],
|
// // socket: {
|
||||||
// "job_events": []
|
// // "groups": {
|
||||||
// }
|
// // "jobs": ["status_changed", "summary"],
|
||||||
// },
|
// // "job_events": []
|
||||||
// resolve: {
|
// // }
|
||||||
// jobEventsSocket: ['Socket', '$rootScope', function(Socket, $rootScope) {
|
// // }
|
||||||
// if (!$rootScope.event_socket) {
|
// // },
|
||||||
// $rootScope.event_socket = Socket({
|
// // templateUrl: templateUrl('job-detail/job-detail'),
|
||||||
// scope: $rootScope,
|
// // controller: 'JobDetailController'
|
||||||
// endpoint: "job_events"
|
// // };
|
||||||
// });
|
// // =======
|
||||||
// $rootScope.event_socket.init();
|
// // import {templateUrl} from '../shared/template-url/template-url.factory';
|
||||||
// // returns should really be providing $rootScope.event_socket
|
// //
|
||||||
// // otherwise, we have to inject the entire $rootScope into the controller
|
// // export default {
|
||||||
// return true;
|
// // name: 'jobDetail',
|
||||||
// } else {
|
// // url: '/jobs/:id',
|
||||||
// return true;
|
// // ncyBreadcrumb: {
|
||||||
// }
|
// // parent: 'jobs',
|
||||||
// }]
|
// // label: "{{ job.id }} - {{ job.name }}"
|
||||||
// },
|
// // },
|
||||||
// templateUrl: templateUrl('job-detail/job-detail'),
|
// // socket: {
|
||||||
// controller: 'JobDetailController'
|
// // "groups":{
|
||||||
// };
|
// // "jobs": ["status_changed", "summary"],
|
||||||
|
// // "job_events": []
|
||||||
|
// // }
|
||||||
|
// // },
|
||||||
|
// // templateUrl: templateUrl('job-detail/job-detail'),
|
||||||
|
// // controller: 'JobDetailController'
|
||||||
|
// // };
|
||||||
|
// //=======
|
||||||
|
// =======
|
||||||
|
// >>>>>>> Rebase of devel (w/ channels) + socket rework for new job details
|
||||||
|
// // /*************************************************
|
||||||
|
// // * Copyright (c) 2016 Ansible, Inc.
|
||||||
|
// // *
|
||||||
|
// // * All Rights Reserved
|
||||||
|
// // *************************************************/
|
||||||
|
// //
|
||||||
|
// // import {templateUrl} from '../shared/template-url/template-url.factory';
|
||||||
|
// //
|
||||||
|
// // export default {
|
||||||
|
// // name: 'jobDetail',
|
||||||
|
// // url: '/jobs/:id',
|
||||||
|
// // ncyBreadcrumb: {
|
||||||
|
// // parent: 'jobs',
|
||||||
|
// // label: "{{ job.id }} - {{ job.name }}"
|
||||||
|
// // },
|
||||||
|
// // socket: {
|
||||||
|
// // "groups":{
|
||||||
|
// // "jobs": ["status_changed", "summary"],
|
||||||
|
// // "job_events": []
|
||||||
|
// // }
|
||||||
|
// // },
|
||||||
|
// // resolve: {
|
||||||
|
// // jobEventsSocket: ['Socket', '$rootScope', function(Socket, $rootScope) {
|
||||||
|
// // if (!$rootScope.event_socket) {
|
||||||
|
// // $rootScope.event_socket = Socket({
|
||||||
|
// // scope: $rootScope,
|
||||||
|
// // endpoint: "job_events"
|
||||||
|
// // });
|
||||||
|
// // $rootScope.event_socket.init();
|
||||||
|
// // // returns should really be providing $rootScope.event_socket
|
||||||
|
// // // otherwise, we have to inject the entire $rootScope into the controller
|
||||||
|
// // return true;
|
||||||
|
// // } else {
|
||||||
|
// // return true;
|
||||||
|
// // }
|
||||||
|
// // }]
|
||||||
|
// // },
|
||||||
|
// // templateUrl: templateUrl('job-detail/job-detail'),
|
||||||
|
// // controller: 'JobDetailController'
|
||||||
|
// // };
|
||||||
|
|||||||
@@ -55,11 +55,22 @@ export default {
|
|||||||
// "?event=playbook_on_stats");
|
// "?event=playbook_on_stats");
|
||||||
Rest.get()
|
Rest.get()
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
defer.resolve({
|
if(!data.results[0]){
|
||||||
val: jobResultsService
|
defer.resolve({val: {
|
||||||
.getCountsFromStatsEvent(data
|
ok: 0,
|
||||||
.results[0].event_data),
|
skipped: 0,
|
||||||
countFinished: true});
|
unreachable: 0,
|
||||||
|
failures: 0,
|
||||||
|
changed: 0
|
||||||
|
}, countFinished: false});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
defer.resolve({
|
||||||
|
val: jobResultsService
|
||||||
|
.getCountsFromStatsEvent(data
|
||||||
|
.results[0].event_data),
|
||||||
|
countFinished: true});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.error(function() {
|
.error(function() {
|
||||||
defer.resolve({val: {
|
defer.resolve({val: {
|
||||||
|
|||||||
Reference in New Issue
Block a user