mirror of
https://github.com/ansible/awx.git
synced 2026-03-20 18:37:39 -02:30
Updates URL for host events for adhoc commands
This commit is contained in:
@@ -14,7 +14,7 @@ function exit () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function HostEventResolve (HostEventService, $stateParams) {
|
function HostEventResolve (HostEventService, $stateParams) {
|
||||||
return HostEventService.getRelatedJobEvents($stateParams.id, {
|
return HostEventService.getRelatedJobEvents($stateParams.id, $stateParams.type, {
|
||||||
id: $stateParams.eventId
|
id: $stateParams.eventId
|
||||||
}).then((response) => response.data.results[0]);
|
}).then((response) => response.data.results[0]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,22 @@ function HostEventService (
|
|||||||
GetBasePath,
|
GetBasePath,
|
||||||
$rootScope
|
$rootScope
|
||||||
) {
|
) {
|
||||||
|
this.getUrl = (id, type, params) => {
|
||||||
|
let url;
|
||||||
|
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)}`;
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
};
|
||||||
|
|
||||||
// GET events related to a job run
|
// GET events related to a job run
|
||||||
// e.g.
|
// e.g.
|
||||||
// ?event=playbook_on_stats
|
// ?event=playbook_on_stats
|
||||||
// ?parent=206&event__startswith=runner&page_size=200&order=host_name,counter
|
// ?parent=206&event__startswith=runner&page_size=200&order=host_name,counter
|
||||||
this.getRelatedJobEvents = (id, params) => {
|
this.getRelatedJobEvents = (id, type, params) => {
|
||||||
let url = GetBasePath('jobs');
|
const url = this.getUrl(id, type, params);
|
||||||
url = `${url}${id}/job_events/?${this.stringifyParams(params)}`;
|
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
return Rest.get()
|
return Rest.get()
|
||||||
.then(response => response)
|
.then(response => response)
|
||||||
|
|||||||
Reference in New Issue
Block a user