1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Added a default timeout of 60 seconds to dropzone.

Fixes #876
This commit is contained in:
Abijeet
2018-11-18 00:22:08 +05:30
parent 302b53562d
commit d3d3e2ad3e
18 changed files with 26 additions and 3 deletions

View File

@ -13,8 +13,9 @@ function mounted() {
let container = this.$el;
let _this = this;
this._dz = new DropZone(container, {
addRemoveLinks: true,
dictRemoveFile: trans('components.image_upload_remove'),
addRemoveLinks: true,
dictRemoveFile: trans('components.image_upload_remove'),
timeout: +window.dropZoneTimeout || 60000,
url: function() {
return _this.uploadUrl;
},
@ -26,6 +27,10 @@ function mounted() {
data.append('_token', token);
let uploadedTo = typeof _this.uploadedTo === 'undefined' ? 0 : _this.uploadedTo;
data.append('uploaded_to', uploadedTo);
xhr.ontimeout = function (e) {
_this.$events.emit('error', trans('errors.file_upload_timeout'));
}
});
dz.on('success', function (file, data) {