|
|
|
@@ -1094,6 +1094,23 @@ async function initRepository() { |
|
|
|
$('#dataset-content input').focus(); |
|
|
|
return false; |
|
|
|
}; |
|
|
|
$('[data-dataset-delete]').on('click', function () { |
|
|
|
const $this = $(this); |
|
|
|
|
|
|
|
$('#data-dataset-delete-modal').modal({ |
|
|
|
closable: false, |
|
|
|
onApprove() { |
|
|
|
$.post($this.data('remove-url'), { |
|
|
|
_csrf: $this.data('csrf'), |
|
|
|
file: $this.data('uuid') |
|
|
|
}).done((_data) => { |
|
|
|
$(`#${$this.data('uuid')}`).hide(); |
|
|
|
}).fail(() => { |
|
|
|
window.location.reload(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}).modal('show'); |
|
|
|
}); |
|
|
|
$('[data-category-id]').on('click', function () { |
|
|
|
const category = $(this).data('category-id'); |
|
|
|
$('#category').val(category); |
|
|
|
@@ -2372,6 +2389,9 @@ $(document).ready(async () => { |
|
|
|
timeout: 3600000, |
|
|
|
previewTemplate, |
|
|
|
init() { |
|
|
|
this.on('sending', (_file, _xhr, formData) => { |
|
|
|
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); |
|
|
|
|