mirror of
https://github.com/ansible/awx.git
synced 2026-01-28 23:04:41 -03:30
Host name is now on the Job Events page and links to Host detail page.
This commit is contained in:
parent
34994a6736
commit
77b823f43f
@ -35,12 +35,30 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
||||
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) {
|
||||
$location.path($location.path() + '/' + id);
|
||||
}
|
||||
|
||||
scope.viewHost = function(id) {
|
||||
if (id !== undefined && id !== null) {
|
||||
Rest.setUrl(GetBasePath('jobs') + $routeParams.id + '/');
|
||||
Rest.get()
|
||||
.success( function(data, status, headers, config) {
|
||||
LoadBreadCrumbs({ path: '/inventories/' + data.inventory, title: data.summary_fields.inventory.name });
|
||||
$location.path('/inventories/' + data.inventory + /hosts/ + id);
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
ProcessErrors(scope, data, status, null,
|
||||
{ hdr: 'Error!', msg: 'Failed to lookup job record for job ' + $routeParams.id + ' GET returned status: ' + status });
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
JobEventsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobEventList',
|
||||
|
||||
@ -30,6 +30,13 @@ angular.module('JobEventsListDefinition', [])
|
||||
created: {
|
||||
label: 'Creation Date',
|
||||
},
|
||||
host: {
|
||||
label: 'Host',
|
||||
ngClick: "viewHost(\{\{ jobevent.host \}\})",
|
||||
ngBind: 'jobevent.host_name',
|
||||
sourceModel: 'host',
|
||||
sourceField: 'name'
|
||||
},
|
||||
status: {
|
||||
label: 'Status',
|
||||
icon: 'icon-circle',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user