clickable stdout events and host details modal for projects

This commit is contained in:
Jake McDermott 2018-04-26 13:21:28 -04:00
parent 074302b573
commit 9cc9bdc4b5
No known key found for this signature in database
GPG Key ID: 3B02CAD476EECB35
2 changed files with 34 additions and 6 deletions

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) {