mirror of
https://github.com/ansible/awx.git
synced 2026-04-07 19:19:20 -02:30
Link from Inventories tab, hosts, Failed events now redirects to /jobs/N/job_events?host=<host_name>, displaying most recent job events for the host.
This commit is contained in:
@@ -417,6 +417,20 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
||||
HostsDelete({ scope: scope, "inventory_id": id, group_id: scope.group_id, host_id: host_id, host_name: host_name });
|
||||
}
|
||||
|
||||
scope.showEvents = function(host_name, last_job) {
|
||||
// When click on !Failed Events link, redirect to latest job/job_events for the host
|
||||
Rest.setUrl(last_job);
|
||||
Rest.get()
|
||||
.success( function(data, status, headers, config) {
|
||||
LoadBreadCrumbs({ path: '/jobs/' + data.id, title: data.name });
|
||||
$location.url('/jobs/' + data.id + '/job_events/?host=' + escape(host_name));
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
ProcessErrors(scope, data, status, form,
|
||||
{ hdr: 'Error!', msg: 'Failed to lookup last job: ' + last_job + '. GET status: ' + status });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
InventoriesEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm',
|
||||
|
||||
@@ -46,8 +46,16 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
||||
|
||||
SearchInit({ scope: scope, set: 'jobevents', list: list, url: defaultUrl });
|
||||
PaginateInit({ scope: scope, list: list, url: defaultUrl });
|
||||
scope.search(list.iterator);
|
||||
|
||||
// Called from Inventories tab host failed events link:
|
||||
if ($routeParams.host) {
|
||||
scope[list.iterator + 'SearchField'] = 'host';
|
||||
scope[list.iterator + 'SearchValue'] = $routeParams.host;
|
||||
scope[list.iterator + 'SearchFieldLabel'] = list.fields['host'].label;
|
||||
}
|
||||
|
||||
scope.search(list.iterator);
|
||||
|
||||
scope.toggleChildren = function(id, children) {
|
||||
ToggleChildren({
|
||||
scope: scope,
|
||||
|
||||
Reference in New Issue
Block a user