mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
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:
parent
632810f3a8
commit
7e82f0fad7
@ -31,7 +31,6 @@ export default
|
||||
};
|
||||
getManagementJobs();
|
||||
|
||||
$scope.cleanupJob = true;
|
||||
// This handles the case where the user refreshes the management job notifications page.
|
||||
if($state.current.name === 'managementJobsList.notifications') {
|
||||
$scope.activeCard = parseInt($state.params.management_id);
|
||||
|
@ -164,7 +164,7 @@
|
||||
ng-show="sheduler_frequency_error">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group SchedulerForm-formGroup" ng-if="cleanupJob">
|
||||
<div class="form-group SchedulerForm-formGroup" ng-if="askDaysToKeep">
|
||||
<label class="Form-inputLabel">
|
||||
<span class="red-text">*</span>
|
||||
<span translate>Days of data to keep</span>
|
||||
|
@ -18,7 +18,7 @@ export default
|
||||
scheduleData.rrule = RRuleToAPI(rrule.toString(), scope);
|
||||
scheduleData.description = (/error/.test(rrule.toText())) ? '' : rrule.toText();
|
||||
|
||||
if (scope.cleanupJob) {
|
||||
if (scope.askDaysToKeep) {
|
||||
extra_vars = {
|
||||
"days" : scope.scheduler_form.schedulerPurgeDays.$viewValue
|
||||
};
|
||||
|
@ -347,7 +347,10 @@ export default ['$filter', '$state', '$stateParams', '$http', 'Wait',
|
||||
}
|
||||
} else if (base === 'system_job_templates') {
|
||||
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');
|
||||
|
@ -186,7 +186,10 @@ function($filter, $state, $stateParams, Wait, $scope, moment,
|
||||
|
||||
if (_.has(schedule, 'summary_fields.unified_job_template.unified_job_type') &&
|
||||
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;
|
||||
@ -256,7 +259,7 @@ function($filter, $state, $stateParams, Wait, $scope, moment,
|
||||
$scope.noVars = true;
|
||||
scheduler.scope.timeZones = timezonesResolve;
|
||||
scheduler.scope.schedulerTimeZone = scheduleResolve.timezone;
|
||||
if ($scope.cleanupJob){
|
||||
if ($scope.askDaysToKeep){
|
||||
$scope.schedulerPurgeDays = Number(schedule.extra_data.days);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user