|
|
|
@@ -2396,6 +2396,7 @@ $(document).ready(async () => { |
|
|
|
|
|
|
|
await createDropzone('#dataset', { |
|
|
|
url: $dataset.data('upload-url'), |
|
|
|
method:"put", |
|
|
|
headers: {'X-Csrf-Token': csrf}, |
|
|
|
maxFiles: $dataset.data('max-file'), |
|
|
|
maxFilesize: $dataset.data('max-size'), |
|
|
|
@@ -2412,16 +2413,24 @@ $(document).ready(async () => { |
|
|
|
formData.append('dataset_id', $dataset.data('dataset-id')); |
|
|
|
}); |
|
|
|
this.on('success', (file, data) => { |
|
|
|
/* |
|
|
|
filenameDict[file.name] = data.uuid; |
|
|
|
const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid); |
|
|
|
var uuid = $dataset.data('uuid'); |
|
|
|
console.log(uuid); |
|
|
|
console.log(file.name); |
|
|
|
console.log(file.size); |
|
|
|
filenameDict[file.name] = uuid; |
|
|
|
const input = $(`<input id="${uuid}" name="files" type="hidden">`).val(uuid); |
|
|
|
$('.files').append(input); |
|
|
|
*/ |
|
|
|
console.log($dataset.data('upload-url')); |
|
|
|
console.log($dataset.data('uuid')); |
|
|
|
if ($dataset.data('add-url') && $dataset.data('csrf')) { |
|
|
|
$.post($dataset.data('add-url'), { |
|
|
|
uuid: uuid, |
|
|
|
file_name: file.name, |
|
|
|
size: file.size, |
|
|
|
_csrf: $dataset.data('csrf') |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
this.on('queuecomplete', () => { |
|
|
|
window.location.reload(); |
|
|
|
//window.location.reload(); |
|
|
|
}); |
|
|
|
this.on('removedfile', (file) => { |
|
|
|
if (file.name in filenameDict) { |
|
|
|
|