diff --git a/awx/ui/static/js/controllers/Adhoc.js b/awx/ui/static/js/controllers/Adhoc.js index 6c08ac18b8..5706fad81b 100644 --- a/awx/ui/static/js/controllers/Adhoc.js +++ b/awx/ui/static/js/controllers/Adhoc.js @@ -23,7 +23,8 @@ export function AdhocCtrl($scope, $rootScope, $location, $routeParams, generator = GenerateForm, form = AdhocForm, master = {}, - id = $routeParams.inventory_id; + id = $routeParams.inventory_id, + choicesReadyCount = 0; // inject the adhoc command form generator.inject(form, { mode: 'edit', related: true, scope: $scope }); @@ -63,10 +64,10 @@ export function AdhocCtrl($scope, $rootScope, $location, $routeParams, $scope.providedHostPatterns = $scope.limit; delete $rootScope.hostPatterns; - if ($scope.removeChoicesReady) { - $scope.removeChoicesReady(); + if ($scope.removeLookUpInitialize) { + $scope.removeLookUpInitialize(); } - $scope.removeChoicesReady = $scope.$on('choicesReadyAdhoc', function () { + $scope.removeLookUpInitialize = $scope.$on('lookUpInitialize', function () { LookUpInit({ scope: $scope, form: form, @@ -79,6 +80,17 @@ export function AdhocCtrl($scope, $rootScope, $location, $routeParams, Wait('stop'); // END: form population }); + if ($scope.removeChoicesReady) { + $scope.removeChoicesReady(); + } + $scope.removeChoicesReady = $scope.$on('choicesReadyAdhoc', function () { + choicesReadyCount++; + + if (choicesReadyCount === 2) { + $scope.$emit('lookUpInitialize'); + } + }); + // setup Machine Credential lookup GetChoices({ scope: $scope, @@ -88,6 +100,15 @@ export function AdhocCtrl($scope, $rootScope, $location, $routeParams, callback: 'choicesReadyAdhoc' }); + // setup verbosity options lookup + GetChoices({ + scope: $scope, + url: url, + field: 'verbosity', + variable: 'adhoc_verbosity_options', + callback: 'choicesReadyAdhoc' + }); + // launch the job with the provided form data $scope.launchJob = function () { var fld, data={}, html; diff --git a/awx/ui/static/js/forms/Adhoc.js b/awx/ui/static/js/forms/Adhoc.js index fcfa26590b..8eb008708d 100644 --- a/awx/ui/static/js/forms/Adhoc.js +++ b/awx/ui/static/js/forms/Adhoc.js @@ -67,6 +67,7 @@ export default sourceModel: 'credential', sourceField: 'name', ngClick: 'lookUpCredential()', + class: 'squeeze', awPopOver: '

Select the credential you want to use when ' + 'accessing the remote hosts to run the command. ' + 'Choose the credential containing ' + @@ -79,6 +80,30 @@ export default variable: 'credRequired', init: 'false' } + }, + become_enabled: { + label: 'Enable Become for Credential', + type: 'checkbox', + editRequired: false + // awPopOver: '

If checked, user will be become the user ' + + // 'specified by the credential.

', + // dataPlacement: 'right', + // dataTitle: 'Enable Become for Credential', + // dataContainer: 'body' + }, + verbosity: { + label: 'Verbosity', + excludeModal: true, + type: 'select', + ngOptions: 'verbosity.label for verbosity in ' + + 'adhoc_verbosity_options ' + + 'track by verbosity.value', + editRequired: true, + awPopOver:'

These are the verbosity levels for standard ' + + 'out of the command run that are supported.', + dataTitle: 'Module', + dataPlacement: 'right', + dataContainer: 'body' } },