1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

AC-175 In certain cases override event_display with values found in event_data such as name and res.msg. Also, replacye 'Playbook On Stats' with 'Play Recap' and actual stats.

This commit is contained in:
chouseknecht 2013-07-01 11:52:00 -04:00
parent 689765c587
commit 5ead7b7ec4
2 changed files with 27 additions and 6 deletions

View File

@ -28,7 +28,7 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
$rootScope.flashMessage = null;
scope.selected = [];
scope.expand = true; //on load, automatically expand all nodes
scope.parentNode = 'parent-event'; // used in ngClass to dynamicall set row level class and control
scope.childNode = 'child-event'; // link color and cursor
@ -48,6 +48,9 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
set[i]['level'] = 0;
set[i]['spaces'] = 0;
set[i]['class'] = 'parentNode';
if (set[i]['event_data']['name']) {
set[i]['event_display'] = set[i]['event_data']['name'];
}
}
scope.jobevents[i].status = (scope.jobevents[i].failed) ? 'error' : 'success';
cDate = new Date(set[i].created);
@ -66,11 +69,11 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
if (set[i]['related']['children'] && (set[i]['ngicon'] == undefined || set[i]['ngicon'] == 'icon-expand-alt')) {
found = true;
ToggleChildren({
scope: scope,
list: list,
id: set[i].id,
children: set[i]['related']['children']
});
scope: scope,
list: list,
id: set[i].id,
children: set[i]['related']['children']
});
}
}
if (found == false) {

View File

@ -59,6 +59,24 @@ angular.module('ChildrenHelper', ['RestServices', 'Utilities'])
else {
data.results[j]['class'] = 'childNode';
}
if (data.results[j]['event_data']['name']) {
// Display the actual task name
data.results[j]['event_display'] = data.results[j]['event_data']['name'];
}
if (data.results[j]['event_data']['res'] && data.results[j]['event_data']['res']['msg']) {
// Display the actual result message
data.results[j]['event_display'] = data.results[j]['event_data']['res']['msg'];
}
if (data.results[j]['event'] == 'playbook_on_stats') {
data.results[j]['event_display'] = 'Play Recap ****** ';
for (var key in data.results[j]['event_data']) {
var count = 0;
for (var itm in data.results[j]['event_data'][key]) {
count += data.results[j]['event_data'][key][itm];
}
data.results[j]['event_display'] += key + ": " + count + " ";
}
}
if (clicked == (set.length - 1)) {
set.push(data.results[j]);
}