mirror of
https://github.com/ansible/awx.git
synced 2026-02-19 12:10:06 -03:30
Merge branch 'master' into reintroduce-zeromq-unstable
* master: Fix a bug where listing the unified job fields did not include the 'launch_type' parameter, causing failing unit tests Inventory Scripts Extra var parsing Clean up jobs Cleanup jobs redirect to jobs page Custom inventory : Edit Portal credential modal needed Fix a bug in how I'm handling ids when creating a unified job as part of the launch process Survey Maker JS Hint errors
This commit is contained in:
@@ -198,7 +198,7 @@ class JobTemplate(UnifiedJobTemplate, JobOptions):
|
|||||||
def _get_unified_job_field_names(cls):
|
def _get_unified_job_field_names(cls):
|
||||||
return ['name', 'description', 'job_type', 'inventory', 'project',
|
return ['name', 'description', 'job_type', 'inventory', 'project',
|
||||||
'playbook', 'credential', 'cloud_credential', 'forks',
|
'playbook', 'credential', 'cloud_credential', 'forks',
|
||||||
'limit', 'verbosity', 'extra_vars', 'job_tags',
|
'limit', 'verbosity', 'extra_vars', 'job_tags', 'launch_type',
|
||||||
'force_handlers', 'skip_tags', 'start_at_task']
|
'force_handlers', 'skip_tags', 'start_at_task']
|
||||||
|
|
||||||
def create_job(self, **kwargs):
|
def create_job(self, **kwargs):
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique):
|
|||||||
continue
|
continue
|
||||||
# Foreign keys can be specified as field_name or field_name_id.
|
# Foreign keys can be specified as field_name or field_name_id.
|
||||||
if hasattr(self, '%s_id' % field_name) and ('%s_id' % field_name) in kwargs:
|
if hasattr(self, '%s_id' % field_name) and ('%s_id' % field_name) in kwargs:
|
||||||
create_kwargs['%s_id' % field_name] = kwargs['%s_id' % field_name] = kwargs[field_name]
|
create_kwargs['%s_id' % field_name] = kwargs['%s_id' % field_name] = kwargs["%s_id" % field_name]
|
||||||
continue
|
continue
|
||||||
create_kwargs[field_name] = getattr(self, field_name)
|
create_kwargs[field_name] = getattr(self, field_name)
|
||||||
kwargs = self._update_unified_job_kwargs(**create_kwargs)
|
kwargs = self._update_unified_job_kwargs(**create_kwargs)
|
||||||
|
|||||||
@@ -16,9 +16,9 @@
|
|||||||
angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog',
|
angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog',
|
||||||
'GeneratorHelpers'])
|
'GeneratorHelpers'])
|
||||||
|
|
||||||
.factory('ConfigureTower', ['Wait', 'CreateDialog', 'ConfigureTowerJobsList', 'GenerateList', 'GetBasePath' , 'SearchInit' , 'PaginateInit', 'PlaybookRun', 'LoadSchedulesScope',
|
.factory('ConfigureTower', ['Wait', '$location' , '$compile', 'CreateDialog', 'ConfigureTowerJobsList', 'GenerateList', 'GetBasePath' , 'SearchInit' , 'PaginateInit', 'PlaybookRun', 'LoadSchedulesScope',
|
||||||
'SchedulesList', 'SchedulesControllerInit' , 'ConfigureTowerSchedule', 'Rest' , 'ProcessErrors',
|
'SchedulesList', 'SchedulesControllerInit' , 'ConfigureTowerSchedule', 'Rest' , 'ProcessErrors',
|
||||||
function(Wait, CreateDialog, ConfigureTowerJobsList, GenerateList, GetBasePath, SearchInit, PaginateInit, PlaybookRun, LoadSchedulesScope,
|
function(Wait, $location, $compile, CreateDialog, ConfigureTowerJobsList, GenerateList, GetBasePath, SearchInit, PaginateInit, PlaybookRun, LoadSchedulesScope,
|
||||||
SchedulesList, SchedulesControllerInit, ConfigureTowerSchedule, Rest, ProcessErrors) {
|
SchedulesList, SchedulesControllerInit, ConfigureTowerSchedule, Rest, ProcessErrors) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
// Set modal dimensions based on viewport width
|
// Set modal dimensions based on viewport width
|
||||||
@@ -28,7 +28,7 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules
|
|||||||
callback = 'OpenConfig',
|
callback = 'OpenConfig',
|
||||||
defaultUrl = GetBasePath('system_job_templates'),
|
defaultUrl = GetBasePath('system_job_templates'),
|
||||||
list = ConfigureTowerJobsList,
|
list = ConfigureTowerJobsList,
|
||||||
view = GenerateList,
|
view = GenerateList, e,
|
||||||
scheduleUrl = GetBasePath('system_job_templates'),
|
scheduleUrl = GetBasePath('system_job_templates'),
|
||||||
buttons = [
|
buttons = [
|
||||||
{
|
{
|
||||||
@@ -147,7 +147,12 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules
|
|||||||
minWidth: 200,
|
minWidth: 200,
|
||||||
callback: 'PromptForDays',
|
callback: 'PromptForDays',
|
||||||
onOpen: function(){
|
onOpen: function(){
|
||||||
$("#days_to_keep").val(30);
|
e = angular.element(document.getElementById('prompt_for_days_form'));
|
||||||
|
scope.prompt_for_days_form.days_to_keep.$setViewValue(30);
|
||||||
|
$compile(e)(scope);
|
||||||
|
$('#prompt-for-days-launch').attr("ng-disabled", 'prompt_for_days_form.$invalid');
|
||||||
|
e = angular.element(document.getElementById('prompt-for-days-launch'));
|
||||||
|
$compile(e)(scope);
|
||||||
},
|
},
|
||||||
buttons: [{
|
buttons: [{
|
||||||
"label": "Cancel",
|
"label": "Cancel",
|
||||||
@@ -157,11 +162,11 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules
|
|||||||
},
|
},
|
||||||
"icon": "fa-times",
|
"icon": "fa-times",
|
||||||
"class": "btn btn-default",
|
"class": "btn btn-default",
|
||||||
"id": "prompt-for-days-button"
|
"id": "prompt-for-days-cancel"
|
||||||
},{
|
},{
|
||||||
"label": "Launch",
|
"label": "Launch",
|
||||||
"onClick": function() {
|
"onClick": function() {
|
||||||
var extra_vars = {"days": $("#days_to_keep").val() },
|
var extra_vars = {"days": scope.days_to_keep },
|
||||||
data = {};
|
data = {};
|
||||||
data.extra_vars = JSON.stringify(extra_vars);
|
data.extra_vars = JSON.stringify(extra_vars);
|
||||||
|
|
||||||
@@ -171,6 +176,7 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules
|
|||||||
Wait('stop');
|
Wait('stop');
|
||||||
$("#prompt-for-days").dialog("close");
|
$("#prompt-for-days").dialog("close");
|
||||||
$("#configure-tower-dialog").dialog('close');
|
$("#configure-tower-dialog").dialog('close');
|
||||||
|
$location.path('/jobs/');
|
||||||
})
|
})
|
||||||
.error(function(data, status) {
|
.error(function(data, status) {
|
||||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||||
@@ -179,7 +185,7 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules
|
|||||||
},
|
},
|
||||||
"icon": "fa-rocket",
|
"icon": "fa-rocket",
|
||||||
"class": "btn btn-primary",
|
"class": "btn btn-primary",
|
||||||
"id": "prompt-for-days-button"
|
"id": "prompt-for-days-launch"
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ angular.module('CreateCustomInventoryHelper', [ 'Utilities', 'RestServices', 'Sc
|
|||||||
|
|
||||||
CreateDialog({
|
CreateDialog({
|
||||||
id: 'custom-script-dialog',
|
id: 'custom-script-dialog',
|
||||||
title: 'Inventory Script',
|
title: 'Inventory Scripts',
|
||||||
target: 'custom-script-dialog',
|
target: 'custom-script-dialog',
|
||||||
scope: scope,
|
scope: scope,
|
||||||
buttons: buttons,
|
buttons: buttons,
|
||||||
@@ -297,7 +297,7 @@ function($compile, CustomInventoryList, Rest, Wait, GenerateList, CustomInventor
|
|||||||
|
|
||||||
SearchInit({
|
SearchInit({
|
||||||
scope: scope,
|
scope: scope,
|
||||||
set: 'custum_inventories',
|
set: 'custom_inventories',
|
||||||
list: list,
|
list: list,
|
||||||
url: url
|
url: url
|
||||||
});
|
});
|
||||||
@@ -308,6 +308,7 @@ function($compile, CustomInventoryList, Rest, Wait, GenerateList, CustomInventor
|
|||||||
});
|
});
|
||||||
|
|
||||||
scope.search(list.iterator);
|
scope.search(list.iterator);
|
||||||
|
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1174,6 +1174,7 @@ function($compile, SchedulerInit, Rest, Wait, SetSchedulesInnerDialogSize, Sched
|
|||||||
|
|
||||||
var parseError = false,
|
var parseError = false,
|
||||||
regions, r, i,
|
regions, r, i,
|
||||||
|
group_by,
|
||||||
data = {
|
data = {
|
||||||
group: group_id,
|
group: group_id,
|
||||||
source: ((sources_scope.source && sources_scope.source.value) ? sources_scope.source.value : ''),
|
source: ((sources_scope.source && sources_scope.source.value) ? sources_scope.source.value : ''),
|
||||||
@@ -1197,7 +1198,7 @@ function($compile, SchedulerInit, Rest, Wait, SetSchedulesInnerDialogSize, Sched
|
|||||||
if (sources_scope.source && (sources_scope.source.value === 'ec2')) {
|
if (sources_scope.source && (sources_scope.source.value === 'ec2')) {
|
||||||
data.instance_filters = sources_scope.instance_filters;
|
data.instance_filters = sources_scope.instance_filters;
|
||||||
// Create a string out of selected list of regions
|
// Create a string out of selected list of regions
|
||||||
var group_by = $('#s2id_source_group_by').select2("data");
|
group_by = $('#s2id_source_group_by').select2("data");
|
||||||
r = [];
|
r = [];
|
||||||
for (i = 0; i < group_by.length; i++) {
|
for (i = 0; i < group_by.length; i++) {
|
||||||
r.push(group_by[i].id);
|
r.push(group_by[i].id);
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
|
|||||||
// html+='<br>job_launch_form.$valid = {{job_launch_form.$valid}}<br>';
|
// html+='<br>job_launch_form.$valid = {{job_launch_form.$valid}}<br>';
|
||||||
html+='</form>';
|
html+='</form>';
|
||||||
$('#password-modal').empty().html(html);
|
$('#password-modal').empty().html(html);
|
||||||
$('#password-modal').find('textarea').before(scope.helpContainer);
|
$('#password-modal').find('#job_extra_vars').before(scope.helpContainer);
|
||||||
e = angular.element(document.getElementById('password-modal'));
|
e = angular.element(document.getElementById('password-modal'));
|
||||||
$compile(e)(scope);
|
$compile(e)(scope);
|
||||||
|
|
||||||
|
|||||||
@@ -633,16 +633,17 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
|
|||||||
};
|
};
|
||||||
|
|
||||||
scope.typeChange = function() {
|
scope.typeChange = function() {
|
||||||
// alert('typechange');
|
scope.default = "";
|
||||||
scope.default = null;
|
scope.default_multiselect = "";
|
||||||
scope.default_multiselect = null;
|
scope.default_float = "";
|
||||||
scope.default_float = null;
|
scope.default_int = "";
|
||||||
scope.default_int = null;
|
scope.default_textarea = "";
|
||||||
scope.default_textarea = null;
|
scope.survey_question_form.choices.$setPristine();
|
||||||
scope.int_min = null;
|
scope.choices = "";
|
||||||
scope.int_max = null;
|
scope.int_min = "";
|
||||||
scope.float_min = null;
|
scope.int_max = "";
|
||||||
scope.float_max = null;
|
scope.float_min = "";
|
||||||
|
scope.float_max = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
scope.submitQuestion = function(){
|
scope.submitQuestion = function(){
|
||||||
|
|||||||
@@ -103,7 +103,9 @@ angular.module('VariablesHelper', ['Utilities'])
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
if(variables=== ""){
|
||||||
|
variables = '---';
|
||||||
|
}
|
||||||
json_data = jsyaml.load(variables);
|
json_data = jsyaml.load(variables);
|
||||||
if(json_data!==null){
|
if(json_data!==null){
|
||||||
$.each( json_data, function( key, value ) {
|
$.each( json_data, function( key, value ) {
|
||||||
|
|||||||
@@ -24,3 +24,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="lookup-modal-dialog" style="display:none"> </div>
|
||||||
|
|||||||
@@ -200,7 +200,7 @@
|
|||||||
<a href="" id="mobile_about" ng-click ="viewAboutTower()" ng-hide="portalMode===true">About Tower</a> </li>
|
<a href="" id="mobile_about" ng-click ="viewAboutTower()" ng-hide="portalMode===true">About Tower</a> </li>
|
||||||
<a href="" id="mobile_view_user" ng-click="viewCurrentUser()" ng-hide="portalMode===true">Account Settings</a></li>
|
<a href="" id="mobile_view_user" ng-click="viewCurrentUser()" ng-hide="portalMode===true">Account Settings</a></li>
|
||||||
<a href="https://ansibleworks.zendesk.com/anonymous_requests/new" id="mobile_contact_support" target="_blank" ng-hide="portalMode===true">Contact Support</a></li>
|
<a href="https://ansibleworks.zendesk.com/anonymous_requests/new" id="mobile_contact_support" target="_blank" ng-hide="portalMode===true">Contact Support</a></li>
|
||||||
<a id="mobile_custom_inv" ng-click="createCustomInv()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Inventory Script</a></li>
|
<a id="mobile_custom_inv" ng-click="createCustomInv()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Inventory Scripts</a></li>
|
||||||
<a id="mobile_configure_tower" ng-click="configureTower()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Management Jobs</a></li>
|
<a id="mobile_configure_tower" ng-click="configureTower()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Management Jobs</a></li>
|
||||||
<a id="mobile_munin" target="_blank" ng-show="user_is_superuser" href="/munin" ng-hide="portalMode===true">Monitor Tower</a></li>
|
<a id="mobile_munin" target="_blank" ng-show="user_is_superuser" href="/munin" ng-hide="portalMode===true">Monitor Tower</a></li>
|
||||||
<a href="#portal" id="mobile_portal_link" ng-hide="portalMode===true">Portal Mode</a></li>
|
<a href="#portal" id="mobile_portal_link" ng-hide="portalMode===true">Portal Mode</a></li>
|
||||||
@@ -242,7 +242,7 @@
|
|||||||
<li><a href="" id="main_about" ng-click ="viewAboutTower()" ng-hide="portalMode===true">About Tower</a> </li>
|
<li><a href="" id="main_about" ng-click ="viewAboutTower()" ng-hide="portalMode===true">About Tower</a> </li>
|
||||||
<li><a id="main_view_user" href="" ng-click="viewCurrentUser()" ng-hide="portalMode===true">Account Settings</a></li>
|
<li><a id="main_view_user" href="" ng-click="viewCurrentUser()" ng-hide="portalMode===true">Account Settings</a></li>
|
||||||
<li><a id="main_contact_support" target="_blank" href="https://ansibleworks.zendesk.com/anonymous_requests/new" ng-hide="portalMode===true">Contact Support</a></li>
|
<li><a id="main_contact_support" target="_blank" href="https://ansibleworks.zendesk.com/anonymous_requests/new" ng-hide="portalMode===true">Contact Support</a></li>
|
||||||
<li> <a id="main_custom_inv" ng-click="createCustomInv()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Inventory Script</a></li>
|
<li> <a id="main_custom_inv" ng-click="createCustomInv()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Inventory Scripts</a></li>
|
||||||
<li><a id="main_configure_tower" ng-click="configureTower()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Management Jobs</a></li>
|
<li><a id="main_configure_tower" ng-click="configureTower()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Management Jobs</a></li>
|
||||||
<li><a id="main_munin" target="_blank" ng-show="user_is_superuser" href="/munin" ng-hide="portalMode===true">Monitor Tower</a></li>
|
<li><a id="main_munin" target="_blank" ng-show="user_is_superuser" href="/munin" ng-hide="portalMode===true">Monitor Tower</a></li>
|
||||||
<li><a href="#portal" id="main_view_portal_link" >Portal Mode</a></li>
|
<li><a href="#portal" id="main_view_portal_link" >Portal Mode</a></li>
|
||||||
@@ -262,7 +262,7 @@
|
|||||||
<li><a href="" id="main_about" ng-click ="viewAboutTower()" ng-hide="portalMode===true">About Tower</a> </li>
|
<li><a href="" id="main_about" ng-click ="viewAboutTower()" ng-hide="portalMode===true">About Tower</a> </li>
|
||||||
<li><a id="main_view_user" href="" ng-click="viewCurrentUser()" ng-hide="portalMode===true">Account Settings</a></li>
|
<li><a id="main_view_user" href="" ng-click="viewCurrentUser()" ng-hide="portalMode===true">Account Settings</a></li>
|
||||||
<li><a id="main_contact_support" target="_blank" href="https://ansibleworks.zendesk.com/anonymous_requests/new" ng-hide="portalMode===true">Contact Support</a></li>
|
<li><a id="main_contact_support" target="_blank" href="https://ansibleworks.zendesk.com/anonymous_requests/new" ng-hide="portalMode===true">Contact Support</a></li>
|
||||||
<li> <a id="main_custom_inv" ng-click="createCustomInv()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Inventory Script</a></li>
|
<li> <a id="main_custom_inv" ng-click="createCustomInv()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Inventory Scripts</a></li>
|
||||||
<li><a id="configure_tower" ng-click="configureTower()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Management Jobs</a></li>
|
<li><a id="configure_tower" ng-click="configureTower()" ng-show="user_is_superuser" href="" ng-hide="portalMode===true">Management Jobs</a></li>
|
||||||
<li><a id="main_munin" target="_blank" ng-show="user_is_superuser" href="/munin" ng-hide="portalMode===true">Monitor Tower</a></li>
|
<li><a id="main_munin" target="_blank" ng-show="user_is_superuser" href="/munin" ng-hide="portalMode===true">Monitor Tower</a></li>
|
||||||
<li><a href="#portal" id="main_view_portal_link" ng-hide="portalMode===true">Portal Mode</a></li>
|
<li><a href="#portal" id="main_view_portal_link" ng-hide="portalMode===true">Portal Mode</a></li>
|
||||||
@@ -425,8 +425,10 @@
|
|||||||
<div id="prompt-for-days" style="display:none">
|
<div id="prompt-for-days" style="display:none">
|
||||||
<form name="prompt_for_days_form" id="prompt_for_days_form">
|
<form name="prompt_for_days_form" id="prompt_for_days_form">
|
||||||
How many days of data would you like to <b>keep</b>? <br>
|
How many days of data would you like to <b>keep</b>? <br>
|
||||||
<input type="number" min="1" id="days_to_keep" name="days_to_keep" value="30" ng-required="true" class="form-control ng-pristine ng-invalid-required ng-invalid" style="margin-top:10px;">
|
<input type="number" min="1"value=30 id="days_to_keep" name="days_to_keep" ng-model="days_to_keep" ng-required="true" class="form-control" ng-min=1 style="margin-top:10px;"></input>
|
||||||
<div class="error" ng-show="prompt_for_days_form.days_to_keep.$dirty && copy_form.new_copy_name.$error.required">A value is required!</div></input>
|
<div class="error" ng-show="prompt_for_days_form.days_to_keep.$dirty && prompt_for_days_form.days_to_keep.$error.required">A value is required!</div>
|
||||||
|
<div class="error survey_error" ng-show="prompt_for_days_form.days_to_keep.$error.ngMin"> The value must be more than 1!</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user