hotfix(dataset): enhance file upload and update functionality

- Added file upload functionality to the dataset update form.
- Implemented file size validation and aggregated upload limit.
- Added temporary file storage and cleanup to handle large file uploads.
- Added a clear button to the file upload component.
- Added the ability to sort files in the file upload component.
- Fixed an issue where the file upload component was not correctly updating the model value.
- Updated the dataset edit form to use the new file upload component.
- Added the ability to sort files in the file upload component.
- Added a global declaration for the `sort_order` property on the `File` interface.
- Added helper functions for byte size parsing, configuration retrieval, and temporary file path generation.
This commit is contained in:
Kaimbacher 2025-04-01 13:39:02 +02:00
parent 8fbda9fc64
commit 10d159a57a
5 changed files with 177 additions and 84 deletions

View file

@ -447,7 +447,7 @@
</select> -->
</div>
<FileUploadComponent v-model:files="form.files" v-model:filesToDelete="form.filesToDelete"></FileUploadComponent>
<FileUploadComponent v-model:files="form.files" v-model:filesToDelete="form.filesToDelete" :showClearButton="false"></FileUploadComponent>
<div class="text-red-400 text-sm" v-if="form.errors['file'] && Array.isArray(form.errors['files'])">
{{ form.errors['files'].join(', ') }}
@ -700,14 +700,14 @@ const submit = async (): Promise<void> => {
// const file = new File([obj.blob], `${obj.label}?sortOrder=${obj.sort_order}`, options);
// const metadata = JSON.stringify({ sort_order: obj.sort_order });
// const metadataBlob = new Blob([metadata + '\n'], { type: 'application/json' });
const file = new File([obj.blob], `${obj.label}`, options,);
const file = new File([obj.blob], `${obj.label}?sortorder=${obj.sort_order}`, options,);
// const file = new File([obj.blob], `${obj.label}`, options);
// fileUploads[obj.sort_order] = file;
fileUploads.push(file);
} else {
} else {
// return normal request input
fileInputs.push(obj);
}