Add a warning about missing EndTime term on UpdateDiskSpace

This commit is contained in:
Isaac Connor 2020-08-18 13:25:18 -04:00
parent e6d6ee1b67
commit c837a17aea
1 changed files with 11 additions and 0 deletions

View File

@ -36,6 +36,17 @@ function validateForm( form ) {
if ( ! have_archivestatus_term ) { if ( ! have_archivestatus_term ) {
return confirm('You have enabled deleting events but do not have a term referencing the archived status of the event. This filter may delete events that you want to save! Are you sure?'); return confirm('You have enabled deleting events but do not have a term referencing the archived status of the event. This filter may delete events that you want to save! Are you sure?');
} }
} else if ( form.elements['filter[UpdateDiskSpace]'].checked ) {
var have_endtime_term = false;
for ( var i = 0; i < rows.length; i++ ) {
if ( form.elements['filter[Query][terms][' + i + '][attr]'].value == 'EndDateTime' ) {
have_endtime_term = true;
}
}
if ( ! have_endtime_term ) {
return confirm('You don\'t have an EndTime term in your filter. This will match recordings that are still in progress and so the UpdateDiskSpace action will be a waste of time and resources. Ideally you should have an EndTime IS NOT NULL term. Do you want to continue?');
}
} else if ( form.elements['filter[Background]'].checked ) { } else if ( form.elements['filter[Background]'].checked ) {
if ( ! ( if ( ! (
form.elements['filter[AutoArchive]'].checked form.elements['filter[AutoArchive]'].checked