- small adaptions for AsideMenuItem.vue, AsideMenuLayer.vue
All checks were successful
CI Pipeline / japa-tests (push) Successful in 50s
All checks were successful
CI Pipeline / japa-tests (push) Successful in 50s
- new routes editor.dataset.list and editor.dataset.update - fir functionalities for editor role, suche as listing and receiving released datasets - npm updates
This commit is contained in:
parent
c1e056b9fc
commit
6fef581dd0
11 changed files with 550 additions and 84 deletions
|
@ -884,24 +884,23 @@ export default class DatasetController {
|
|||
const uploadedFiles: MultipartFileContract[] = request.files('files');
|
||||
if (Array.isArray(uploadedFiles) && uploadedFiles.length > 0) {
|
||||
for (const [index, fileData] of uploadedFiles.entries()) {
|
||||
try {
|
||||
await this.scanFileForViruses(fileData.tmpPath); //, 'gitea.lan', 3310);
|
||||
// await this.scanFileForViruses("/tmp/testfile.txt");
|
||||
} catch (error) {
|
||||
// If the file is infected or there's an error scanning the file, throw a validation exception
|
||||
throw error;
|
||||
}
|
||||
|
||||
// move to disk:
|
||||
const fileName = `file-${cuid()}.${fileData.extname}`;
|
||||
const datasetFolder = `files/${dataset.id}`;
|
||||
|
||||
await fileData.moveToDisk(datasetFolder, { name: fileName, overwrite: true }, 'local');
|
||||
// let path = coverImage.filePath;
|
||||
|
||||
//save to db:
|
||||
const { clientFileName, sortOrder } = this.extractVariableNameAndSortOrder(fileData.clientName);
|
||||
const mimeType = fileData.headers['content-type'] || 'application/octet-stream'; // Fallback to a default MIME type
|
||||
// save file metadata into db
|
||||
// const newFile = new File();
|
||||
// newFile.pathName = `${datasetFolder}/${fileName}`;
|
||||
// newFile.fileSize = fileData.size;
|
||||
// newFile.mimeType = mimeType;
|
||||
// newFile.label = clientFileName;
|
||||
// newFile.sortOrder = sortOrder ? sortOrder : index;
|
||||
// newFile.visibleInFrontdoor = true;
|
||||
// newFile.visibleInOai = true;
|
||||
|
||||
const newFile = await dataset
|
||||
.useTransaction(trx)
|
||||
.related('files')
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue