mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 10:30:03 -03:30
fixed defect with GCE cred's not showing up in inventory groups modal window
This commit is contained in:
parent
a05aac8a50
commit
5df7833038
@ -393,6 +393,9 @@ function CredentialsEdit($scope, $rootScope, $compile, $location, $log, $routePa
|
||||
$scope.api_key = data.password;
|
||||
master.api_key = $scope.api_key;
|
||||
break;
|
||||
case 'gce':
|
||||
$scope.email_address = data.username;
|
||||
$scope.project = data.project;
|
||||
}
|
||||
|
||||
$scope.$emit('credentialLoaded');
|
||||
|
||||
@ -141,7 +141,17 @@ angular.module('CredentialFormDefinition', [])
|
||||
"username": {
|
||||
labelBind: 'usernameLabel',
|
||||
type: 'text',
|
||||
ngShow: "kind.value && kind.value !== 'aws'",
|
||||
ngShow: "kind.value && kind.value !== 'aws' && kind.value!=='gce'",
|
||||
awRequiredWhen: {
|
||||
variable: 'aws_required',
|
||||
init: false
|
||||
},
|
||||
autocomplete: false
|
||||
},
|
||||
"email_address": {
|
||||
labelBind: 'usernameLabel',
|
||||
type: 'email',
|
||||
ngShow: "kind.value === 'gce'",
|
||||
awRequiredWhen: {
|
||||
variable: 'username_required',
|
||||
init: false
|
||||
@ -159,7 +169,7 @@ angular.module('CredentialFormDefinition', [])
|
||||
autocomplete: false,
|
||||
ask: false,
|
||||
clear: false,
|
||||
apiField: 'passwowrd'
|
||||
// apiField: 'passwowrd'
|
||||
},
|
||||
"password": {
|
||||
label: 'Password',
|
||||
|
||||
@ -149,6 +149,9 @@ angular.module('CredentialsHelper', ['Utilities'])
|
||||
case 'rax':
|
||||
data.password = scope.api_key;
|
||||
break;
|
||||
case 'gce':
|
||||
data.username = scope.email_address;
|
||||
data.project = scope.project;
|
||||
}
|
||||
|
||||
if (Empty(data.team) && Empty(data.user)) {
|
||||
|
||||
@ -235,9 +235,17 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
text: 'All'
|
||||
}]);
|
||||
$('#source_form').addClass('squeeze');
|
||||
} else if (scope.source.value === 'gce') {
|
||||
scope.source_region_choices = scope.gce_regions;
|
||||
//$('#s2id_group_source_regions').select2('data', []);
|
||||
$('#s2id_source_source_regions').select2('data', [{
|
||||
id: 'all',
|
||||
text: 'All'
|
||||
}]);
|
||||
$('#source_form').addClass('squeeze');
|
||||
}
|
||||
if (scope.source.value === 'rax' || scope.source.value === 'ec2') {
|
||||
kind = (scope.source.value === 'rax') ? 'rax' : 'aws';
|
||||
if (scope.source.value === 'rax' || scope.source.value === 'ec2'|| scope.source.value==='gce') {
|
||||
kind = (scope.source.value === 'rax') ? 'rax' : (scope.source.value==='gce') ? 'gce' : 'aws';
|
||||
url = GetBasePath('credentials') + '?cloud=true&kind=' + kind;
|
||||
LookUpInit({
|
||||
url: url,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user