mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
only show cloud and network in select for custom cred types
This commit is contained in:
parent
98bca3b70b
commit
13f899bad8
@ -17,6 +17,14 @@ export default ['Rest', 'Wait',
|
||||
init();
|
||||
|
||||
function init() {
|
||||
|
||||
// for add, don't show ssh
|
||||
$scope.$on('loadCredentialKindOptions', function() {
|
||||
$scope.credential_kind_options = $scope.credential_kind_options
|
||||
.filter(val => val.value === 'net' ||
|
||||
val.value === 'cloud');
|
||||
});
|
||||
|
||||
// Load the list of options for Kind
|
||||
$scope.$parent.optionsDefer.promise
|
||||
.then(function(options) {
|
||||
@ -25,7 +33,8 @@ export default ['Rest', 'Wait',
|
||||
url: url,
|
||||
field: 'kind',
|
||||
variable: 'credential_kind_options',
|
||||
options: options
|
||||
options: options,
|
||||
callback: 'loadCredentialKindOptions'
|
||||
});
|
||||
|
||||
if (!options.actions.POST) {
|
||||
|
@ -43,6 +43,11 @@ export default ['Rest', 'Wait',
|
||||
}
|
||||
$scope.removeChoicesReady = $scope.$on('choicesReadyCredentialTypes',
|
||||
function() {
|
||||
if (!resourceData.data.managed_by_tower) {
|
||||
$scope.credential_kind_options = $scope.credential_kind_options
|
||||
.filter(val => val.value === 'net' ||
|
||||
val.value === 'cloud');
|
||||
}
|
||||
|
||||
$scope.credential_type = credential_typeData;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user