mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
AC-537 Some UI field/name changes for cloud credentials.
This commit is contained in:
parent
f946026ca7
commit
d668991899
@ -462,6 +462,14 @@ function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $route
|
||||
field: 'credential'
|
||||
});
|
||||
|
||||
LookUpInit({
|
||||
scope: scope,
|
||||
form: form,
|
||||
current_item: data.cloud_credential,
|
||||
list: CredentialList,
|
||||
field: 'cloud_credential'
|
||||
});
|
||||
|
||||
LookUpInit({
|
||||
scope: scope,
|
||||
form: form,
|
||||
|
||||
@ -390,6 +390,14 @@ function JobsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
||||
field: 'credential'
|
||||
});
|
||||
|
||||
LookUpInit({
|
||||
scope: scope,
|
||||
form: form,
|
||||
current_item: data.cloud_credential,
|
||||
list: CredentialList,
|
||||
field: 'cloud_credential'
|
||||
});
|
||||
|
||||
LookUpInit({
|
||||
scope: scope,
|
||||
form: form,
|
||||
|
||||
@ -28,31 +28,37 @@ angular.module('CredentialFormDefinition', [])
|
||||
addRequired: false,
|
||||
editRequired: false
|
||||
},
|
||||
"ssh_username": {
|
||||
label: 'SSH Username',
|
||||
kind: {
|
||||
label: 'Kind',
|
||||
type: 'radio', // FIXME: Make select, pull from OPTIONS request
|
||||
options: [{ label: 'Machine', value: 'ssh' }, { label: 'SCM', value: 'scm'}, { label: 'AWS', value: 'aws'}, { label: 'Rackspace', value: 'rax'}],
|
||||
//ngChange: 'selectCategory()'
|
||||
},
|
||||
"username": {
|
||||
label: 'Username',
|
||||
type: 'text',
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
autocomplete: false
|
||||
},
|
||||
"ssh_password": {
|
||||
label: 'SSH Password',
|
||||
"password": {
|
||||
label: 'Password',
|
||||
type: 'password',
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
ngChange: "clearPWConfirm('ssh_password_confirm')",
|
||||
ngChange: "clearPWConfirm('password_confirm')",
|
||||
ask: true,
|
||||
clear: true,
|
||||
associated: 'ssh_password_confirm',
|
||||
associated: 'password_confirm',
|
||||
autocomplete: false
|
||||
},
|
||||
"ssh_password_confirm": {
|
||||
label: 'Confirm SSH Password',
|
||||
"password_confirm": {
|
||||
label: 'Confirm Password',
|
||||
type: 'password',
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
awPassMatch: true,
|
||||
associated: 'ssh_password',
|
||||
associated: 'password',
|
||||
autocomplete: false
|
||||
},
|
||||
"ssh_key_data": {
|
||||
|
||||
@ -112,7 +112,17 @@ angular.module('GroupFormDefinition', [])
|
||||
type: 'text',
|
||||
awRequiredWhen: {variable: "sourcePathRequired", init: "false" }
|
||||
},
|
||||
source_username: {
|
||||
credential: { // FIXME: Lookup doesn't work yet!
|
||||
label: 'Cloud Credential',
|
||||
type: 'lookup',
|
||||
sourceModel: 'credential',
|
||||
sourceField: 'name',
|
||||
ngClick: 'lookUpCredential()',
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
column: 1
|
||||
},
|
||||
/*source_username: {
|
||||
labelBind: 'sourceUsernameLabel',
|
||||
excludeModal: true,
|
||||
type: 'text',
|
||||
@ -141,7 +151,7 @@ angular.module('GroupFormDefinition', [])
|
||||
awPassMatch: true,
|
||||
associated: 'source_password',
|
||||
autocomplete: false
|
||||
},
|
||||
},*/
|
||||
source_regions: {
|
||||
label: 'Regions',
|
||||
excludeModal: true,
|
||||
|
||||
@ -72,7 +72,7 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
awRequiredWhen: {variable: "playbookrequired", init: "true" },
|
||||
column: 1
|
||||
},
|
||||
credential: {
|
||||
credential: { // FIXME: Lookup only credentials with kind=ssh
|
||||
label: 'Credential',
|
||||
type: 'lookup',
|
||||
sourceModel: 'credential',
|
||||
@ -82,6 +82,16 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
editRequired: false,
|
||||
column: 1
|
||||
},
|
||||
cloud_credential: { // FIXME: Lookup only credentials with kind=aws/rax
|
||||
label: 'Cloud Credential',
|
||||
type: 'lookup',
|
||||
sourceModel: 'cloud_credential',
|
||||
sourceField: 'name',
|
||||
ngClick: 'lookUpCredential()',
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
column: 1
|
||||
},
|
||||
forks: {
|
||||
label: 'Forks',
|
||||
id: 'forks-number',
|
||||
|
||||
@ -99,7 +99,7 @@ angular.module('JobFormDefinition', [])
|
||||
editRequired: true,
|
||||
column: 1
|
||||
},
|
||||
credential: {
|
||||
credential: { // FIXME: Lookup only credentials with kind=ssh
|
||||
label: 'Credential',
|
||||
type: 'lookup',
|
||||
sourceModel: 'credential',
|
||||
@ -109,6 +109,16 @@ angular.module('JobFormDefinition', [])
|
||||
editRequired: false,
|
||||
column: 1
|
||||
},
|
||||
cloud_credential: { // FIXME: Lookup only credentials with kind=aws/rax
|
||||
label: 'Cloud Credential',
|
||||
type: 'lookup',
|
||||
sourceModel: 'cloud_credential',
|
||||
sourceField: 'name',
|
||||
ngClick: 'lookUpCredential()',
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
column: 1
|
||||
},
|
||||
forks: {
|
||||
label: 'Forks',
|
||||
id: 'forks-number',
|
||||
|
||||
@ -128,7 +128,16 @@ angular.module('ProjectFormDefinition', [])
|
||||
addRequired: false,
|
||||
editRequired: false
|
||||
},
|
||||
auth_required: {
|
||||
credential: { // FIXME: Lookup doesn't work yet!
|
||||
label: 'SCM Credential',
|
||||
type: 'lookup',
|
||||
sourceModel: 'credential',
|
||||
sourceField: 'name',
|
||||
ngClick: 'lookUpCredential()',
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
},
|
||||
/*auth_required: {
|
||||
label: 'Authorization required?',
|
||||
type: 'checkbox',
|
||||
ngShow: "scm_type !== '' && scm_type !== null",
|
||||
@ -194,7 +203,7 @@ angular.module('ProjectFormDefinition', [])
|
||||
editRequired: false,
|
||||
awPassMatch: true,
|
||||
associated: 'scm_key_unlock'
|
||||
},
|
||||
},*/
|
||||
checkbox_group: {
|
||||
label: 'SCM Options',
|
||||
type: 'checkbox_group',
|
||||
|
||||
@ -517,7 +517,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
scope.groups[i].name + '</em>. Use the Refresh button to monitor the status.', 'alert-info');
|
||||
}
|
||||
else {
|
||||
if (scope.groups[i].summary_fields.inventory_source.source == 'ec2') {
|
||||
/*if (scope.groups[i].summary_fields.inventory_source.source == 'ec2') {
|
||||
scope.sourceUsernameLabel = 'Access Key ID';
|
||||
scope.sourcePasswordLabel = 'Secret Access Key';
|
||||
scope.sourcePasswordConfirmLabel = 'Confirm Secret Access Key';
|
||||
@ -526,7 +526,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
scope.sourceUsernameLabel = 'Username';
|
||||
scope.sourcePasswordLabel = 'Password';
|
||||
scope.sourcePasswordConfirmLabel = 'Confirm Password';
|
||||
}
|
||||
}*/
|
||||
Rest.setUrl(scope.groups[i].related.inventory_source);
|
||||
Rest.get()
|
||||
.success( function(data, status, headers, config) {
|
||||
@ -685,11 +685,11 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
scope.source = form.fields.source['default'];
|
||||
scope.parseType = 'yaml';
|
||||
scope[form.fields['source_vars'].parseTypeName] = 'yaml';
|
||||
scope.sourcePasswordRequired = false;
|
||||
/*scope.sourcePasswordRequired = false;
|
||||
scope.sourceUsernameRequired = false;
|
||||
scope.sourceUsernameLabel = 'Username';
|
||||
scope.sourcePasswordLabel = 'Password';
|
||||
scope.sourcePasswordConfirmLabel = 'Confirm Password';
|
||||
scope.sourcePasswordConfirmLabel = 'Confirm Password';*/
|
||||
scope.sourcePathRequired = false;
|
||||
|
||||
ParseTypeChange(scope);
|
||||
@ -855,8 +855,8 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
var data = { group: group_id,
|
||||
source: scope['source'].value,
|
||||
source_path: scope['source_path'],
|
||||
source_username: scope['source_username'],
|
||||
source_password: scope['source_password'],
|
||||
//source_username: scope['source_username'],
|
||||
//source_password: scope['source_password'],
|
||||
source_regions: scope['source_regions'],
|
||||
overwrite: scope['overwrite'],
|
||||
overwrite_vars: scope['overwrite_vars'],
|
||||
@ -955,7 +955,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
};
|
||||
|
||||
scope.sourceChange = function() {
|
||||
if (scope['source'].value == 'ec2' || scope['source'].value == 'rackspace') {
|
||||
/*if (scope['source'].value == 'ec2' || scope['source'].value == 'rackspace') {
|
||||
scope.sourcePasswordRequired = true;
|
||||
scope.sourceUsernameRequired = true;
|
||||
if (scope['source'].value == 'ec2') {
|
||||
@ -977,7 +977,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
scope.source_password_confirm = '';
|
||||
scope.source_username = '';
|
||||
scope[form.name + '_form']['source_username'].$setValidity('required',true);
|
||||
}
|
||||
}*/
|
||||
|
||||
if (scope['source'].value == 'file') {
|
||||
scope.sourcePathRequired = true;
|
||||
@ -991,7 +991,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
}
|
||||
|
||||
// Password change
|
||||
scope.clearPWConfirm = function(fld) {
|
||||
/*scope.clearPWConfirm = function(fld) {
|
||||
// If password value changes, make sure password_confirm must be re-entered
|
||||
scope[fld] = '';
|
||||
scope[form.name + '_form'][fld].$setValidity('awpassmatch', false);
|
||||
@ -1018,6 +1018,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
scope[form.name + '_form'][associated].$setValidity('awpassmatch', true);
|
||||
scope[form.name + '_form'].$setDirty();
|
||||
}
|
||||
*/
|
||||
|
||||
// Start the update process
|
||||
scope.updateGroup = function() {
|
||||
@ -1030,7 +1031,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
scope.summary_fields.group.name + '</em>. Use the Refresh button to monitor the status.', 'alert-info');
|
||||
}
|
||||
else {
|
||||
if (scope.source == 'Amazon EC2') {
|
||||
/*if (scope.source == 'Amazon EC2') {
|
||||
scope.sourceUsernameLabel = 'Access Key ID';
|
||||
scope.sourcePasswordLabel = 'Secret Access Key';
|
||||
scope.sourcePasswordConfirmLabel = 'Confirm Secret Access Key';
|
||||
@ -1039,7 +1040,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
scope.sourceUsernameLabel = 'Username';
|
||||
scope.sourcePasswordLabel = 'Password';
|
||||
scope.sourcePasswordConfirmLabel = 'Confirm Password';
|
||||
}
|
||||
}*/
|
||||
InventoryUpdate({
|
||||
scope: scope,
|
||||
group_id: group_id,
|
||||
|
||||
@ -29,6 +29,9 @@ angular.module('CredentialsListDefinition', [])
|
||||
label: 'Description',
|
||||
excludeModal: true
|
||||
},
|
||||
kind: {
|
||||
label: 'Kind'
|
||||
},
|
||||
team: {
|
||||
label: 'Team',
|
||||
ngBind: 'credential.team_name',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user