From 1b9c050dc8779bac28d0e05b1dafe4a87ad23add Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Fri, 27 Mar 2015 17:42:04 -0400 Subject: [PATCH] adding pbrun radio option and input fields --- awx/ui/static/js/forms/Credentials.js | 21 +++++++++++++++++++++ awx/ui/static/js/helpers/Credentials.js | 8 ++++++-- awx/ui/static/js/helpers/JobSubmission.js | 3 +++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/awx/ui/static/js/forms/Credentials.js b/awx/ui/static/js/forms/Credentials.js index c918b1ae48..9f5bbf7d8b 100644 --- a/awx/ui/static/js/forms/Credentials.js +++ b/awx/ui/static/js/forms/Credentials.js @@ -290,6 +290,9 @@ export default }, { label: 'Su', value: 'su' + },{ + label: 'Pbrun', + value: 'pbrun' }], awPopOver: "

Sudo: Optionally specify a username for sudo operations. This is equivalent to specifying the ansible-playbook --sudo-user parameter.
Su: Optionally specify a username for su operations. This is equivalent to specifying the ansible-playbook --su-user parameter.", dataPlacement: 'right', @@ -331,6 +334,24 @@ export default hasShowInputButton: true, autocomplete: false }, + "pbrun_username": { + label: 'Pbrun Username', + type: 'text', + ngShow: "kind.value == 'ssh' && login_method == 'pbrun'", + addRequired: false, + editRequired: false, + autocomplete: false + }, + "pbrun_password": { + label: 'Pbrun Password', + type: 'sensitive', + ngShow: "kind.value == 'ssh' && login_method == 'pbrun'", + addRequired: false, + editRequired: false, + ask: true, + hasShowInputButton: true, + autocomplete: false + }, "project": { label: "Project", type: 'text', diff --git a/awx/ui/static/js/helpers/Credentials.js b/awx/ui/static/js/helpers/Credentials.js index 36abc98ba8..b2160e483b 100644 --- a/awx/ui/static/js/helpers/Credentials.js +++ b/awx/ui/static/js/helpers/Credentials.js @@ -124,10 +124,10 @@ angular.module('CredentialsHelper', ['Utilities']) scope.ssh_key_unlock_confirm = null; scope.sudo_username = null; scope.sudo_password = null; - scope.sudo_password_confirm = null; scope.su_username = null; scope.su_password = null; - scope.su_password_confirm = null; + scope.pbrun_username = null; + scope.pbrun_password = null; } // Collapse or open help widget based on whether scm value is selected @@ -182,6 +182,10 @@ angular.module('CredentialsHelper', ['Utilities']) scope.su_username = null; scope.su_password = null; } + if (login_method !== 'pbrun') { + scope.pbrun_username = null; + scope.pbrun_password = null; + } }; } ]) diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index 373814bbf8..f5f3594942 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -850,6 +850,9 @@ function($compile, Rest, GetBasePath, TextareaResize,CreateDialog, GenerateForm, if(data.su_password === "ASK"){ passwords.push("su_password"); } + if(data.pbrun_password === "ASK"){ + passwords.push("pbrun_password"); + } if(data.vault_password === "ASK"){ passwords.push("vault_password"); }