Merge branch 'improve/wrongUploadError' into maintenance
This commit is contained in:
commit
cdbc8fcfbd
2 changed files with 9 additions and 1 deletions
|
|
@ -545,7 +545,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",
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
var BRANCH = "{{ 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