From 3df6cda4cd5c3018c878fd336b36fd55a7681341 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Thu, 29 Jun 2017 15:39:36 -0400 Subject: [PATCH] add logging protocol and timeout to ctit ui --- .../src/configuration/configuration.controller.js | 6 +++++- .../system-form/configuration-system.controller.js | 5 +++++ .../system-form/sub-forms/system-logging.form.js | 14 ++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/configuration/configuration.controller.js b/awx/ui/client/src/configuration/configuration.controller.js index d68c22e9b4..33056ec486 100644 --- a/awx/ui/client/src/configuration/configuration.controller.js +++ b/awx/ui/client/src/configuration/configuration.controller.js @@ -392,7 +392,11 @@ export default [ } else { // Everything else - payload[key] = $scope[key]; + if (key !== 'LOG_AGGREGATOR_TCP_TIMEOUT' || + ($scope.LOG_AGGREGATOR_PROTOCOL === 'https' || + $scope.LOG_AGGREGATOR_PROTOCOL === 'tcp')) { + payload[key] = $scope[key]; + } } }); diff --git a/awx/ui/client/src/configuration/system-form/configuration-system.controller.js b/awx/ui/client/src/configuration/system-form/configuration-system.controller.js index bf31b99881..51d6f8ebaf 100644 --- a/awx/ui/client/src/configuration/system-form/configuration-system.controller.js +++ b/awx/ui/client/src/configuration/system-form/configuration-system.controller.js @@ -171,6 +171,10 @@ export default [ $scope.$parent.LOG_AGGREGATOR_TYPE = _.find($scope.$parent.LOG_AGGREGATOR_TYPE_options, { value: $scope.$parent.LOG_AGGREGATOR_TYPE }); } + if($scope.$parent.LOG_AGGREGATOR_PROTOCOL !== null) { + $scope.$parent.LOG_AGGREGATOR_PROTOCOL = _.find($scope.$parent.LOG_AGGREGATOR_PROTOCOL_options, { value: $scope.$parent.LOG_AGGREGATOR_PROTOCOL }); + } + if(flag !== undefined){ dropdownRendered = flag; } @@ -183,6 +187,7 @@ export default [ placeholder: i18n._('Select types'), }); $scope.$parent.configuration_logging_template_form.LOG_AGGREGATOR_TYPE.$setPristine(); + $scope.$parent.configuration_logging_template_form.LOG_AGGREGATOR_PROTOCOL.$setPristine(); } } diff --git a/awx/ui/client/src/configuration/system-form/sub-forms/system-logging.form.js b/awx/ui/client/src/configuration/system-form/sub-forms/system-logging.form.js index 5763e450b5..386c8f708d 100644 --- a/awx/ui/client/src/configuration/system-form/sub-forms/system-logging.form.js +++ b/awx/ui/client/src/configuration/system-form/sub-forms/system-logging.form.js @@ -42,6 +42,20 @@ }, LOG_AGGREGATOR_ENABLED: { type: 'toggleSwitch', + }, + LOG_AGGREGATOR_PROTOCOL: { + type: 'select', + reset: 'LOG_AGGREGATOR_PROTOCOL', + ngOptions: 'type.label for type in LOG_AGGREGATOR_PROTOCOL_options track by type.value' + }, + LOG_AGGREGATOR_TCP_TIMEOUT: { + type: 'text', + reset: 'LOG_AGGREGATOR_TCP_TIMEOUT', + ngShow: 'LOG_AGGREGATOR_PROTOCOL.value === "tcp" || LOG_AGGREGATOR_PROTOCOL.value === "https"', + awRequiredWhen: { + reqExpression: "LOG_AGGREGATOR_PROTOCOL.value === 'tcp' || LOG_AGGREGATOR_PROTOCOL.value === 'https'", + init: "false" + }, } },