mirror of
https://github.com/ansible/awx.git
synced 2026-03-03 17:51:06 -03:30
Only show the days to keep input on the scheduler for system jobs that require it. Hides this field for cleaning up tokens and sessions.
This commit is contained in:
@@ -31,7 +31,6 @@ export default
|
|||||||
};
|
};
|
||||||
getManagementJobs();
|
getManagementJobs();
|
||||||
|
|
||||||
$scope.cleanupJob = true;
|
|
||||||
// This handles the case where the user refreshes the management job notifications page.
|
// This handles the case where the user refreshes the management job notifications page.
|
||||||
if($state.current.name === 'managementJobsList.notifications') {
|
if($state.current.name === 'managementJobsList.notifications') {
|
||||||
$scope.activeCard = parseInt($state.params.management_id);
|
$scope.activeCard = parseInt($state.params.management_id);
|
||||||
|
|||||||
@@ -164,7 +164,7 @@
|
|||||||
ng-show="sheduler_frequency_error">
|
ng-show="sheduler_frequency_error">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group SchedulerForm-formGroup" ng-if="cleanupJob">
|
<div class="form-group SchedulerForm-formGroup" ng-if="askDaysToKeep">
|
||||||
<label class="Form-inputLabel">
|
<label class="Form-inputLabel">
|
||||||
<span class="red-text">*</span>
|
<span class="red-text">*</span>
|
||||||
<span translate>Days of data to keep</span>
|
<span translate>Days of data to keep</span>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export default
|
|||||||
scheduleData.rrule = RRuleToAPI(rrule.toString(), scope);
|
scheduleData.rrule = RRuleToAPI(rrule.toString(), scope);
|
||||||
scheduleData.description = (/error/.test(rrule.toText())) ? '' : rrule.toText();
|
scheduleData.description = (/error/.test(rrule.toText())) ? '' : rrule.toText();
|
||||||
|
|
||||||
if (scope.cleanupJob) {
|
if (scope.askDaysToKeep) {
|
||||||
extra_vars = {
|
extra_vars = {
|
||||||
"days" : scope.scheduler_form.schedulerPurgeDays.$viewValue
|
"days" : scope.scheduler_form.schedulerPurgeDays.$viewValue
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -347,7 +347,10 @@ export default ['$filter', '$state', '$stateParams', '$http', 'Wait',
|
|||||||
}
|
}
|
||||||
} else if (base === 'system_job_templates') {
|
} else if (base === 'system_job_templates') {
|
||||||
schedule_url = GetBasePath(base) + $stateParams.id + '/schedules/';
|
schedule_url = GetBasePath(base) + $stateParams.id + '/schedules/';
|
||||||
$scope.cleanupJob = true;
|
let parentJobType = _.get($scope.parentObject, 'job_type')
|
||||||
|
if (parentJobType !== 'cleanup_tokens' && parentJobType !== 'cleanup_sessions') {
|
||||||
|
$scope.askDaysToKeep = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Wait('start');
|
Wait('start');
|
||||||
|
|||||||
@@ -186,7 +186,10 @@ function($filter, $state, $stateParams, Wait, $scope, moment,
|
|||||||
|
|
||||||
if (_.has(schedule, 'summary_fields.unified_job_template.unified_job_type') &&
|
if (_.has(schedule, 'summary_fields.unified_job_template.unified_job_type') &&
|
||||||
schedule.summary_fields.unified_job_template.unified_job_type === 'system_job'){
|
schedule.summary_fields.unified_job_template.unified_job_type === 'system_job'){
|
||||||
$scope.cleanupJob = true;
|
let scheduleJobType = _.get(schedule.summary_fields.unified_job_template, 'job_type')
|
||||||
|
if (scheduleJobType !== 'cleanup_tokens' && scheduleJobType !== 'cleanup_sessions') {
|
||||||
|
$scope.askDaysToKeep = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.schedule_obj = scheduleResolve;
|
$scope.schedule_obj = scheduleResolve;
|
||||||
@@ -256,7 +259,7 @@ function($filter, $state, $stateParams, Wait, $scope, moment,
|
|||||||
$scope.noVars = true;
|
$scope.noVars = true;
|
||||||
scheduler.scope.timeZones = timezonesResolve;
|
scheduler.scope.timeZones = timezonesResolve;
|
||||||
scheduler.scope.schedulerTimeZone = scheduleResolve.timezone;
|
scheduler.scope.schedulerTimeZone = scheduleResolve.timezone;
|
||||||
if ($scope.cleanupJob){
|
if ($scope.askDaysToKeep){
|
||||||
$scope.schedulerPurgeDays = Number(schedule.extra_data.days);
|
$scope.schedulerPurgeDays = Number(schedule.extra_data.days);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user