mirror of
https://github.com/ansible/awx.git
synced 2026-05-06 08:57:35 -02:30
Merge pull request #2083 from leigh-johnson/JobDetailFilters
Fix Job Details play/task/host filters
This commit is contained in:
@@ -784,7 +784,6 @@ export default
|
|||||||
url, play;
|
url, play;
|
||||||
|
|
||||||
scope.tasks = [];
|
scope.tasks = [];
|
||||||
|
|
||||||
if (scope.selectedPlay) {
|
if (scope.selectedPlay) {
|
||||||
url = scope.job.url + 'job_tasks/?event_id=' + scope.selectedPlay;
|
url = scope.job.url + 'job_tasks/?event_id=' + scope.selectedPlay;
|
||||||
url += (scope.search_task_name) ? '&task__icontains=' + scope.search_task_name : '';
|
url += (scope.search_task_name) ? '&task__icontains=' + scope.search_task_name : '';
|
||||||
@@ -912,16 +911,25 @@ export default
|
|||||||
scope.tasks[idx].taskActiveClass = '';
|
scope.tasks[idx].taskActiveClass = '';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
params = {
|
if (scope.selectedTask !== null){
|
||||||
parent: scope.selectedTask,
|
params = {
|
||||||
event__startswith: 'runner',
|
parent: scope.selectedTask,
|
||||||
page_size: scope.hostResultsMaxRows,
|
event__startswith: 'runner',
|
||||||
order: 'host_name,counter',
|
page_size: scope.hostResultsMaxRows,
|
||||||
};
|
order: 'host_name,counter',
|
||||||
JobDetailService.getRelatedJobEvents(scope.job.id, params).success(function(res){
|
};
|
||||||
scope.hostResults = JobDetailService.processHostEvents(res.results);
|
if (scope.search_host_status === 'failed'){
|
||||||
|
params.failed = true;
|
||||||
|
}
|
||||||
|
JobDetailService.getRelatedJobEvents(scope.job.id, params).success(function(res){
|
||||||
|
scope.hostResults = JobDetailService.processHostEvents(res.results);
|
||||||
|
scope.hostResultsLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
scope.hostResults = [];
|
||||||
scope.hostResultsLoading = false;
|
scope.hostResultsLoading = false;
|
||||||
});
|
}
|
||||||
};
|
};
|
||||||
}])
|
}])
|
||||||
|
|
||||||
|
|||||||
@@ -758,6 +758,15 @@ export default
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
scope.filterTaskStatus = function() {
|
||||||
|
scope.search_task_status = (scope.search_task_status === 'all') ? 'failed' : 'all';
|
||||||
|
if (!scope.liveEventProcessing || scope.pauseLiveEvents) {
|
||||||
|
LoadTasks({
|
||||||
|
scope: scope
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
scope.filterPlayStatus = function() {
|
scope.filterPlayStatus = function() {
|
||||||
scope.search_play_status = (scope.search_play_status === 'all') ? 'failed' : 'all';
|
scope.search_play_status = (scope.search_play_status === 'all') ? 'failed' : 'all';
|
||||||
if (!scope.liveEventProcessing || scope.pauseLiveEvents) {
|
if (!scope.liveEventProcessing || scope.pauseLiveEvents) {
|
||||||
@@ -767,6 +776,26 @@ export default
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
scope.filterHostStatus = function(){
|
||||||
|
scope.search_host_status = (scope.search_host_status === 'all') ? 'failed' : 'all';
|
||||||
|
if (!scope.liveEventProcessing || scope.pauseLiveEvents){
|
||||||
|
if (scope.selectedTask !== null && scope.selectedPlay !== null){
|
||||||
|
var params = {
|
||||||
|
parent: scope.selectedTask,
|
||||||
|
page_size: scope.hostResultsMaxRows,
|
||||||
|
order: 'host_name,counter',
|
||||||
|
};
|
||||||
|
if (scope.search_host_status === 'failed'){
|
||||||
|
params.failed = true;
|
||||||
|
}
|
||||||
|
JobDetailService.getRelatedJobEvents(scope.job.id, params).success(function(res){
|
||||||
|
scope.hostResults = JobDetailService.processHostEvents(res.results);
|
||||||
|
scope.hostResultsLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
scope.searchPlays = function() {
|
scope.searchPlays = function() {
|
||||||
if (scope.search_play_name) {
|
if (scope.search_play_name) {
|
||||||
scope.searchPlaysEnabled = false;
|
scope.searchPlaysEnabled = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user