Host name is now on the Job Events page and links to Host detail page.

This commit is contained in:
chouseknecht 2013-05-22 18:06:39 -04:00
parent 34994a6736
commit 77b823f43f
2 changed files with 25 additions and 0 deletions

View File

@ -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',

View File

@ -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',