mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -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:
commit
decd9da058
@ -198,7 +198,7 @@ class JobTemplate(UnifiedJobTemplate, JobOptions):
|
||||
def _get_unified_job_field_names(cls):
|
||||
return ['name', 'description', 'job_type', 'inventory', 'project',
|
||||
'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']
|
||||
|
||||
def create_job(self, **kwargs):
|
||||
|
||||
@ -301,7 +301,7 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique):
|
||||
continue
|
||||
# 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:
|
||||
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
|
||||
create_kwargs[field_name] = getattr(self, field_name)
|
||||
kwargs = self._update_unified_job_kwargs(**create_kwargs)
|
||||
|
||||
@ -16,9 +16,9 @@
|
||||
angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog',
|
||||
'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',
|
||||
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) {
|
||||
return function(params) {
|
||||
// Set modal dimensions based on viewport width
|
||||
@ -28,7 +28,7 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules
|
||||
callback = 'OpenConfig',
|
||||
defaultUrl = GetBasePath('system_job_templates'),
|
||||
list = ConfigureTowerJobsList,
|
||||
view = GenerateList,
|
||||
view = GenerateList, e,
|
||||
scheduleUrl = GetBasePath('system_job_templates'),
|
||||
buttons = [
|
||||
{
|
||||
@ -147,7 +147,12 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules
|
||||
minWidth: 200,
|
||||
callback: 'PromptForDays',
|
||||
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: [{
|
||||
"label": "Cancel",
|
||||
@ -157,11 +162,11 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules
|
||||
},
|
||||
"icon": "fa-times",
|
||||
"class": "btn btn-default",
|
||||
"id": "prompt-for-days-button"
|
||||
"id": "prompt-for-days-cancel"
|
||||
},{
|
||||
"label": "Launch",
|
||||
"onClick": function() {
|
||||
var extra_vars = {"days": $("#days_to_keep").val() },
|
||||
var extra_vars = {"days": scope.days_to_keep },
|
||||
data = {};
|
||||
data.extra_vars = JSON.stringify(extra_vars);
|
||||
|
||||
@ -171,6 +176,7 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules
|
||||
Wait('stop');
|
||||
$("#prompt-for-days").dialog("close");
|
||||
$("#configure-tower-dialog").dialog('close');
|
||||
$location.path('/jobs/');
|
||||
})
|
||||
.error(function(data, status) {
|
||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||
@ -179,7 +185,7 @@ angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'Schedules
|
||||
},
|
||||
"icon": "fa-rocket",
|
||||
"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({
|
||||
id: 'custom-script-dialog',
|
||||
title: 'Inventory Script',
|
||||
title: 'Inventory Scripts',
|
||||
target: 'custom-script-dialog',
|
||||
scope: scope,
|
||||
buttons: buttons,
|
||||
@ -297,7 +297,7 @@ function($compile, CustomInventoryList, Rest, Wait, GenerateList, CustomInventor
|
||||
|
||||
SearchInit({
|
||||
scope: scope,
|
||||
set: 'custum_inventories',
|
||||
set: 'custom_inventories',
|
||||
list: list,
|
||||
url: url
|
||||
});
|
||||
@ -308,6 +308,7 @@ function($compile, CustomInventoryList, Rest, Wait, GenerateList, CustomInventor
|
||||
});
|
||||
|
||||
scope.search(list.iterator);
|
||||
|
||||
Wait('stop');
|
||||
|
||||
})
|
||||
|
||||
@ -1174,6 +1174,7 @@ function($compile, SchedulerInit, Rest, Wait, SetSchedulesInnerDialogSize, Sched
|
||||
|
||||
var parseError = false,
|
||||
regions, r, i,
|
||||
group_by,
|
||||
data = {
|
||||
group: group_id,
|
||||
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')) {
|
||||
data.instance_filters = sources_scope.instance_filters;
|
||||
// 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 = [];
|
||||
for (i = 0; i < group_by.length; i++) {
|
||||
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+='</form>';
|
||||
$('#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'));
|
||||
$compile(e)(scope);
|
||||
|
||||
|
||||
@ -633,16 +633,17 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
|
||||
};
|
||||
|
||||
scope.typeChange = function() {
|
||||
// alert('typechange');
|
||||
scope.default = null;
|
||||
scope.default_multiselect = null;
|
||||
scope.default_float = null;
|
||||
scope.default_int = null;
|
||||
scope.default_textarea = null;
|
||||
scope.int_min = null;
|
||||
scope.int_max = null;
|
||||
scope.float_min = null;
|
||||
scope.float_max = null;
|
||||
scope.default = "";
|
||||
scope.default_multiselect = "";
|
||||
scope.default_float = "";
|
||||
scope.default_int = "";
|
||||
scope.default_textarea = "";
|
||||
scope.survey_question_form.choices.$setPristine();
|
||||
scope.choices = "";
|
||||
scope.int_min = "";
|
||||
scope.int_max = "";
|
||||
scope.float_min = "";
|
||||
scope.float_max = "";
|
||||
};
|
||||
|
||||
scope.submitQuestion = function(){
|
||||
|
||||
@ -103,7 +103,9 @@ angular.module('VariablesHelper', ['Utilities'])
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
|
||||
if(variables=== ""){
|
||||
variables = '---';
|
||||
}
|
||||
json_data = jsyaml.load(variables);
|
||||
if(json_data!==null){
|
||||
$.each( json_data, function( key, value ) {
|
||||
|
||||
@ -24,3 +24,4 @@
|
||||
</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_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 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_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>
|
||||
@ -242,7 +242,7 @@
|
||||
<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_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_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>
|
||||
@ -262,7 +262,7 @@
|
||||
<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_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="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>
|
||||
@ -425,8 +425,10 @@
|
||||
<div id="prompt-for-days" style="display:none">
|
||||
<form name="prompt_for_days_form" id="prompt_for_days_form">
|
||||
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;">
|
||||
<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>
|
||||
<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 && 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>
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user