diff --git a/awx/ui/static/js/forms/Credentials.js b/awx/ui/static/js/forms/Credentials.js index 0bd02f1dcf..6f2d1932d2 100644 --- a/awx/ui/static/js/forms/Credentials.js +++ b/awx/ui/static/js/forms/Credentials.js @@ -1,5 +1,5 @@ /********************************************* - * Copyright (c) 2014 AnsibleWorks, Inc. + * Copyright (c) 2015 AnsibleWorks, Inc. * * Credentials.js * Form definition for Credential model @@ -156,7 +156,11 @@ export default "host": { labelBind: 'hostLabel', type: 'text', - ngShow: "kind.value == 'vmware'", + ngShow: "kind.value == 'vmware' || kind.value == 'openstack'", + awPopOverWatch: "projectPopOver", + awPopOver: "set in helpers/credentials", + dataPlacement: 'right', + dataContainer: "body", autocomplete: false, awRequiredWhen: { variable: 'host_required', @@ -219,9 +223,9 @@ export default clear: false, }, "password": { - label: 'Password', + labelBind: 'passwordLabel', type: 'sensitive', - ngShow: "kind.value == 'scm' || kind.value == 'vmware'", + ngShow: "kind.value == 'scm' || kind.value == 'vmware' || kind.value == 'openstack'", addRequired: false, editRequired: false, ask: false, @@ -306,20 +310,20 @@ export default autocomplete: false }, "project": { - label: "Project", + labelBind: 'projectLabel', type: 'text', - ngShow: "kind.value == 'gce'", - awRequiredWhen: { - variable: 'project_required', - init: false - }, - awPopOver: "
The Project ID is the GCE assigned identification. It is constructed as two words followed by a three digit number. Such as:
adjective-noun-000
", - dataTitle: 'Project ID', + ngShow: "kind.value == 'gce' || kind.value == 'openstack'", + awPopOverWatch: "projectPopOver", + awPopOver: "set in helpers/credentials", + // dataTitle: 'Project ID', dataPlacement: 'right', dataContainer: "body", addRequired: false, editRequired: false, - autocomplete: false + awRequiredWhen: { + variable: 'project_required', + init: false + } }, "vault_password": { label: "Vault Password", diff --git a/awx/ui/static/js/helpers/Credentials.js b/awx/ui/static/js/helpers/Credentials.js index 1df3258801..c13fe4f6cc 100644 --- a/awx/ui/static/js/helpers/Credentials.js +++ b/awx/ui/static/js/helpers/Credentials.js @@ -1,5 +1,5 @@ /********************************************* - * Copyright (c) 2014 AnsibleWorks, Inc. + * Copyright (c) 2015 AnsibleWorks, Inc. * * Credentials.js * @@ -44,6 +44,7 @@ angular.module('CredentialsHelper', ['Utilities']) scope.host_required = false; scope.password_required = false; scope.hostLabel = ''; + scope.passwordLabel = 'Password'; $('.popover').each(function() { // remove lingering popoverThe project value
"; + scope.hostPopOver = "The host value
"; if (!Empty(scope.kind)) { // Apply kind specific settings @@ -77,36 +83,57 @@ angular.module('CredentialsHelper', ['Utilities']) break; case 'rax': scope.rackspace_required = true; - scope.username_required = true; + scope.username_required = true; break; case 'ssh': scope.usernameLabel = 'Username'; //formally 'SSH Username' break; case 'scm': scope.sshKeyDataLabel = 'SCM Private Key'; + scope.passwordLabel = 'Password'; break; case 'gce': scope.usernameLabel = 'Service Account Email Address'; - scope.sshKeyDataLabel = 'RSA Private Key'; - scope.email_required = true; - scope.key_required = true; - scope.project_required = true; - scope.key_description = 'Paste the contents of the PEM file associated with the service account email.'; - scope.key_hint= "drag and drop a private key file on the field below"; + scope.sshKeyDataLabel = 'RSA Private Key'; + scope.email_required = true; + scope.key_required = true; + scope.project_required = true; + scope.key_description = 'Paste the contents of the PEM file associated with the service account email.'; + scope.key_hint= "drag and drop a private key file on the field below"; + scope.projectLabel = "Project"; + scope.project_required = false; + scope.projectPopOver = "The Project ID is the " + + "GCE assigned identification. It is constructed as " + + "two words followed by a three digit number. Such " + + "as:
adjective-noun-000
"; break; case 'azure': scope.usernameLabel = "Subscription ID"; - scope.sshKeyDataLabel = 'Management Certificate'; - scope.subscription_required = true; - scope.key_required = true; - scope.key_description = "Paste the contents of the PEM file that corresponds to the certificate you uploaded in the Microsoft Azure console."; - scope.key_hint= "drag and drop a management certificate file on the field below"; + scope.sshKeyDataLabel = 'Management Certificate'; + scope.subscription_required = true; + scope.key_required = true; + scope.key_description = "Paste the contents of the PEM file that corresponds to the certificate you uploaded in the Microsoft Azure console."; + scope.key_hint= "drag and drop a management certificate file on the field below"; break; case 'vmware': scope.username_required = true; - scope.host_required = true; - scope.password_required = true; - scope.hostLabel = "vCenter Host"; + scope.host_required = true; + scope.password_required = true; + scope.hostLabel = "vCenter Host"; + scope.passwordLabel = 'Password'; + break; + case 'openstack': + scope.hostLabel = "Host (Authentication URL)"; + scope.projectLabel = "Project (Tenet Name/ID)"; + scope.password_required = true; + scope.project_required = true; + scope.host_required = true; + scope.username_required = true; + scope.projectPopOver = "This is the tenant name " + + "or tenant id. This value is usually the same " + + " as the username.
"; + scope.hostPopOver = "The host to authenticate with." +
+ "
For example, https://openstack.business.com/v2.0/";
break;
}
}