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