mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 16:47:45 -02:30
Fixed missing host and status values on Job Events page.
This commit is contained in:
@@ -40,6 +40,7 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
set[i]['level'] = 0;
|
set[i]['level'] = 0;
|
||||||
set[i]['spaces'] = 0;
|
set[i]['spaces'] = 0;
|
||||||
}
|
}
|
||||||
|
scope.jobevents[i].status = (scope.jobevents[i].failed) ? 'error' : 'success';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -58,18 +59,6 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
|
|
||||||
LoadBreadCrumbs();
|
LoadBreadCrumbs();
|
||||||
|
|
||||||
if (scope.PostRefreshRemove) {
|
|
||||||
scope.PostRefreshRemove();
|
|
||||||
}
|
|
||||||
scope.PostRefreshRemove = scope.$on('PostRefresh', function() {
|
|
||||||
for (var i=0; i < scope.jobevents.length; i++) {
|
|
||||||
scope.jobevents[i].status = (scope.jobevents[i].failed) ? 'error' : 'success';
|
|
||||||
if (scope.jobevents[i].host !== null) {
|
|
||||||
scope.jobevents[i].host_name = scope.jobevents[i].summary_fields.host.name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
scope.editJobEvent = function(id) {
|
scope.editJobEvent = function(id) {
|
||||||
$location.path($location.path() + '/' + id);
|
$location.path($location.path() + '/' + id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,9 +62,7 @@ function JobsListCtrl ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
Rest.setUrl(defaultUrl + id + '/');
|
Rest.setUrl(defaultUrl + id + '/');
|
||||||
Rest.get()
|
Rest.get()
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
|
|
||||||
var url, action_label, restcall, hdr;
|
var url, action_label, restcall, hdr;
|
||||||
|
|
||||||
if (data.status == 'pending' || data.status == 'running') {
|
if (data.status == 'pending' || data.status == 'running') {
|
||||||
url = data.related.cancel;
|
url = data.related.cancel;
|
||||||
action_label = 'cancel';
|
action_label = 'cancel';
|
||||||
@@ -80,34 +78,35 @@ function JobsListCtrl ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
if (action_label == 'cancel') {
|
if (action_label == 'cancel') {
|
||||||
Rest.post()
|
Rest.post()
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
scope.search(list.iterator);
|
scope.search(list.iterator);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
ProcessErrors(scope, data, status, null,
|
ProcessErrors(scope, data, status, null,
|
||||||
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. POST returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. POST returned status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success( function(data, status, headers, config) {
|
.success( function(data, status, headers, config) {
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
scope.search(list.iterator);
|
scope.search(list.iterator);
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
$('#prompt-modal').modal('hide');
|
$('#prompt-modal').modal('hide');
|
||||||
ProcessErrors(scope, data, status, null,
|
ProcessErrors(scope, data, status, null,
|
||||||
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Prompt({ hdr: hdr,
|
Prompt({
|
||||||
body: 'Are you sure you want to ' + action_label + ' job ' + id + '?',
|
hdr: hdr,
|
||||||
action: action
|
body: 'Are you sure you want to ' + action_label + ' job ' + id + '?',
|
||||||
});
|
action: action
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.error( function(data, status, headers, config) {
|
.error( function(data, status, headers, config) {
|
||||||
ProcessErrors(scope, data, status, null,
|
ProcessErrors(scope, data, status, null,
|
||||||
|
|||||||
@@ -43,9 +43,7 @@ angular.module('ChildrenHelper', ['RestServices', 'Utilities'])
|
|||||||
for (var j=0; j < data.results.length; j++) {
|
for (var j=0; j < data.results.length; j++) {
|
||||||
data.results[j].level = level;
|
data.results[j].level = level;
|
||||||
data.results[j].spaces = spaces;
|
data.results[j].spaces = spaces;
|
||||||
//if (data.results[j].related.children === undefined) {
|
data.results[j].status = (data.results[j].failed) ? 'error' : 'success';
|
||||||
// data.results[j].spaces += 12
|
|
||||||
//}
|
|
||||||
data.results[j].event_display = data.results[j].event_display.replace(/^\u00a0*/g,'');
|
data.results[j].event_display = data.results[j].event_display.replace(/^\u00a0*/g,'');
|
||||||
if (data.results[j].related.children) {
|
if (data.results[j].related.children) {
|
||||||
data.results[j]['ngclick'] = "toggleChildren(" + data.results[j].id + ", \"" + data.results[j].related.children + "\")";
|
data.results[j]['ngclick'] = "toggleChildren(" + data.results[j].id + ", \"" + data.results[j].related.children + "\")";
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ angular.module('JobEventsListDefinition', [])
|
|||||||
host: {
|
host: {
|
||||||
label: 'Host',
|
label: 'Host',
|
||||||
ngClick: "viewHost(\{\{ jobevent.host \}\})",
|
ngClick: "viewHost(\{\{ jobevent.host \}\})",
|
||||||
ngBind: 'jobevent.host_name',
|
ngBind: 'jobevent.summary_fields.host.name',
|
||||||
sourceModel: 'host',
|
sourceModel: 'host',
|
||||||
sourceField: 'name',
|
sourceField: 'name',
|
||||||
searchField: 'hosts__name',
|
searchField: 'hosts__name',
|
||||||
|
|||||||
Reference in New Issue
Block a user