mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
update ssh to machine
This commit is contained in:
parent
2ce300aa1e
commit
4fe2f90689
@ -27,7 +27,7 @@ export default [ 'templateUrl', 'CreateDialog', 'Wait', 'CreateSelect2', 'ParseT
|
||||
credentialTypesLookup()
|
||||
.then(kinds => {
|
||||
if(scope.ask_credential_on_launch) {
|
||||
scope.credentialKind = "" + kinds.SSH;
|
||||
scope.credentialKind = "" + kinds.Machine;
|
||||
scope.includeCredentialList = true;
|
||||
}
|
||||
});
|
||||
|
||||
@ -70,9 +70,9 @@ export default
|
||||
|
||||
$scope.$watchCollection('selectedCredentials.extra', () => {
|
||||
if($scope.credentials && $scope.credentials.length > 0) {
|
||||
if($scope.selectedCredentials.extra && $scope.selectedCredentials.extra.length > 0 && parseInt($scope.credentialKind) !== credentialKinds.SSH) {
|
||||
if($scope.selectedCredentials.extra && $scope.selectedCredentials.extra.length > 0 && parseInt($scope.credentialKind) !== credentialKinds.Machine) {
|
||||
updateExtraCredentialsList();
|
||||
} else if (parseInt($scope.credentialKind) !== credentialKinds.SSH) {
|
||||
} else if (parseInt($scope.credentialKind) !== credentialKinds.Machine) {
|
||||
uncheckAllCredentials();
|
||||
}
|
||||
}
|
||||
@ -80,7 +80,7 @@ export default
|
||||
|
||||
$scope.$watch('selectedCredentials.machine', () => {
|
||||
if($scope.credentials && $scope.credentials.length > 0) {
|
||||
if($scope.selectedCredentials.machine && parseInt($scope.credentialKind) === credentialKinds.SSH) {
|
||||
if($scope.selectedCredentials.machine && parseInt($scope.credentialKind) === credentialKinds.Machine) {
|
||||
updateMachineCredentialList();
|
||||
}
|
||||
else {
|
||||
@ -91,10 +91,10 @@ export default
|
||||
|
||||
$scope.$watchGroup(['credentials', 'selectedCredentials.machine'], () => {
|
||||
if($scope.credentials && $scope.credentials.length > 0) {
|
||||
if($scope.selectedCredentials.machine && parseInt($scope.credentialKind) === credentialKinds.SSH) {
|
||||
if($scope.selectedCredentials.machine && parseInt($scope.credentialKind) === credentialKinds.Machine) {
|
||||
updateMachineCredentialList();
|
||||
}
|
||||
else if($scope.selectedCredentials.extra && $scope.selectedCredentials.extra.length > 0 && parseInt($scope.credentialKind) !== credentialKinds.SSH) {
|
||||
else if($scope.selectedCredentials.extra && $scope.selectedCredentials.extra.length > 0 && parseInt($scope.credentialKind) !== credentialKinds.Machine) {
|
||||
updateExtraCredentialsList();
|
||||
}
|
||||
else {
|
||||
@ -105,7 +105,7 @@ export default
|
||||
};
|
||||
|
||||
$scope.toggle_row = function(selectedRow) {
|
||||
if(parseInt($scope.credentialKind) === credentialKinds.SSH) {
|
||||
if(parseInt($scope.credentialKind) === credentialKinds.Machine) {
|
||||
$scope.selectedCredentials.machine = _.cloneDeep(selectedRow);
|
||||
}
|
||||
else {
|
||||
|
||||
@ -14,14 +14,14 @@ export default ['templateUrl', 'Rest', 'GetBasePath', 'generateList', '$compile'
|
||||
.then(kinds => {
|
||||
scope.credentialKinds = kinds;
|
||||
|
||||
scope.credentialKind = "" + kinds.SSH;
|
||||
scope.credentialKind = "" + kinds.Machine;
|
||||
|
||||
scope.showModal = function() {
|
||||
$('#multi-credential-modal').modal('show');
|
||||
};
|
||||
|
||||
scope.destroyModal = function() {
|
||||
scope.credentialKind = kinds.SSH;
|
||||
scope.credentialKind = kinds.Machine;
|
||||
$('#multi-credential-modal').modal('hide');
|
||||
};
|
||||
|
||||
@ -62,7 +62,7 @@ export default ['templateUrl', 'Rest', 'GetBasePath', 'generateList', '$compile'
|
||||
let extraCredIds = $scope.selectedCredentials.extra
|
||||
.map(cred => cred.id);
|
||||
$scope.credentials.forEach(cred => {
|
||||
if (cred.credential_type !== $scope.credentialKinds.SSH) {
|
||||
if (cred.credential_type !== $scope.credentialKinds.Machine) {
|
||||
cred.checked = (extraCredIds
|
||||
.indexOf(cred.id) > - 1) ? 1 : 0;
|
||||
}
|
||||
@ -75,7 +75,7 @@ export default ['templateUrl', 'Rest', 'GetBasePath', 'generateList', '$compile'
|
||||
|
||||
let updateMachineCredentialList = function() {
|
||||
$scope.credentials.forEach(cred => {
|
||||
if (cred.credential_type === $scope.credentialKinds.SSH) {
|
||||
if (cred.credential_type === $scope.credentialKinds.Machine) {
|
||||
cred.checked = ($scope.selectedCredentials
|
||||
.machine !== null &&
|
||||
cred.id === $scope.selectedCredentials
|
||||
@ -158,9 +158,9 @@ export default ['templateUrl', 'Rest', 'GetBasePath', 'generateList', '$compile'
|
||||
if($scope.credentials && $scope.credentials.length > 0) {
|
||||
if($scope.selectedCredentials.extra &&
|
||||
$scope.selectedCredentials.extra.length > 0 &&
|
||||
parseInt($scope.credentialKind) !== $scope.credentialKinds.SSH) {
|
||||
parseInt($scope.credentialKind) !== $scope.credentialKinds.Machine) {
|
||||
updateExtraCredentialsList();
|
||||
} else if (parseInt($scope.credentialKind) !== $scope.credentialKinds.SSH) {
|
||||
} else if (parseInt($scope.credentialKind) !== $scope.credentialKinds.Machine) {
|
||||
uncheckAllCredentials();
|
||||
}
|
||||
}
|
||||
@ -169,7 +169,7 @@ export default ['templateUrl', 'Rest', 'GetBasePath', 'generateList', '$compile'
|
||||
$scope.$watch('selectedCredentials.machine', () => {
|
||||
if($scope.selectedCredentials &&
|
||||
$scope.selectedCredentials.machine &&
|
||||
parseInt($scope.credentialKind) === $scope.credentialKinds.SSH) {
|
||||
parseInt($scope.credentialKind) === $scope.credentialKinds.Machine) {
|
||||
updateMachineCredentialList();
|
||||
} else {
|
||||
uncheckAllCredentials();
|
||||
@ -193,7 +193,7 @@ export default ['templateUrl', 'Rest', 'GetBasePath', 'generateList', '$compile'
|
||||
$scope.credentials.length > 0) {
|
||||
if($scope.selectedCredentials &&
|
||||
$scope.selectedCredentials.machine &&
|
||||
parseInt($scope.credentialKind) === $scope.credentialKinds.SSH) {
|
||||
parseInt($scope.credentialKind) === $scope.credentialKinds.Machine) {
|
||||
updateMachineCredentialList();
|
||||
} else if($scope.selectedCredentials &&
|
||||
$scope.selectedCredentials.vault &&
|
||||
@ -202,7 +202,7 @@ export default ['templateUrl', 'Rest', 'GetBasePath', 'generateList', '$compile'
|
||||
} else if($scope.selectedCredentials &&
|
||||
$scope.selectedCredentials.extra &&
|
||||
$scope.selectedCredentials.extra.length > 0 &&
|
||||
parseInt($scope.credentialKind) !== $scope.credentialKinds.SSH) {
|
||||
parseInt($scope.credentialKind) !== $scope.credentialKinds.Machine) {
|
||||
updateExtraCredentialsList();
|
||||
} else {
|
||||
uncheckAllCredentials();
|
||||
@ -216,7 +216,7 @@ export default ['templateUrl', 'Rest', 'GetBasePath', 'generateList', '$compile'
|
||||
});
|
||||
|
||||
$scope.toggle_row = function(selectedRow) {
|
||||
if(parseInt($scope.credentialKind) === $scope.credentialKinds.SSH) {
|
||||
if(parseInt($scope.credentialKind) === $scope.credentialKinds.Machine) {
|
||||
if($scope.selectedCredentials &&
|
||||
$scope.selectedCredentials.machine &&
|
||||
$scope.selectedCredentials.machine.id === selectedRow.id) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user