1
0
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:
John Mitchell 2017-07-19 12:46:54 -04:00
parent 98bca3b70b
commit 13f899bad8
2 changed files with 15 additions and 1 deletions

View File

@ -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) {

View File

@ -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;