mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 02:50:02 -03:30
fixed cleanup schedules
This commit is contained in:
parent
29cd31b3d4
commit
2d347d7069
@ -480,32 +480,34 @@ export default
|
||||
container.show('slide', { direction: 'right' }, 300);
|
||||
// scope.schedulerPurgeDays = (!Empty(scope.days)) ? Number(scope.days) : 30;
|
||||
target.show();
|
||||
scope.$watch('scheduler_form.keep_amount.$modelValue', function(newVal) {
|
||||
if (!newVal && newVal !== 0) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else if (isNaN(newVal)) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else if (newVal < 0) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else if (newVal > 9999) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else {
|
||||
$('#configure-save-button').prop("disabled", false);
|
||||
}
|
||||
});
|
||||
scope.$watch('scheduler_form.granularity_keep_amount.$modelValue', function(newVal2) {
|
||||
if (!newVal2 && newVal2 !== 0) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else if (isNaN(newVal2)) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else if (newVal2 < 0) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else if (newVal2 > 9999) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else {
|
||||
$('#configure-save-button').prop("disabled", false);
|
||||
}
|
||||
});
|
||||
if (scope.isFactCleanup) {
|
||||
scope.$watch('scheduler_form.keep_amount.$modelValue', function(newVal) {
|
||||
if (!newVal && newVal !== 0) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else if (isNaN(newVal)) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else if (newVal < 0) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else if (newVal > 9999) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else {
|
||||
$('#configure-save-button').prop("disabled", false);
|
||||
}
|
||||
});
|
||||
scope.$watch('scheduler_form.granularity_keep_amount.$modelValue', function(newVal2) {
|
||||
if (!newVal2 && newVal2 !== 0) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else if (isNaN(newVal2)) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else if (newVal2 < 0) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else if (newVal2 > 9999) {
|
||||
$('#configure-save-button').prop("disabled", true);
|
||||
} else {
|
||||
$('#configure-save-button').prop("disabled", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(mode==="add"){
|
||||
scope.$apply(function(){
|
||||
scope.schedulerPurgeDays = 30;
|
||||
@ -565,10 +567,16 @@ export default
|
||||
if (scheduler.isValid()) {
|
||||
scope.schedulerIsValid = true;
|
||||
url = (mode==="edit") ? GetBasePath('schedules')+id+'/' : url;
|
||||
|
||||
extra_vars = {
|
||||
"days" : scope.scheduler_form.schedulerPurgeDays.$viewValue
|
||||
};
|
||||
if (scope.isFactCleanup) {
|
||||
extra_vars = {
|
||||
"older_than": scope.keep_amount+scope.keep_unit.value,
|
||||
"granularity": scope.granularity_keep_amount+scope.granularity_keep_unit.value
|
||||
};
|
||||
} else {
|
||||
extra_vars = {
|
||||
"days" : scope.scheduler_form.schedulerPurgeDays.$viewValue
|
||||
};
|
||||
}
|
||||
schedule.extra_data = JSON.stringify(extra_vars);
|
||||
|
||||
SchedulePost({
|
||||
|
||||
@ -25,6 +25,13 @@
|
||||
<div class="factDetailsNote" ng-if="isFactCleanup"><span class="factDetailsHeader">Note:</span> For facts collected older than the time period specified, save one fact scan (snapshot) per time window (frequency). For example, facts older than 30 days are purged, while one weekly fact scan is kept.
|
||||
Caution: Setting both numerical variables to "0" will delete all facts.</div>
|
||||
|
||||
<div class="form-group" ng-show="cleanupJob && !isFactCleanup">
|
||||
<label><span class="red-text">*</span> Days of data to keep</label>
|
||||
<input type="number" class="form-control input-sm" name="schedulerPurgeDays" id="schedulerPurgeDays" min="1" ng-model="schedulerPurgeDays" required placeholder="Days of data to keep">
|
||||
<div class="error" ng-show="scheduler_form.schedulerPurgeDays.$dirty && scheduler_form.schedulerPurgeDays.$error.required">A value is required.</div>
|
||||
<div class="error" ng-show="scheduler_form.schedulerPurgeDays.$error.number">This is not a valid number.</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group cleanupStretcher factDaysToKeepCompacter" ng-if="isFactCleanup">
|
||||
<div class="col-md-12">
|
||||
<label><span class="red-text">*</span> Select a time period after which to remove old facts</label>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user