mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
Clean up jobs
Made the prompt for days field required when submitting a cleanup job.
This commit is contained in:
parent
a71e787eab
commit
0c10581ecd
@ -16,9 +16,9 @@
|
||||
angular.module('ConfigureTowerHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', 'ListGenerator', 'ModalDialog',
|
||||
'GeneratorHelpers'])
|
||||
|
||||
.factory('ConfigureTower', ['Wait', '$location' , '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, $location, 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);
|
||||
|
||||
@ -180,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"
|
||||
}]
|
||||
});
|
||||
|
||||
|
||||
@ -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