From e9e4c6856d1707d323e4d283187e5df89a81df21 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 9 Feb 2015 14:19:18 -0500 Subject: [PATCH] Implement job template job history statuses, configurable --- awx/api/serializers.py | 1 + awx/settings/defaults.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index f823096df1..9078d2c46d 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -1351,6 +1351,7 @@ class JobTemplateSerializer(UnifiedJobTemplateSerializer, JobOptionsSerializer): else: d['can_copy'] = False d['can_edit'] = False + d['recent_jobs'] = [{'id': x.id, 'status': x.status} for x in obj.jobs.all().order_by('-started')[:10]] return d class JobSerializer(UnifiedJobSerializer, JobOptionsSerializer): diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index e519fc049b..e1edfe8443 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -328,6 +328,9 @@ AWX_PROOT_HIDE_PATHS = [] # Additional paths to show for jobs using proot. AWX_PROOT_SHOW_PATHS = [] +# Number of jobs to show as part of the job template history +AWX_JOB_TEMPLATE_HISTORY = 10 + # Not possible to get list of regions without authenticating, so use this list # instead (based on docs from: # http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/Service_Access_Endpoints-d1e517.html)