Merge pull request #1598 from jakemcdermott/project-host-details-and-traceback-label

add click-to-open project host details and improve traceback details label
This commit is contained in:
Jake McDermott
2018-04-27 11:31:59 -04:00
committed by GitHub
3 changed files with 35 additions and 7 deletions

View File

@@ -290,7 +290,7 @@ function getResultTracebackDetails () {
}
const limit = 150;
const label = 'Results Traceback';
const label = 'Error Details';
const more = traceback;
const less = $filter('limitTo')(more, limit);

View File

@@ -5,13 +5,27 @@ function HostEventService (
$rootScope
) {
this.getUrl = (id, type, params) => {
let url;
const queryString = this.stringifyParams(params);
let baseUrl;
let related;
if (type === 'playbook') {
url = `${GetBasePath('jobs')}${id}/job_events/?${this.stringifyParams(params)}`;
} else if (type === 'command') {
url = `${GetBasePath('ad_hoc_commands')}${id}/events/?${this.stringifyParams(params)}`;
baseUrl = GetBasePath('jobs');
related = 'job_events';
}
return url;
if (type === 'command') {
baseUrl = GetBasePath('ad_hoc_commands');
related = 'events';
}
if (type === 'project') {
baseUrl = GetBasePath('project_updates');
related = 'events';
}
return `${baseUrl}${id}/${related}/?${queryString}`;
};
// GET events related to a job run

View File

@@ -96,6 +96,20 @@ function JobRenderService ($q, $sce, $window) {
return { html, count };
};
this.isHostEvent = (event) => {
if (typeof event.host === 'number') {
return true;
}
if (event.type === 'project_update_event' &&
event.event !== 'runner_on_skipped' &&
event.event_data.host) {
return true;
}
return false;
};
this.createRecord = (ln, lines, event) => {
if (!event.uuid) {
return null;
@@ -109,7 +123,7 @@ function JobRenderService ($q, $sce, $window) {
start: event.start_line,
end: event.end_line,
isTruncated: (event.end_line - event.start_line) > lines.length,
isHost: typeof event.host === 'number'
isHost: this.isHostEvent(event),
};
if (event.parent_uuid) {