mirror of
https://github.com/ansible/awx.git
synced 2026-05-25 01:27:45 -02:30
adding launch button for scan jobs
on inventory properties page. I also adjusted the indentation on the job submission page so that it was completly crazy.
This commit is contained in:
@@ -482,7 +482,7 @@ InventoriesAdd.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log
|
||||
|
||||
export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm, GenerateForm, Rest,
|
||||
Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit, PaginateInit,
|
||||
LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON, ParseVariableString, Stream, RelatedSearchInit, RelatedPaginateInit, Prompt) {
|
||||
LookUpInit, GetBasePath, ParseTypeChange, Wait, ToJSON, ParseVariableString, Stream, RelatedSearchInit, RelatedPaginateInit, Prompt, PlaybookRun) {
|
||||
|
||||
ClearScope();
|
||||
|
||||
@@ -660,6 +660,10 @@ export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $
|
||||
$location.path($location.path()+'/job_templates/add');
|
||||
};
|
||||
|
||||
$scope.launchScanJob = function(){
|
||||
PlaybookRun({ scope: $scope, id: this.scan_job_template.id });
|
||||
};
|
||||
|
||||
$scope.editScanJob = function(){
|
||||
$location.path($location.path()+'/job_templates/'+this.scan_job_template.id);
|
||||
};
|
||||
@@ -694,7 +698,7 @@ export function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $
|
||||
|
||||
InventoriesEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm', 'GenerateForm',
|
||||
'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'generateList', 'OrganizationList', 'SearchInit',
|
||||
'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', 'ParseVariableString', 'Stream', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt'
|
||||
'PaginateInit', 'LookUpInit', 'GetBasePath', 'ParseTypeChange', 'Wait', 'ToJSON', 'ParseVariableString', 'Stream', 'RelatedSearchInit', 'RelatedPaginateInit', 'Prompt', 'PlaybookRun'
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -125,6 +125,12 @@ export default
|
||||
},
|
||||
|
||||
fieldActions: {
|
||||
submit: {
|
||||
label: 'Launch',
|
||||
ngClick: "launchScanJob()",
|
||||
awToolTip: 'Launch the scan job template',
|
||||
'class': 'btn btn-default'
|
||||
},
|
||||
edit: {
|
||||
label: 'Edit',
|
||||
ngClick: "editScanJob()",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*********************************************
|
||||
* Copyright (c) 2014 AnsibleWorks, Inc.
|
||||
*
|
||||
* JobSubmission.js
|
||||
*
|
||||
*/
|
||||
* Copyright (c) 2014 AnsibleWorks, Inc.
|
||||
*
|
||||
* JobSubmission.js
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @ngdoc function
|
||||
* @name helpers.function:JobSubmission
|
||||
@@ -13,10 +13,10 @@
|
||||
|
||||
export default
|
||||
angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'CredentialFormDefinition', 'CredentialsListDefinition',
|
||||
'LookUpHelper', 'JobSubmissionHelper', 'JobTemplateFormDefinition', 'ModalDialog', 'FormGenerator', 'JobVarsPromptFormDefinition'])
|
||||
'LookUpHelper', 'JobSubmissionHelper', 'JobTemplateFormDefinition', 'ModalDialog', 'FormGenerator', 'JobVarsPromptFormDefinition'])
|
||||
|
||||
.factory('LaunchJob', ['Rest', 'Wait', 'ProcessErrors', 'ToJSON', 'Empty', 'GetBasePath',
|
||||
function(Rest, Wait, ProcessErrors, ToJSON, Empty, GetBasePath) {
|
||||
.factory('LaunchJob', ['Rest', 'Wait', 'ProcessErrors', 'ToJSON', 'Empty', 'GetBasePath',
|
||||
function(Rest, Wait, ProcessErrors, ToJSON, Empty, GetBasePath) {
|
||||
return function(params) {
|
||||
var scope = params.scope,
|
||||
callback = params.callback || 'JobLaunched',
|
||||
@@ -124,10 +124,10 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
|
||||
|
||||
|
||||
};
|
||||
}])
|
||||
}])
|
||||
|
||||
.factory('PromptForCredential', ['$location', 'Wait', 'GetBasePath', 'LookUpInit', 'JobTemplateForm', 'CredentialList', 'Rest', 'Prompt', 'ProcessErrors',
|
||||
function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialList, Rest, Prompt, ProcessErrors) {
|
||||
.factory('PromptForCredential', ['$location', 'Wait', 'GetBasePath', 'LookUpInit', 'JobTemplateForm', 'CredentialList', 'Rest', 'Prompt', 'ProcessErrors',
|
||||
function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialList, Rest, Prompt, ProcessErrors) {
|
||||
return function(params) {
|
||||
|
||||
var scope = params.scope,
|
||||
@@ -192,13 +192,13 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
|
||||
msg: 'Checking for machine credentials failed. GET returned: ' + status });
|
||||
});
|
||||
};
|
||||
}])
|
||||
}])
|
||||
|
||||
|
||||
|
||||
.factory('CreateLaunchDialog', ['$compile', 'Rest', 'GetBasePath', 'TextareaResize', 'CreateDialog', 'GenerateForm',
|
||||
'JobVarsPromptForm', 'Wait', 'ParseTypeChange',
|
||||
function($compile, Rest, GetBasePath, TextareaResize,CreateDialog, GenerateForm,
|
||||
.factory('CreateLaunchDialog', ['$compile', 'Rest', 'GetBasePath', 'TextareaResize', 'CreateDialog', 'GenerateForm',
|
||||
'JobVarsPromptForm', 'Wait', 'ParseTypeChange',
|
||||
function($compile, Rest, GetBasePath, TextareaResize,CreateDialog, GenerateForm,
|
||||
JobVarsPromptForm, Wait, ParseTypeChange) {
|
||||
return function(params) {
|
||||
var buttons,
|
||||
@@ -676,7 +676,7 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
|
||||
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name helpers.function:JobSubmission#PlaybookRun
|
||||
* @methodOf helpers.function:JobSubmission
|
||||
@@ -700,7 +700,7 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
|
||||
launch_url,
|
||||
html;
|
||||
scope.job_template_id = id;
|
||||
if (base === 'job_templates' || base === 'portal') {
|
||||
if (base === 'job_templates' || base === 'portal' || base === 'inventories') {
|
||||
url = GetBasePath('job_templates') + id + '/launch/';
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user