mirror of
https://github.com/ansible/awx.git
synced 2026-05-18 06:47:41 -02:30
Sat6, CloudForms, Network, and Azure_rm to the UI
Adding UI changes for RH Satellite6, RH CloudForms, Azure RM, and the new Network credentials and inventory sources. Network Inventory on the UI making host required for cloudforms and sat6 first commit of azure_rm More Azure Credential form elements Fixes to azure_rm after API merges fixing network credential and new azure inv source
This commit is contained in:
@@ -519,8 +519,8 @@ export function CredentialsEdit($scope, $rootScope, $compile, $location, $log,
|
|||||||
$scope.project = data.project;
|
$scope.project = data.project;
|
||||||
break;
|
break;
|
||||||
case 'azure':
|
case 'azure':
|
||||||
$scope.subscription_id = data.username;
|
$scope.subscription = data.username;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
$scope.credential_obj = data;
|
$scope.credential_obj = data;
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ export default
|
|||||||
"host": {
|
"host": {
|
||||||
labelBind: 'hostLabel',
|
labelBind: 'hostLabel',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
ngShow: "kind.value == 'vmware' || kind.value == 'openstack'",
|
ngShow: "kind.value == 'vmware' || kind.value == 'openstack' || kind.value === 'foreman' || kind.value === 'cloudforms'",
|
||||||
awPopOverWatch: "hostPopOver",
|
awPopOverWatch: "hostPopOver",
|
||||||
awPopOver: "set in helpers/credentials",
|
awPopOver: "set in helpers/credentials",
|
||||||
dataTitle: 'Host',
|
dataTitle: 'Host',
|
||||||
@@ -154,6 +154,23 @@ export default
|
|||||||
},
|
},
|
||||||
subForm: 'credentialSubForm'
|
subForm: 'credentialSubForm'
|
||||||
},
|
},
|
||||||
|
"subscription": {
|
||||||
|
label: "Subscription ID",
|
||||||
|
type: 'text',
|
||||||
|
ngShow: "kind.value == 'azure' || kind.value == 'azure_rm'",
|
||||||
|
awRequiredWhen: {
|
||||||
|
reqExpression: 'subscription_required',
|
||||||
|
init: false
|
||||||
|
},
|
||||||
|
addRequired: false,
|
||||||
|
editRequired: false,
|
||||||
|
autocomplete: false,
|
||||||
|
awPopOver: '<p>Subscription ID is an Azure construct, which is mapped to a username.</p>',
|
||||||
|
dataTitle: 'Subscription ID',
|
||||||
|
dataPlacement: 'right',
|
||||||
|
dataContainer: "body",
|
||||||
|
subForm: 'credentialSubForm'
|
||||||
|
},
|
||||||
"username": {
|
"username": {
|
||||||
labelBind: 'usernameLabel',
|
labelBind: 'usernameLabel',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
@@ -181,23 +198,6 @@ export default
|
|||||||
dataContainer: "body",
|
dataContainer: "body",
|
||||||
subForm: 'credentialSubForm'
|
subForm: 'credentialSubForm'
|
||||||
},
|
},
|
||||||
"subscription_id": {
|
|
||||||
labelBind: "usernameLabel",
|
|
||||||
type: 'text',
|
|
||||||
ngShow: "kind.value == 'azure'",
|
|
||||||
awRequiredWhen: {
|
|
||||||
reqExpression: 'subscription_required',
|
|
||||||
init: false
|
|
||||||
},
|
|
||||||
addRequired: false,
|
|
||||||
editRequired: false,
|
|
||||||
autocomplete: false,
|
|
||||||
awPopOver: '<p>Subscription ID is an Azure construct, which is mapped to a username.</p>',
|
|
||||||
dataTitle: 'Subscription ID',
|
|
||||||
dataPlacement: 'right',
|
|
||||||
dataContainer: "body",
|
|
||||||
subForm: 'credentialSubForm'
|
|
||||||
},
|
|
||||||
"api_key": {
|
"api_key": {
|
||||||
label: 'API Key',
|
label: 'API Key',
|
||||||
type: 'sensitive',
|
type: 'sensitive',
|
||||||
@@ -215,9 +215,7 @@ export default
|
|||||||
"password": {
|
"password": {
|
||||||
labelBind: 'passwordLabel',
|
labelBind: 'passwordLabel',
|
||||||
type: 'sensitive',
|
type: 'sensitive',
|
||||||
ngShow: "kind.value == 'scm' || kind.value == 'vmware' || kind.value == 'openstack'",
|
ngShow: "kind.value == 'scm' || kind.value == 'vmware' || kind.value == 'openstack'|| kind.value == 'foreman'|| kind.value == 'cloudforms'|| kind.value == 'net' || kind.value == 'azure_rm'",
|
||||||
addRequired: false,
|
|
||||||
editRequired: false,
|
|
||||||
ask: false,
|
ask: false,
|
||||||
clear: false,
|
clear: false,
|
||||||
autocomplete: false,
|
autocomplete: false,
|
||||||
@@ -229,7 +227,7 @@ export default
|
|||||||
subForm: "credentialSubForm"
|
subForm: "credentialSubForm"
|
||||||
},
|
},
|
||||||
"ssh_password": {
|
"ssh_password": {
|
||||||
label: 'Password', // formally 'SSH Password'
|
label: 'Password',
|
||||||
type: 'sensitive',
|
type: 'sensitive',
|
||||||
ngShow: "kind.value == 'ssh'",
|
ngShow: "kind.value == 'ssh'",
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
@@ -243,7 +241,7 @@ export default
|
|||||||
labelBind: 'sshKeyDataLabel',
|
labelBind: 'sshKeyDataLabel',
|
||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
ngShow: "kind.value == 'ssh' || kind.value == 'scm' || " +
|
ngShow: "kind.value == 'ssh' || kind.value == 'scm' || " +
|
||||||
"kind.value == 'gce' || kind.value == 'azure'",
|
"kind.value == 'gce' || kind.value == 'azure' || kind.value == 'net'",
|
||||||
awRequiredWhen: {
|
awRequiredWhen: {
|
||||||
reqExpression: 'key_required',
|
reqExpression: 'key_required',
|
||||||
init: true
|
init: true
|
||||||
@@ -288,18 +286,18 @@ export default
|
|||||||
subForm: 'credentialSubForm'
|
subForm: 'credentialSubForm'
|
||||||
},
|
},
|
||||||
"become_username": {
|
"become_username": {
|
||||||
label: 'Privilege Escalation Username',
|
labelBind: 'becomeUsernameLabel',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
ngShow: "kind.value == 'ssh' && (become_method && become_method.value)",
|
ngShow: "(kind.value == 'ssh' && (become_method && become_method.value)) ",
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
autocomplete: false,
|
autocomplete: false,
|
||||||
subForm: 'credentialSubForm'
|
subForm: 'credentialSubForm'
|
||||||
},
|
},
|
||||||
"become_password": {
|
"become_password": {
|
||||||
label: 'Privilege Escalation Password',
|
labelBind: 'becomePasswordLabel',
|
||||||
type: 'sensitive',
|
type: 'sensitive',
|
||||||
ngShow: "kind.value == 'ssh' && (become_method && become_method.value)",
|
ngShow: "(kind.value == 'ssh' && (become_method && become_method.value)) ",
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
ask: true,
|
ask: true,
|
||||||
@@ -307,6 +305,53 @@ export default
|
|||||||
autocomplete: false,
|
autocomplete: false,
|
||||||
subForm: 'credentialSubForm'
|
subForm: 'credentialSubForm'
|
||||||
},
|
},
|
||||||
|
client:{
|
||||||
|
type: 'text',
|
||||||
|
label: 'Client ID',
|
||||||
|
awRequiredWhen: {
|
||||||
|
reqExpression: "azure_rm_required",
|
||||||
|
init: false
|
||||||
|
},
|
||||||
|
subForm: 'credentialSubForm',
|
||||||
|
ngShow: "kind.value === 'azure_rm'"
|
||||||
|
},
|
||||||
|
secret:{
|
||||||
|
type: 'sensitive',
|
||||||
|
hasShowInputButton: true,
|
||||||
|
autocomplete: false,
|
||||||
|
label: 'Client Secret',
|
||||||
|
awRequiredWhen: {
|
||||||
|
reqExpression: "azure_rm_required",
|
||||||
|
init: false
|
||||||
|
},
|
||||||
|
subForm: 'credentialSubForm',
|
||||||
|
ngShow: "kind.value === 'azure_rm'"
|
||||||
|
},
|
||||||
|
tenant: {
|
||||||
|
type: 'text',
|
||||||
|
label: 'Tenent ID',
|
||||||
|
awRequiredWhen: {
|
||||||
|
reqExpression: "azure_rm_required",
|
||||||
|
init: false
|
||||||
|
},
|
||||||
|
subForm: 'credentialSubForm',
|
||||||
|
ngShow: "kind.value === 'azure_rm'"
|
||||||
|
},
|
||||||
|
authorize: {
|
||||||
|
label: 'Authorize',
|
||||||
|
type: 'checkbox',
|
||||||
|
ngChange: "toggleCallback('host_config_key')",
|
||||||
|
subForm: 'credentialSubForm',
|
||||||
|
ngShow: "kind.value === 'net'"
|
||||||
|
},
|
||||||
|
authorize_password: {
|
||||||
|
label: 'Authorize Password',
|
||||||
|
type: 'sensitive',
|
||||||
|
hasShowInputButton: true,
|
||||||
|
autocomplete: false,
|
||||||
|
subForm: 'credentialSubForm',
|
||||||
|
ngShow: "authorize && authorize !== 'false'",
|
||||||
|
},
|
||||||
"project": {
|
"project": {
|
||||||
labelBind: 'projectLabel',
|
labelBind: 'projectLabel',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export default
|
|||||||
type: 'select',
|
type: 'select',
|
||||||
ngOptions: 'source.label for source in source_region_choices track by source.value',
|
ngOptions: 'source.label for source in source_region_choices track by source.value',
|
||||||
multiSelect: true,
|
multiSelect: true,
|
||||||
ngShow: "source && (source.value == 'rax' || source.value == 'ec2' || source.value == 'gce' || source.value == 'azure')",
|
ngShow: "source && (source.value == 'rax' || source.value == 'ec2' || source.value == 'gce' || source.value == 'azure' || source.value == 'azure_rm')",
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
dataTitle: 'Source Regions',
|
dataTitle: 'Source Regions',
|
||||||
|
|||||||
@@ -88,6 +88,8 @@ angular.module('CredentialsHelper', ['Utilities'])
|
|||||||
break;
|
break;
|
||||||
case 'ssh':
|
case 'ssh':
|
||||||
scope.usernameLabel = 'Username'; //formally 'SSH Username'
|
scope.usernameLabel = 'Username'; //formally 'SSH Username'
|
||||||
|
scope.becomeUsernameLabel = 'Privilege Escalation Username';
|
||||||
|
scope.becomePasswordLabel = 'Privilege Escalation Password';
|
||||||
break;
|
break;
|
||||||
case 'scm':
|
case 'scm':
|
||||||
scope.sshKeyDataLabel = 'SCM Private Key';
|
scope.sshKeyDataLabel = 'SCM Private Key';
|
||||||
@@ -109,13 +111,20 @@ angular.module('CredentialsHelper', ['Utilities'])
|
|||||||
"as: </p><p>adjective-noun-000</p>";
|
"as: </p><p>adjective-noun-000</p>";
|
||||||
break;
|
break;
|
||||||
case 'azure':
|
case 'azure':
|
||||||
scope.usernameLabel = "Subscription ID";
|
|
||||||
scope.sshKeyDataLabel = 'Management Certificate';
|
scope.sshKeyDataLabel = 'Management Certificate';
|
||||||
scope.subscription_required = true;
|
scope.subscription_required = true;
|
||||||
scope.key_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_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.key_hint= "drag and drop a management certificate file on the field below";
|
||||||
break;
|
break;
|
||||||
|
case 'azure_rm':
|
||||||
|
scope.usernameLabel = "Username";
|
||||||
|
scope.subscription_required = true;
|
||||||
|
scope.username_required = true;
|
||||||
|
scope.password_required = true;
|
||||||
|
scope.passwordLabel = 'Password';
|
||||||
|
scope.azure_rm_required = true;
|
||||||
|
break;
|
||||||
case 'vmware':
|
case 'vmware':
|
||||||
scope.username_required = true;
|
scope.username_required = true;
|
||||||
scope.host_required = true;
|
scope.host_required = true;
|
||||||
@@ -137,6 +146,27 @@ angular.module('CredentialsHelper', ['Utilities'])
|
|||||||
scope.hostPopOver = "<p>The host to authenticate with." +
|
scope.hostPopOver = "<p>The host to authenticate with." +
|
||||||
"<br />For example, https://openstack.business.com/v2.0/";
|
"<br />For example, https://openstack.business.com/v2.0/";
|
||||||
break;
|
break;
|
||||||
|
case 'foreman':
|
||||||
|
scope.username_required = true;
|
||||||
|
scope.password_required = true;
|
||||||
|
scope.passwordLabel = 'Password';
|
||||||
|
scope.host_required = true;
|
||||||
|
scope.hostLabel = "Satellite 6 Host";
|
||||||
|
break;
|
||||||
|
case 'cloudforms':
|
||||||
|
scope.username_required = true;
|
||||||
|
scope.password_required = true;
|
||||||
|
scope.passwordLabel = 'Password';
|
||||||
|
scope.host_required = true;
|
||||||
|
scope.hostLabel = "CloudForms Host";
|
||||||
|
break;
|
||||||
|
case 'net':
|
||||||
|
scope.username_required = true;
|
||||||
|
scope.password_required = true;
|
||||||
|
scope.passwordLabel = 'Password';
|
||||||
|
scope.sshKeyDataLabel = 'SSH Key';
|
||||||
|
scope.key_required = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,7 +268,7 @@ angular.module('CredentialsHelper', ['Utilities'])
|
|||||||
data.project = scope.project;
|
data.project = scope.project;
|
||||||
break;
|
break;
|
||||||
case 'azure':
|
case 'azure':
|
||||||
data.username = scope.subscription_id;
|
data.username = scope.subscription;
|
||||||
}
|
}
|
||||||
|
|
||||||
Wait('start');
|
Wait('start');
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name
|
|||||||
CreateSelect2({
|
CreateSelect2({
|
||||||
element: '#source_source_regions'
|
element: '#source_source_regions'
|
||||||
});
|
});
|
||||||
} else if (scope.source.value === 'azure') {
|
} else if (scope.source.value === 'azure' || scope.source.value === 'azure_rm') {
|
||||||
scope.source_region_choices = scope.azure_regions;
|
scope.source_region_choices = scope.azure_regions;
|
||||||
$('#source_form').addClass('squeeze');
|
$('#source_form').addClass('squeeze');
|
||||||
CreateSelect2({
|
CreateSelect2({
|
||||||
@@ -312,8 +312,11 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name
|
|||||||
}
|
}
|
||||||
if (scope.source.value === 'rax' ||
|
if (scope.source.value === 'rax' ||
|
||||||
scope.source.value === 'ec2' ||
|
scope.source.value === 'ec2' ||
|
||||||
scope.source.value==='gce' ||
|
scope.source.value ==='gce' ||
|
||||||
|
scope.source.value === 'foreman' ||
|
||||||
|
scope.source.value ==='cloudforms' ||
|
||||||
scope.source.value === 'azure' ||
|
scope.source.value === 'azure' ||
|
||||||
|
scope.source.value === 'azure_rm' ||
|
||||||
scope.source.value === 'vmware' ||
|
scope.source.value === 'vmware' ||
|
||||||
scope.source.value === 'openstack') {
|
scope.source.value === 'openstack') {
|
||||||
if (scope.source.value === 'ec2') {
|
if (scope.source.value === 'ec2') {
|
||||||
|
|||||||
Reference in New Issue
Block a user