From 3041fce5034c2e293f77cea9d085dc6714f10527 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Thu, 23 Jul 2015 12:07:34 -0400 Subject: [PATCH] Allow settings access from api templates --- awx/api/generics.py | 1 + awx/api/templates/api/unified_job_stdout.md | 2 +- awx/settings/defaults.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/awx/api/generics.py b/awx/api/generics.py index 2628ce2400..d0f90c8766 100644 --- a/awx/api/generics.py +++ b/awx/api/generics.py @@ -202,6 +202,7 @@ class GenericAPIView(generics.GenericAPIView, APIView): 'model_verbose_name_plural': unicode(self.model._meta.verbose_name_plural), }) d.update({'serializer_fields': self.get_serializer().metadata()}) + d['settings'] = settings return d def metadata(self, request): diff --git a/awx/api/templates/api/unified_job_stdout.md b/awx/api/templates/api/unified_job_stdout.md index 4ea726412d..5e50ef352e 100644 --- a/awx/api/templates/api/unified_job_stdout.md +++ b/awx/api/templates/api/unified_job_stdout.md @@ -21,7 +21,7 @@ to specify a range of line numbers to retrieve. Use `dark=1` or `dark=0` as a query string parameter to force or disable a dark background. -Files over 1MB (configurable) will not display in the browser. Use the `txt_download` +Files over {{ settings.STDOUT_MAX_BYTES_DISPLAY|filesizeformat }} (configurable) will not display in the browser. Use the `txt_download` format to download the file directly to view it. {% include "api/_new_in_awx.md" %} diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index a0b7f2497b..7a3e948398 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -567,7 +567,7 @@ FACT_CACHE_PORT = 6564 ORG_ADMINS_CAN_SEE_ALL_USERS = True # Control when we display stdout and where to store the temporary files for downloading -STDOUT_MAX_BYTES_DISPLAY = 1000000 +STDOUT_MAX_BYTES_DISPLAY = 1048576 STDOUT_TEMP_DIR = "/var/lib/awx/" # Logging configuration.