mirror of
https://github.com/ansible/awx.git
synced 2026-03-28 14:25:05 -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:
@@ -295,12 +295,18 @@
|
|||||||
|
|
||||||
.job-error, .job-failed,
|
.job-error, .job-failed,
|
||||||
.active-failures-true,
|
.active-failures-true,
|
||||||
|
.active-failures-true a,
|
||||||
|
.active-failures-true a:active,
|
||||||
input[type="text"].job-failed,
|
input[type="text"].job-failed,
|
||||||
input[type="text"].job-error
|
input[type="text"].job-error
|
||||||
{
|
{
|
||||||
color: #da4f49;
|
color: #da4f49;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.active-failures-true a:hover {
|
||||||
|
color: #FF0000;
|
||||||
|
}
|
||||||
|
|
||||||
.job-new, input[type="text"].job-new,
|
.job-new, input[type="text"].job-new,
|
||||||
.job-canceled, input[type="text"].job-canceled {
|
.job-canceled, input[type="text"].job-canceled {
|
||||||
color: #778899;
|
color: #778899;
|
||||||
@@ -443,6 +449,11 @@
|
|||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tr td button i {
|
||||||
|
margin-right: 0;
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
#event_display-header {
|
#event_display-header {
|
||||||
min-width: 250px;
|
min-width: 250px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 });
|
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',
|
InventoriesEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm',
|
||||||
|
|||||||
@@ -46,6 +46,14 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
|
|
||||||
SearchInit({ scope: scope, set: 'jobevents', list: list, url: defaultUrl });
|
SearchInit({ scope: scope, set: 'jobevents', list: list, url: defaultUrl });
|
||||||
PaginateInit({ scope: scope, list: list, url: defaultUrl });
|
PaginateInit({ scope: scope, list: list, url: defaultUrl });
|
||||||
|
|
||||||
|
// 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.search(list.iterator);
|
||||||
|
|
||||||
scope.toggleChildren = function(id, children) {
|
scope.toggleChildren = function(id, children) {
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ angular.module('InventoryFormDefinition', [])
|
|||||||
has_active_failures: {
|
has_active_failures: {
|
||||||
label: 'Failures',
|
label: 'Failures',
|
||||||
showValue: false,
|
showValue: false,
|
||||||
|
ngClick: "showEvents('\{\{ host.name \}\}', '\{\{ host.related.last_job \}\}')",
|
||||||
ngShow: "\{\{ host.has_active_failures \}\}",
|
ngShow: "\{\{ host.has_active_failures \}\}",
|
||||||
icon: 'icon-exclamation-sign',
|
icon: 'icon-exclamation-sign',
|
||||||
"class": 'active-failures-\{\{ host.has_active_failures \}\}',
|
"class": 'active-failures-\{\{ host.has_active_failures \}\}',
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
|
/*********************************************
|
||||||
|
* Copyright (c) 2013 AnsibleWorks, Inc.
|
||||||
|
*
|
||||||
|
* EventsHelper
|
||||||
|
*
|
||||||
|
* EventView - show the job_events form in a modal dialog
|
||||||
|
*
|
||||||
|
*/
|
||||||
angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventFormDefinition'])
|
angular.module('EventsHelper', ['RestServices', 'Utilities', 'JobEventFormDefinition'])
|
||||||
.factory('EventView', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobEventForm', 'GenerateForm',
|
.factory('EventView', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobEventForm', 'GenerateForm',
|
||||||
'Prompt', 'ProcessErrors', 'GetBasePath',
|
'Prompt', 'ProcessErrors', 'GetBasePath',
|
||||||
|
|||||||
Reference in New Issue
Block a user