mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 20:30:46 -03:30
fixing grunt errors
This commit is contained in:
parent
b618d9223f
commit
3c878018be
@ -40,7 +40,7 @@ import {ScheduleEditController} from 'tower/controllers/Schedules';
|
||||
import {ProjectsList, ProjectsAdd, ProjectsEdit} from 'tower/controllers/Projects';
|
||||
import {OrganizationsList, OrganizationsAdd, OrganizationsEdit} from 'tower/controllers/Organizations';
|
||||
import {InventoriesList, InventoriesAdd, InventoriesEdit, InventoriesManage} from 'tower/controllers/Inventories';
|
||||
import {AdhocForm} from 'tower/controllers/Adhoc';
|
||||
import {AdhocCtrl} from 'tower/controllers/Adhoc';
|
||||
import {AdminsList} from 'tower/controllers/Admins';
|
||||
import {UsersList, UsersAdd, UsersEdit} from 'tower/controllers/Users';
|
||||
import {TeamsList, TeamsAdd, TeamsEdit} from 'tower/controllers/Teams';
|
||||
@ -290,7 +290,7 @@ var tower = angular.module('Tower', [
|
||||
|
||||
when('/inventories/:inventory_id/adhoc', {
|
||||
templateUrl: urlPrefix + 'partials/adhoc.html',
|
||||
controller: AdhocForm
|
||||
controller: AdhocCtrl
|
||||
}).
|
||||
|
||||
when('/organizations', {
|
||||
|
||||
@ -11,15 +11,15 @@
|
||||
* @name controllers.function:Adhoc
|
||||
* @description This controller controls the adhoc form creation, command launching and navigating to standard out after command has been succesfully ran.
|
||||
*/
|
||||
export function AdhocForm($scope, $rootScope, $location, $routeParams,
|
||||
export function AdhocCtrl($scope, $rootScope, $location, $routeParams,
|
||||
AdhocForm, GenerateForm, Rest, ProcessErrors, ClearScope, GetBasePath,
|
||||
GetChoices, KindChange, LookUpInit, CredentialList, Empty, OwnerChange,
|
||||
LoginMethodChange, Wait) {
|
||||
|
||||
ClearScope();
|
||||
|
||||
var url = GetBasePath('inventory') + $routeParams.inventory_id
|
||||
+ '/ad_hoc_commands/',
|
||||
var url = GetBasePath('inventory') + $routeParams.inventory_id +
|
||||
'/ad_hoc_commands/',
|
||||
generator = GenerateForm,
|
||||
form = AdhocForm,
|
||||
master = {},
|
||||
@ -33,8 +33,8 @@ export function AdhocForm($scope, $rootScope, $location, $routeParams,
|
||||
// display
|
||||
Wait('start');
|
||||
$scope.id = id;
|
||||
$scope.argsPopOver = "<p>These arguments are used with the"
|
||||
+ " specified module.</p>";
|
||||
$scope.argsPopOver = "<p>These arguments are used with the" +
|
||||
" specified module.</p>";
|
||||
// fix arguments help popover based on the module selected
|
||||
$scope.moduleChange = function () {
|
||||
// NOTE: for selenium testing link -
|
||||
@ -42,18 +42,18 @@ export function AdhocForm($scope, $rootScope, $location, $routeParams,
|
||||
// only when a module is selected
|
||||
if ($scope.module_name) {
|
||||
// give the docs for the selected module
|
||||
$scope.argsPopOver = "<p>These arguments are used with the"
|
||||
+ " specified module. You can find information about the "
|
||||
+ $scope.module_name.value
|
||||
+ " <a id=\"adhoc_module_arguments_docs_link_for_module_"
|
||||
+ $scope.module_name.value
|
||||
+ "\""
|
||||
+ " href=\"http://docs.ansible.com/" + $scope.module_name.value
|
||||
+ "_module.html\" target=\"_blank\">here</a>.</p>";
|
||||
$scope.argsPopOver = "<p>These arguments are used with the" +
|
||||
" specified module. You can find information about the " +
|
||||
$scope.module_name.value +
|
||||
" <a id=\"adhoc_module_arguments_docs_link_for_module_" +
|
||||
$scope.module_name.value +
|
||||
"\"" +
|
||||
" href=\"http://docs.ansible.com/" + $scope.module_name.value +
|
||||
"_module.html\" target=\"_blank\">here</a>.</p>";
|
||||
} else {
|
||||
// no module selected
|
||||
$scope.argsPopOver = "<p>These arguments are used with the"
|
||||
+ " specified module.</p>";
|
||||
$scope.argsPopOver = "<p>These arguments are used with the" +
|
||||
" specified module.</p>";
|
||||
}
|
||||
};
|
||||
|
||||
@ -127,7 +127,7 @@ export function AdhocForm($scope, $rootScope, $location, $routeParams,
|
||||
// populate data with the relevant form values
|
||||
for (fld in form.fields) {
|
||||
if (form.fields[fld].type === 'select') {
|
||||
data[fld] = $scope[fld].value
|
||||
data[fld] = $scope[fld].value;
|
||||
} else {
|
||||
data[fld] = $scope[fld];
|
||||
}
|
||||
@ -144,8 +144,8 @@ export function AdhocForm($scope, $rootScope, $location, $routeParams,
|
||||
})
|
||||
.error(function (data, status) {
|
||||
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
|
||||
msg: 'Failed to launch adhoc command. POST returned status: '
|
||||
+ status });
|
||||
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
|
||||
@ -167,7 +167,7 @@ export function AdhocForm($scope, $rootScope, $location, $routeParams,
|
||||
};
|
||||
}
|
||||
|
||||
AdhocForm.$inject = ['$scope', '$rootScope', '$location', '$routeParams',
|
||||
AdhocCtrl.$inject = ['$scope', '$rootScope', '$location', '$routeParams',
|
||||
'AdhocForm', 'GenerateForm', 'Rest', 'ProcessErrors', 'ClearScope',
|
||||
'GetBasePath', 'GetChoices', 'KindChange', 'LookUpInit', 'CredentialList',
|
||||
'Empty', 'OwnerChange', 'LoginMethodChange', 'Wait'];
|
||||
|
||||
@ -910,12 +910,12 @@ export function InventoriesManage ($log, $scope, $rootScope, $location,
|
||||
$scope.populateAdhocForm = function() {
|
||||
var host_patterns = "all";
|
||||
if ($scope.hostsSelected || $scope.groupsSelected) {
|
||||
var allSelectedItems = $scope.groupsSelectedItems.concat($scope.hostsSelectedItems)
|
||||
var allSelectedItems = $scope.groupsSelectedItems.concat($scope.hostsSelectedItems);
|
||||
host_patterns = _.pluck(allSelectedItems, "name").join(":");
|
||||
}
|
||||
$rootScope.hostPatterns = host_patterns;
|
||||
$location.path('/inventories/' + $scope.inventory.id + '/adhoc');
|
||||
}
|
||||
};
|
||||
|
||||
$scope.refreshHostsOnGroupRefresh = false;
|
||||
$scope.selected_group_id = null;
|
||||
|
||||
@ -24,12 +24,12 @@ export default
|
||||
label: 'Module',
|
||||
excludeModal: true,
|
||||
type: 'select',
|
||||
ngOptions: 'module.label for module in adhoc_module_options'
|
||||
+ ' track by module.value',
|
||||
ngOptions: 'module.label for module in adhoc_module_options' +
|
||||
' track by module.value',
|
||||
ngChange: 'moduleChange()',
|
||||
editRequired: true,
|
||||
awPopOver:'<p>These are the modules that Tower supports '
|
||||
+ 'running commands against.',
|
||||
awPopOver:'<p>These are the modules that Tower supports ' +
|
||||
'running commands against.',
|
||||
dataTitle: 'Module',
|
||||
dataPlacement: 'right',
|
||||
dataContainer: 'body'
|
||||
@ -50,13 +50,13 @@ export default
|
||||
type: 'text',
|
||||
addRequired: false,
|
||||
editRequired: false,
|
||||
awPopOver: '<p>The pattern used to target hosts in the '
|
||||
+ 'inventory. Leaving the field blank, all, and * will '
|
||||
+ 'all target all hosts in the inventory. You can find '
|
||||
+ 'more information about Ansible\'s host patterns '
|
||||
+ '<a id=\"adhoc_form_hostpatterns_doc_link\"'
|
||||
+ 'href=\"http://docs.ansible.com/intro_patterns.html\" '
|
||||
+ 'target=\"_blank\">here</a>.</p>',
|
||||
awPopOver: '<p>The pattern used to target hosts in the ' +
|
||||
'inventory. Leaving the field blank, all, and * will ' +
|
||||
'all target all hosts in the inventory. You can find ' +
|
||||
'more information about Ansible\'s host patterns ' +
|
||||
'<a id=\"adhoc_form_hostpatterns_doc_link\"' +
|
||||
'href=\"http://docs.ansible.com/intro_patterns.html\" ' +
|
||||
'target=\"_blank\">here</a>.</p>',
|
||||
dataTitle: 'Host Pattern',
|
||||
dataPlacement: 'right',
|
||||
dataContainer: 'body'
|
||||
@ -67,11 +67,11 @@ export default
|
||||
sourceModel: 'credential',
|
||||
sourceField: 'name',
|
||||
ngClick: 'lookUpCredential()',
|
||||
awPopOver: '<p>Select the credential you want to use when '
|
||||
+ 'accessing the remote hosts to run the command. '
|
||||
+ 'Choose the credential containing '
|
||||
+ 'the username and SSH key or password that Ansbile '
|
||||
+ 'will need to log into the remote hosts.</p>',
|
||||
awPopOver: '<p>Select the credential you want to use when ' +
|
||||
'accessing the remote hosts to run the command. ' +
|
||||
'Choose the credential containing ' +
|
||||
'the username and SSH key or password that Ansbile ' +
|
||||
'will need to log into the remote hosts.</p>',
|
||||
dataTitle: 'Credential',
|
||||
dataPlacement: 'right',
|
||||
dataContainer: 'body',
|
||||
|
||||
@ -43,7 +43,6 @@ export default
|
||||
var id = params.project_id,
|
||||
scope = params.scope.$new(),
|
||||
new_job_id,
|
||||
launch_url,
|
||||
html,
|
||||
url;
|
||||
|
||||
@ -63,9 +62,9 @@ export default
|
||||
.error(function (data, status) {
|
||||
ProcessErrors(scope, data, status,
|
||||
null, { hdr: 'Error!',
|
||||
msg: 'Call to ' + url
|
||||
+ ' failed. DELETE returned status: '
|
||||
+ status });
|
||||
msg: 'Call to ' + url +
|
||||
' failed. DELETE returned status: ' +
|
||||
status });
|
||||
});
|
||||
});
|
||||
|
||||
@ -124,8 +123,7 @@ export default
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function (data) {
|
||||
var new_job_id = data.id,
|
||||
launch_url = url;
|
||||
new_job_id = data.id;
|
||||
|
||||
scope.passwords_needed_to_start = data.passwords_needed_to_start;
|
||||
if (!Empty(data.passwords_needed_to_start) &&
|
||||
|
||||
@ -26,42 +26,42 @@ export default
|
||||
scope.projectrequired = false;
|
||||
html = "<dl>\n" +
|
||||
"<dt>Read</dt>\n" +
|
||||
"<dd>Only allow the user or team to view the inventory."
|
||||
+ "</dd>\n" +
|
||||
"<dd>Only allow the user or team to view the inventory." +
|
||||
"</dd>\n" +
|
||||
"<dt>Write</dt>\n" +
|
||||
"<dd>Allow the user or team to modify hosts and groups "
|
||||
+ "contained in the inventory, add new hosts and groups"
|
||||
+ ", and perform inventory sync operations.\n" +
|
||||
"<dd>Allow the user or team to modify hosts and groups " +
|
||||
"contained in the inventory, add new hosts and groups" +
|
||||
", and perform inventory sync operations.\n" +
|
||||
"<dt>Admin</dt>\n" +
|
||||
"<dd>Allow the user or team full access to the "
|
||||
+ "inventory. This includes reading, writing, deletion "
|
||||
+ "of the inventory, inventory sync operations, and "
|
||||
+ "the ability to execute commands on the inventory."
|
||||
+ "</dd>\n" +
|
||||
"<dd>Allow the user or team full access to the " +
|
||||
"inventory. This includes reading, writing, deletion " +
|
||||
"of the inventory, inventory sync operations, and " +
|
||||
"the ability to execute commands on the inventory." +
|
||||
"</dd>\n" +
|
||||
"<dt>Execute commands</dt>\n" +
|
||||
"<dd>Allow the user to execute commands on the "
|
||||
+ "inventory.</dd>\n" +
|
||||
"<dd>Allow the user to execute commands on the " +
|
||||
"inventory.</dd>\n" +
|
||||
"</dl>\n";
|
||||
scope.permissionTypeHelp = $sce.trustAsHtml(html);
|
||||
} else {
|
||||
scope.projectrequired = true;
|
||||
html = "<dl>\n" +
|
||||
"<dt>Create</dt>\n" +
|
||||
"<dd>Allow the user or team to create job templates. "
|
||||
+ "This implies that they have the Run and Check "
|
||||
+ "permissions.</dd>\n" +
|
||||
"<dd>Allow the user or team to create job templates. " +
|
||||
"This implies that they have the Run and Check " +
|
||||
"permissions.</dd>\n" +
|
||||
"<dt>Run</dt>\n" +
|
||||
"<dd>Allow the user or team to run a job template from "
|
||||
+ "the project against the inventory. In Run mode "
|
||||
+ "modules will " +
|
||||
"be executed, and changes to the inventory will occur."
|
||||
+ "</dd>\n" +
|
||||
"<dd>Allow the user or team to run a job template from " +
|
||||
"the project against the inventory. In Run mode " +
|
||||
"modules will " +
|
||||
"be executed, and changes to the inventory will occur." +
|
||||
"</dd>\n" +
|
||||
"<dt>Check</dt>\n" +
|
||||
"<dd>Only allow the user or team to run the project "
|
||||
+ "against the inventory as a dry-run operation. In "
|
||||
+ "Check mode, module operations " +
|
||||
"will only be simulated. No changes will occur."
|
||||
+ "</dd>\n" +
|
||||
"<dd>Only allow the user or team to run the project " +
|
||||
"against the inventory as a dry-run operation. In " +
|
||||
"Check mode, module operations " +
|
||||
"will only be simulated. No changes will occur." +
|
||||
"</dd>\n" +
|
||||
"</dl>\n";
|
||||
scope.permissionTypeHelp = $sce.trustAsHtml(html);
|
||||
}
|
||||
|
||||
@ -146,8 +146,8 @@ export default
|
||||
ngClick: 'updateGroup(group.id)',
|
||||
awToolTip: "{{ group.launch_tooltip }}",
|
||||
dataTipWatch: "group.launch_tooltip",
|
||||
ngShow: "group.status !== 'running' && group.status "
|
||||
+ "!== 'pending' && group.status !== 'updating'",
|
||||
ngShow: "group.status !== 'running' && group.status " +
|
||||
"!== 'pending' && group.status !== 'updating'",
|
||||
ngClass: "group.launch_class",
|
||||
dataPlacement: "top"
|
||||
},
|
||||
@ -157,8 +157,8 @@ export default
|
||||
ngClick: "cancelUpdate(group.id)",
|
||||
awToolTip: "Cancel sync process",
|
||||
'class': 'red-txt',
|
||||
ngShow: "group.status == 'running' || group.status == 'pending' "
|
||||
+ "|| group.status == 'updating'",
|
||||
ngShow: "group.status == 'running' || group.status == 'pending' " +
|
||||
"|| group.status == 'updating'",
|
||||
dataPlacement: "top"
|
||||
},
|
||||
edit: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user