fixed defect with GCE cred's not showing up in inventory groups modal window

This commit is contained in:
Jared Tabor 2014-07-22 16:24:34 -04:00 committed by Luke Sneeringer
parent a05aac8a50
commit 5df7833038
4 changed files with 28 additions and 4 deletions

View File

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

View File

@ -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',

View File

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

View File

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