mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
hide priv esc fields and clear their values out when no priv escalation is chosen
This commit is contained in:
@@ -428,6 +428,15 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $
|
|||||||
}
|
}
|
||||||
master.become_method = $scope.become_method;
|
master.become_method = $scope.become_method;
|
||||||
|
|
||||||
|
$scope.$watch('become_method', function(val) {
|
||||||
|
if (val !== null) {
|
||||||
|
if (val.value === "") {
|
||||||
|
$scope.become_username = "";
|
||||||
|
$scope.become_password = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
for (i = 0; i < $scope.credential_kind_options.length; i++) {
|
for (i = 0; i < $scope.credential_kind_options.length; i++) {
|
||||||
if ($scope.credential_kind_options[i].value === data.kind) {
|
if ($scope.credential_kind_options[i].value === data.kind) {
|
||||||
$scope.kind = $scope.credential_kind_options[i];
|
$scope.kind = $scope.credential_kind_options[i];
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ export default
|
|||||||
"become_username": {
|
"become_username": {
|
||||||
label: 'Privilege Escalation Username',
|
label: 'Privilege Escalation Username',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
ngShow: "kind.value == 'ssh' && become_method",
|
ngShow: "kind.value == 'ssh' && (become_method && become_method.value)",
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
autocomplete: false
|
autocomplete: false
|
||||||
@@ -304,7 +304,7 @@ export default
|
|||||||
"become_password": {
|
"become_password": {
|
||||||
label: 'Privilege Escalation Password',
|
label: 'Privilege Escalation Password',
|
||||||
type: 'sensitive',
|
type: 'sensitive',
|
||||||
ngShow: "kind.value == 'ssh' && become_method",
|
ngShow: "kind.value == 'ssh' && (become_method && become_method.value)",
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
ask: true,
|
ask: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user