mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 11:41:08 -03:30
adhoc form fixes
added forks input fixed privilege escalation language, it now mimics job template fixed a hanging issue when a non-machine credential is used fixed reset to include the default verbosity setting
This commit is contained in:
@@ -36,6 +36,7 @@ export function AdhocCtrl($scope, $rootScope, $location, $routeParams,
|
|||||||
$scope.id = id;
|
$scope.id = id;
|
||||||
$scope.argsPopOver = "<p>These arguments are used with the" +
|
$scope.argsPopOver = "<p>These arguments are used with the" +
|
||||||
" specified module.</p>";
|
" specified module.</p>";
|
||||||
|
|
||||||
// fix arguments help popover based on the module selected
|
// fix arguments help popover based on the module selected
|
||||||
$scope.moduleChange = function () {
|
$scope.moduleChange = function () {
|
||||||
// NOTE: for selenium testing link -
|
// NOTE: for selenium testing link -
|
||||||
@@ -64,20 +65,13 @@ export function AdhocCtrl($scope, $rootScope, $location, $routeParams,
|
|||||||
$scope.providedHostPatterns = $scope.limit;
|
$scope.providedHostPatterns = $scope.limit;
|
||||||
delete $rootScope.hostPatterns;
|
delete $rootScope.hostPatterns;
|
||||||
|
|
||||||
if ($scope.removeLookUpInitialize) {
|
LookUpInit({
|
||||||
$scope.removeLookUpInitialize();
|
scope: $scope,
|
||||||
}
|
form: form,
|
||||||
$scope.removeLookUpInitialize = $scope.$on('lookUpInitialize', function () {
|
current_item: (!Empty($scope.credential_id)) ? $scope.credential_id : null,
|
||||||
LookUpInit({
|
list: CredentialList,
|
||||||
scope: $scope,
|
field: 'credential',
|
||||||
form: form,
|
input_type: 'radio'
|
||||||
current_item: (!Empty($scope.credential_id)) ? $scope.credential_id : null,
|
|
||||||
list: CredentialList,
|
|
||||||
field: 'credential',
|
|
||||||
input_type: 'radio'
|
|
||||||
});
|
|
||||||
|
|
||||||
Wait('stop'); // END: form population
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($scope.removeChoicesReady) {
|
if ($scope.removeChoicesReady) {
|
||||||
@@ -87,9 +81,10 @@ export function AdhocCtrl($scope, $rootScope, $location, $routeParams,
|
|||||||
choicesReadyCount++;
|
choicesReadyCount++;
|
||||||
|
|
||||||
if (choicesReadyCount === 2) {
|
if (choicesReadyCount === 2) {
|
||||||
// this sets the default option as specified by the controller.
|
// this sets the default options for the selects as specified by the controller.
|
||||||
$scope.verbosity = $scope.adhoc_verbosity_options[$scope.verbosity_field.default];
|
$scope.verbosity = $scope.adhoc_verbosity_options[$scope.verbosity_field.default];
|
||||||
$scope.$emit('lookUpInitialize');
|
$("#forks-number").spinner("value", $scope.forks_field.default);
|
||||||
|
Wait('stop'); // END: form population
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -212,23 +207,6 @@ export function AdhocCtrl($scope, $rootScope, $location, $routeParams,
|
|||||||
credential: $scope.credential,
|
credential: $scope.credential,
|
||||||
callback: 'ContinueCred'
|
callback: 'ContinueCred'
|
||||||
});
|
});
|
||||||
|
|
||||||
// // Launch the adhoc job
|
|
||||||
// Rest.setUrl(url);
|
|
||||||
// Rest.post(data)
|
|
||||||
// .success(function (data) {
|
|
||||||
// Wait('stop');
|
|
||||||
// $location.path("/ad_hoc_commands/" + data.id);
|
|
||||||
// })
|
|
||||||
// .error(function (data, status) {
|
|
||||||
// ProcessErrors($scope, data, status, form, { hdr: 'Error!',
|
|
||||||
// msg: 'Failed to launch adhoc command. POST returned status: ' +
|
|
||||||
// status });
|
|
||||||
// // TODO: still need to implement popping up a password prompt
|
|
||||||
// // if the credential requires it. The way that the current end-
|
|
||||||
// // point works is that I find out if I need to ask for a
|
|
||||||
// // password from POST, thus I get an error response.
|
|
||||||
// });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Remove all data input into the form
|
// Remove all data input into the form
|
||||||
@@ -239,6 +217,8 @@ export function AdhocCtrl($scope, $rootScope, $location, $routeParams,
|
|||||||
}
|
}
|
||||||
$scope.limit = $scope.providedHostPatterns;
|
$scope.limit = $scope.providedHostPatterns;
|
||||||
KindChange({ scope: $scope, form: form, reset: false });
|
KindChange({ scope: $scope, form: form, reset: false });
|
||||||
|
$scope.verbosity = $scope.adhoc_verbosity_options[$scope.verbosity_field.default];
|
||||||
|
$("#forks-number").spinner("value", $scope.forks_field.default);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,14 +82,15 @@ export default
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
become_enabled: {
|
become_enabled: {
|
||||||
label: 'Enable Become for Credential',
|
label: 'Enable Privilege Escalation',
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
editRequired: false
|
addRequired: false,
|
||||||
// awPopOver: '<p>If checked, user will be become the user ' +
|
editRequird: false,
|
||||||
// 'specified by the credential.</p>',
|
column: 2,
|
||||||
// dataPlacement: 'right',
|
awPopOver: "<p>If enabled, run this playbook as an administrator. This is the equivalent of passing the<code> --become</code> option to the <code> ansible</code> command. </p>",
|
||||||
// dataTitle: 'Enable Become for Credential',
|
dataPlacement: 'right',
|
||||||
// dataContainer: 'body'
|
dataTitle: 'Become Privilege Escalation',
|
||||||
|
dataContainer: "body"
|
||||||
},
|
},
|
||||||
verbosity: {
|
verbosity: {
|
||||||
label: 'Verbosity',
|
label: 'Verbosity',
|
||||||
@@ -104,8 +105,28 @@ export default
|
|||||||
'out of the command run that are supported.',
|
'out of the command run that are supported.',
|
||||||
dataTitle: 'Module',
|
dataTitle: 'Module',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
dataContainer: 'body'
|
dataContainer: 'body',
|
||||||
}
|
default: 1
|
||||||
|
},
|
||||||
|
forks: {
|
||||||
|
label: 'Forks',
|
||||||
|
id: 'forks-number',
|
||||||
|
type: 'number',
|
||||||
|
integer: true,
|
||||||
|
min: 0,
|
||||||
|
spinner: true,
|
||||||
|
"default": 0,
|
||||||
|
addRequired: false,
|
||||||
|
editRequired: false,
|
||||||
|
'class': "input-small",
|
||||||
|
column: 1,
|
||||||
|
awPopOver: '<p>The number of parallel or simultaneous processes to use while executing the command. 0 signifies ' +
|
||||||
|
'the default value from the <a id="ansible_forks_docs" href=\"http://docs.ansible.com/intro_configuration.html#the-ansible-configuration-file\" ' +
|
||||||
|
' target=\"_blank\">ansible configuration file</a>.</p>',
|
||||||
|
dataTitle: 'Forks',
|
||||||
|
dataPlacement: 'right',
|
||||||
|
dataContainer: "body"
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
buttons: {
|
buttons: {
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ export default
|
|||||||
'class': "input-small",
|
'class': "input-small",
|
||||||
column: 1,
|
column: 1,
|
||||||
awPopOver: '<p>The number of parallel or simultaneous processes to use while executing the playbook. 0 signifies ' +
|
awPopOver: '<p>The number of parallel or simultaneous processes to use while executing the playbook. 0 signifies ' +
|
||||||
'the default value from the <a href=\"http://docs.ansible.com/intro_configuration.html#the-ansible-configuration-file\" ' +
|
'the default value from the <a id="ansible_forks_docs" href=\"http://docs.ansible.com/intro_configuration.html#the-ansible-configuration-file\" ' +
|
||||||
' target=\"_blank\">ansible configuration file</a>.</p>',
|
' target=\"_blank\">ansible configuration file</a>.</p>',
|
||||||
dataTitle: 'Forks',
|
dataTitle: 'Forks',
|
||||||
dataPlacement: 'right',
|
dataPlacement: 'right',
|
||||||
|
|||||||
@@ -710,9 +710,8 @@ function($compile, Rest, GetBasePath, TextareaResize,CreateDialog, GenerateForm,
|
|||||||
if(data.vault_password === "ASK"){
|
if(data.vault_password === "ASK"){
|
||||||
passwords.push("vault_password");
|
passwords.push("vault_password");
|
||||||
}
|
}
|
||||||
scope.$emit(callback, passwords);
|
|
||||||
}
|
}
|
||||||
|
scope.$emit(callback, passwords);
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||||
|
|||||||
Reference in New Issue
Block a user