mirror of
https://github.com/ansible/awx.git
synced 2026-01-23 23:41:23 -03:30
hide priv esc fields and clear their values out when no priv escalation is chosen
This commit is contained in:
parent
2e6845769a
commit
efa306d1f3
@ -428,6 +428,15 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $
|
||||
}
|
||||
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++) {
|
||||
if ($scope.credential_kind_options[i].value === data.kind) {
|
||||
$scope.kind = $scope.credential_kind_options[i];
|
||||
|
||||
@ -296,7 +296,7 @@ export default
|
||||
"become_username": {
|
||||
label: 'Privilege Escalation Username',
|
||||
type: 'text',
|
||||
ngShow: "kind.value == 'ssh' && become_method",
|
||||
ngShow: "kind.value == 'ssh' && (become_method && become_method.value)",
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
autocomplete: false
|
||||
@ -304,7 +304,7 @@ export default
|
||||
"become_password": {
|
||||
label: 'Privilege Escalation Password',
|
||||
type: 'sensitive',
|
||||
ngShow: "kind.value == 'ssh' && become_method",
|
||||
ngShow: "kind.value == 'ssh' && (become_method && become_method.value)",
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
ask: true,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user