mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
clickable stdout events and host details modal for projects
This commit is contained in:
parent
074302b573
commit
9cc9bdc4b5
@ -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
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user