message for folder upload
This commit is contained in:
@@ -534,6 +534,15 @@ module.exports = {
|
|||||||
this.config.non_macros_list = [...this.state.non_macros_list];
|
this.config.non_macros_list = [...this.state.non_macros_list];
|
||||||
this.config.gcode_list = [...this.state.gcode_list];
|
this.config.gcode_list = [...this.state.gcode_list];
|
||||||
|
|
||||||
|
let filesUploaded = 0;
|
||||||
|
const totalFiles = files.length;
|
||||||
|
|
||||||
|
const checkIfAllFilesUploaded = () => {
|
||||||
|
if (filesUploaded === totalFiles) {
|
||||||
|
this.uploadFolder = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
for (let file of files) {
|
for (let file of files) {
|
||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
reader.onload = () => {
|
reader.onload = () => {
|
||||||
@@ -549,6 +558,8 @@ module.exports = {
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
alert(`Unsupported file type: ${extension}`);
|
alert(`Unsupported file type: ${extension}`);
|
||||||
|
filesUploaded++;
|
||||||
|
checkIfAllFilesUploaded();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -577,15 +588,18 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.save_config(this.config);
|
this.save_config(this.config);
|
||||||
|
filesUploaded++;
|
||||||
|
checkIfAllFilesUploaded();
|
||||||
};
|
};
|
||||||
|
|
||||||
reader.onerror = error => {
|
reader.onerror = error => {
|
||||||
alert("Error uploading file: ", error);
|
alert("Error uploading file: ", error);
|
||||||
this.uploadFolder = false;
|
this.uploadFolder = false;
|
||||||
|
filesUploaded++;
|
||||||
|
checkIfAllFilesUploaded();
|
||||||
};
|
};
|
||||||
reader.readAsText(file, "utf-8");
|
reader.readAsText(file, "utf-8");
|
||||||
}
|
}
|
||||||
this.uploadFolder = false;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
delete_current: async function () {
|
delete_current: async function () {
|
||||||
|
|||||||
@@ -276,7 +276,12 @@ script#control-view-template(type="text/x-template")
|
|||||||
|
|
||||||
message(:show.sync="uploadFolder")
|
message(:show.sync="uploadFolder")
|
||||||
h3(slot="header") Uploading
|
h3(slot="header") Uploading
|
||||||
p(slot="body") Uploading files is currently in progress. Do not close window.
|
div(slot="body")
|
||||||
|
p
|
||||||
|
|
|
||||||
|
| Uploading files is currently in progress.
|
||||||
|
| Do not close window.
|
||||||
|
|
|
||||||
div(slot="footer")
|
div(slot="footer")
|
||||||
|
|
||||||
button.pure-button(title="Execute one program step.", @click="step",
|
button.pure-button(title="Execute one program step.", @click="step",
|
||||||
|
|||||||
Reference in New Issue
Block a user