@@ -43,6 +43,12 @@ const mandatoryRule = [
4343 (v : any ) => (v ? true : " Input required." )
4444];
4545const acceptTypes = ' .json,.geojson,.tif,.tiff,.zip'
46+ const maxFileSize = 2000000000
47+ const fileUploadRules = [(fileset : File []) => {
48+ if (fileset .some ((f ) => f .size > maxFileSize )) {
49+ return ' File Upload cannot be greater than 2 GB.'
50+ }
51+ }]
4652
4753const similarExisting = computed (() => {
4854 return props .allDatasets .filter ((d ) => {
@@ -57,7 +63,8 @@ const valid = computed(() => {
5763 return (
5864 name .value && description .value && category .value &&
5965 layers .value .length > 0 && layers .value .every ((l ) => {
60- return l .name && l .files .length && (
66+ return l .name && l .files .length &&
67+ fileUploadRules .every ((rule ) => rule (l .files ) === undefined ) && (
6168 l .frame_method === ' single' || l .frame_property
6269 )
6370 })
@@ -228,7 +235,7 @@ watch(open, () => {
228235 <v-icon icon =" mdi-information-outline" color =" primary" class =" upload-info-icon"
229236 v-tooltip =" 'Upload multiple files to create a sequence of frames, or upload a single file to optionally split into frames.'" />
230237 <v-file-upload v-model =" layer.files" density =" compact" class =" mt-2" multiple
231- clearable :accept =" acceptTypes"
238+ clearable :accept =" acceptTypes" show-size :rules = " fileUploadRules "
232239 style =" background-color : rgb (var (--v-theme-secondary )); padding : 10px "
233240 @update:model-value =" () => { layer.frame_method = 'single'; layer.frame_property = undefined }" >
234241 <template v-slot :icon >
0 commit comments