mirror of
https://github.com/ansible/awx.git
synced 2026-03-02 17:28:51 -03:30
clickable stdout events and host details modal for projects
This commit is contained in:
@@ -5,13 +5,27 @@ function HostEventService (
|
|||||||
$rootScope
|
$rootScope
|
||||||
) {
|
) {
|
||||||
this.getUrl = (id, type, params) => {
|
this.getUrl = (id, type, params) => {
|
||||||
let url;
|
const queryString = this.stringifyParams(params);
|
||||||
|
|
||||||
|
let baseUrl;
|
||||||
|
let related;
|
||||||
|
|
||||||
if (type === 'playbook') {
|
if (type === 'playbook') {
|
||||||
url = `${GetBasePath('jobs')}${id}/job_events/?${this.stringifyParams(params)}`;
|
baseUrl = GetBasePath('jobs');
|
||||||
} else if (type === 'command') {
|
related = 'job_events';
|
||||||
url = `${GetBasePath('ad_hoc_commands')}${id}/events/?${this.stringifyParams(params)}`;
|
|
||||||
}
|
}
|
||||||
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
|
// GET events related to a job run
|
||||||
|
|||||||
@@ -96,6 +96,20 @@ function JobRenderService ($q, $sce, $window) {
|
|||||||
return { html, count };
|
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) => {
|
this.createRecord = (ln, lines, event) => {
|
||||||
if (!event.uuid) {
|
if (!event.uuid) {
|
||||||
return null;
|
return null;
|
||||||
@@ -109,7 +123,7 @@ function JobRenderService ($q, $sce, $window) {
|
|||||||
start: event.start_line,
|
start: event.start_line,
|
||||||
end: event.end_line,
|
end: event.end_line,
|
||||||
isTruncated: (event.end_line - event.start_line) > lines.length,
|
isTruncated: (event.end_line - event.start_line) > lines.length,
|
||||||
isHost: typeof event.host === 'number'
|
isHost: this.isHostEvent(event),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (event.parent_uuid) {
|
if (event.parent_uuid) {
|
||||||
|
|||||||
Reference in New Issue
Block a user