mirror of
https://github.com/ansible/awx.git
synced 2026-07-11 00:08:02 -02:30
add launched-by-webhook details to job runs
This commit is contained in:
committed by
Jeff Bradberry
parent
00337990db
commit
6b17e86f30
@@ -251,10 +251,12 @@ function getHostLimitErrorDetails () {
|
||||
function getLaunchedByDetails () {
|
||||
const createdBy = resource.model.get('summary_fields.created_by');
|
||||
const jobTemplate = resource.model.get('summary_fields.job_template');
|
||||
const workflowJobTemplate = resource.model.get('summary_fields.workflow_job_template');
|
||||
const relatedSchedule = resource.model.get('related.schedule');
|
||||
const schedule = resource.model.get('summary_fields.schedule');
|
||||
const webhookGUID = resource.model.get('webhook_guid');
|
||||
|
||||
if (!createdBy && !schedule) {
|
||||
if (!createdBy && !schedule && !webhookGUID) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -272,6 +274,14 @@ function getLaunchedByDetails () {
|
||||
tooltip = strings.get('tooltips.SCHEDULE');
|
||||
link = `/#/templates/job_template/${jobTemplate.id}/schedules/${schedule.id}`;
|
||||
value = $filter('sanitize')(schedule.name);
|
||||
} else if (webhookGUID && jobTemplate) {
|
||||
tooltip = strings.get('tooltips.WEBHOOK_JOB_TEMPLATE');
|
||||
link = `/#/templates/job_template/${jobTemplate.id}`;
|
||||
value = strings.get('details.WEBHOOK');
|
||||
} else if (webhookGUID && workflowJobTemplate) {
|
||||
tooltip = strings.get('tooltips.WEBHOOK_WORKFLOW_JOB_TEMPLATE');
|
||||
link = `/#/templates/workflow_job_template/${workflowJobTemplate.id}`;
|
||||
value = strings.get('details.WEBHOOK');
|
||||
} else {
|
||||
tooltip = null;
|
||||
link = null;
|
||||
|
||||
@@ -38,6 +38,8 @@ function OutputStrings (BaseString) {
|
||||
MENU_UP: t.s('Get previous page'),
|
||||
MENU_LAST: t.s('Go to last page of available output'),
|
||||
MENU_FOLLOWING: t.s('Currently following output as it arrives. Click to unfollow'),
|
||||
WEBHOOK_JOB_TEMPLATE: t.s('View the webhook configuration on the job template.'),
|
||||
WEBHOOK_WORKFLOW_JOB_TEMPLATE: t.s('View the webhook configuration on the workflow job template.'),
|
||||
};
|
||||
|
||||
ns.details = {
|
||||
@@ -48,6 +50,7 @@ function OutputStrings (BaseString) {
|
||||
SHOW_LESS: t.s('Show Less'),
|
||||
SHOW_MORE: t.s('Show More'),
|
||||
UNKNOWN: t.s('Finished'),
|
||||
WEBHOOK: t.s('Webhook'),
|
||||
};
|
||||
|
||||
ns.labels = {
|
||||
|
||||
Reference in New Issue
Block a user