From 2e43ed0405b3f55e68d0e030fb9adeb06f97b9b7 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Mon, 28 Sep 2015 10:47:12 -0400 Subject: [PATCH] adhoc ui fixes --- awx/ui/client/src/adhoc/adhoc.controller.js | 6 +++--- awx/ui/client/src/adhoc/adhoc.form.js | 11 ++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/awx/ui/client/src/adhoc/adhoc.controller.js b/awx/ui/client/src/adhoc/adhoc.controller.js index bb78c5564a..28a692a0df 100644 --- a/awx/ui/client/src/adhoc/adhoc.controller.js +++ b/awx/ui/client/src/adhoc/adhoc.controller.js @@ -159,7 +159,7 @@ function adhocController($q, $scope, $rootScope, $location, $routeParams, privateFn.initializeForm = function(id, urls, hostPattern) { // inject the adhoc command form GenerateForm.inject(adhocForm, - { mode: 'edit', related: true, scope: $scope }); + { mode: 'add', related: true, scope: $scope }); // set when "working" starts and stops privateFn.setLoadingStartStop(); @@ -210,7 +210,7 @@ function adhocController($q, $scope, $rootScope, $location, $routeParams, data = { "job_type": "run", "limit": "", - "credential": null, + "credential": "", "module_name": "command", "module_args": "", "forks": 0, @@ -224,7 +224,7 @@ function adhocController($q, $scope, $rootScope, $location, $routeParams, for (fld in adhocForm.fields) { if (adhocForm.fields[fld].type === 'select') { data[fld] = $scope[fld].value; - } else { + } else if ($scope[fld]) { data[fld] = $scope[fld]; } } diff --git a/awx/ui/client/src/adhoc/adhoc.form.js b/awx/ui/client/src/adhoc/adhoc.form.js index c494f3d311..d200d37b47 100644 --- a/awx/ui/client/src/adhoc/adhoc.form.js +++ b/awx/ui/client/src/adhoc/adhoc.form.js @@ -25,7 +25,7 @@ export default function() { ngOptions: 'module.label for module in adhoc_module_options' + ' track by module.value', ngChange: 'moduleChange()', - editRequired: true, + addRequired: true, awPopOver:'

These are the modules that Tower supports ' + 'running commands against.', dataTitle: 'Module', @@ -40,14 +40,13 @@ export default function() { dataTitle: 'Arguments', dataPlacement: 'right', dataContainer: 'body', - editRequired: false, + addRequired: false, autocomplete: false }, limit: { label: 'Host Pattern', type: 'text', addRequired: false, - editRequired: false, awPopOver: '

The pattern used to target hosts in the ' + 'inventory. Leaving the field blank, all, and * will ' + 'all target all hosts in the inventory. You can find ' + @@ -83,7 +82,6 @@ export default function() { label: 'Enable Privilege Escalation', type: 'checkbox', addRequired: false, - editRequired: false, column: 2, awPopOver: "

If enabled, run this playbook as an administrator. This is the equivalent of passing the --become option to the ansible command.

", dataPlacement: 'right', @@ -97,7 +95,7 @@ export default function() { ngOptions: 'verbosity.label for verbosity in ' + 'adhoc_verbosity_options ' + 'track by verbosity.value', - editRequired: true, + addRequired: true, awPopOver:'

These are the verbosity levels for standard ' + 'out of the command run that are supported.', dataTitle: 'Module', @@ -113,8 +111,7 @@ export default function() { min: 0, spinner: true, "default": 0, - addRequired: false, - editRequired: true, + addRequired: true, 'class': "input-small", column: 1, awPopOver: '

The number of parallel or simultaneous processes to use while executing the command. 0 signifies ' +