1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 16:36:15 +00:00

[fileupload] show error message when failed to get upload url

This commit is contained in:
llj
2018-03-02 16:11:27 +08:00
parent 5b02073588
commit 6d4000fc20
4 changed files with 33 additions and 7 deletions

View File

@@ -28,7 +28,7 @@ define([
fileupdateConfirmTemplate: _.template($("#fileupdate-confirm-template").html()),
initialize: function (options) {
initialize: function(options) {
var dirView = this.dirView = options.dirView;
var dirents = dirView.dir;
@@ -217,8 +217,15 @@ define([
}
}
},
error: function() {
file.error = gettext("Failed to get upload url");
error: function(xhr) {
var error_msg;
if (xhr.responseJSON) {
error_msg = xhr.responseJSON.error_msg;
} else {
error_msg = gettext("Error");
}
data.abort();
_this.$('.total-error').html(error_msg).show();
}
});
};
@@ -250,8 +257,15 @@ define([
data.url = returned_url;
data.jqXHR = popup.fileupload('send', data);
},
error: function() {
file.error = gettext("Failed to get update url");
error: function(xhr) {
var error_msg;
if (xhr.responseJSON) {
error_msg = xhr.responseJSON.error_msg;
} else {
error_msg = gettext("Error");
}
data.abort();
_this.$('.total-error').html(error_msg).show();
}
});
};