Merge branch 'improve/wrongUploadError' into devel
Conflicts: src/octoprint/static/css/octoprint.css src/octoprint/static/js/app/viewmodels/files.js
This commit is contained in:
commit
0371fdd497
2 changed files with 13 additions and 1 deletions
|
|
@ -790,7 +790,14 @@ $(function() {
|
|||
};
|
||||
|
||||
self._handleUploadFail = function(e, data) {
|
||||
var error = "<p>" + gettext("Could not upload the file. Make sure that it is a GCODE file and has the extension \".gcode\" or \".gco\" or that it is an STL file with the extension \".stl\".") + "</p>";
|
||||
var extensions = _.map(SUPPORTED_EXTENSIONS, function(extension) {
|
||||
return extension.toLowerCase();
|
||||
}).sort();
|
||||
extensions = extensions.join(", ");
|
||||
var error = "<p>"
|
||||
+ _.sprintf(gettext("Could not upload the file. Make sure that it is a valid file with one of these extensions: %(extensions)s"),
|
||||
{extensions: extensions})
|
||||
+ "</p>";
|
||||
error += pnotifyAdditionalInfo("<pre>" + data.jqXHR.responseText + "</pre>");
|
||||
new PNotify({
|
||||
title: "Upload failed",
|
||||
|
|
@ -805,6 +812,10 @@ $(function() {
|
|||
self._uploadInProgress = false;
|
||||
};
|
||||
|
||||
self._handleUploadAlways = function(e, data) {
|
||||
self._uploadInProgress = false;
|
||||
};
|
||||
|
||||
self._handleUploadProgress = function(e, data) {
|
||||
var progress = parseInt(data.loaded / data.total * 100, 10);
|
||||
var uploaded = progress >= 100;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
var BRANCH = "{{ version.branch|e }}";
|
||||
var LOCALE = "{{ g.locale|e }}";
|
||||
var AVAILABLE_LOCALES = {{ locales|tojson }};
|
||||
var SUPPORTED_EXTENSIONS = {{ supportedExtensions|tojson }};
|
||||
|
||||
var OCTOPRINT_VIEWMODELS = [];
|
||||
var ADDITIONAL_VIEWMODELS = [];
|
||||
|
|
|
|||
Loading…
Reference in a new issue