bug fix delete_files_and_folder
This commit is contained in:
@@ -635,24 +635,29 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.config.gcode_list = [...this.state.gcode_list];
|
||||||
|
this.config.non_macros_list = [...this.state.non_macros_list];
|
||||||
|
|
||||||
if (this.state.folder != "default") {
|
if (this.state.folder != "default") {
|
||||||
this.config.gcode_list = [...this.state.gcode_list];
|
|
||||||
const selected_folder = this.config.gcode_list.find(
|
const selected_folder = this.config.gcode_list.find(
|
||||||
item => item.type == "folder" && item.name == this.state.folder,
|
item => item.type == "folder" && item.name == this.state.folder,
|
||||||
).files;
|
).files;
|
||||||
if (selected_folder) {
|
if (selected_folder) {
|
||||||
const files_to_delete = selected_folder.map(item => item.file_name).toString();
|
var files_to_delete = selected_folder.map(item => item.file_name);
|
||||||
await api.delete(`file/DINCAIQABiDARixAxiABDIHCAMQABiABDIHCAQQABiABDIH${files_to_delete}`);
|
|
||||||
this.config.gcode_list = this.config.gcode_list.filter(item => item.name != this.state.folder);
|
this.config.gcode_list = this.config.gcode_list.filter(item => item.name != this.state.folder);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const selected_folder = this.config.gcode_list.filter(item => item.type == "file");
|
const selected_folder = this.config.gcode_list.filter(item => item.type == "file");
|
||||||
if (selected_folder) {
|
if (selected_folder) {
|
||||||
const files_to_delete = selected_folder.map(item => item.name).toString();
|
var files_to_delete = selected_folder.map(item => item.name);
|
||||||
await api.delete(`file/DINCAIQABiDARixAxiABDIHCAMQABiABDIHCAQQABiABDIH${files_to_delete}`);
|
|
||||||
this.config.gcode_list = this.config.gcode_list.filter(item => item.type != "file");
|
this.config.gcode_list = this.config.gcode_list.filter(item => item.type != "file");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await api.delete(`file/DINCAIQABiDARixAxiABDIHCAMQABiABDIHCAQQABiABDIH${files_to_delete.toString()}`);
|
||||||
|
this.config.non_macros_list = this.config.non_macros_list.filter(
|
||||||
|
item => !files_to_delete.includes(item.file_name),
|
||||||
|
);
|
||||||
this.save_config(this.config);
|
this.save_config(this.config);
|
||||||
this.state.folder = "default";
|
this.state.folder = "default";
|
||||||
this.confirmDelete = false;
|
this.confirmDelete = false;
|
||||||
|
|||||||
@@ -317,6 +317,9 @@ script#control-view-template(type="text/x-template")
|
|||||||
button.pure-button.button-success(@click="delete_current")
|
button.pure-button.button-success(@click="delete_current")
|
||||||
.fa.fa-trash
|
.fa.fa-trash
|
||||||
| Selected
|
| Selected
|
||||||
|
|
||||||
|
button.submit-macros(title="Cancel Macros",@click="print_config",style="margin-left:5px;background-color:#fafafa;") CONFIG
|
||||||
|
button.submit-macros(title="Cancel Macros",@click="print_state",style="margin-left:5px;background-color:#fafafa;") STATE
|
||||||
|
|
||||||
.drop-down-container
|
.drop-down-container
|
||||||
message(:show.sync="create_folder")
|
message(:show.sync="create_folder")
|
||||||
@@ -367,9 +370,6 @@ script#control-view-template(type="text/x-template")
|
|||||||
//- :disabled="!is_ready")
|
//- :disabled="!is_ready")
|
||||||
//- | Upload File
|
//- | Upload File
|
||||||
|
|
||||||
button.submit-macros(title="Cancel Macros",@click="print_config",style="margin-left:5px;background-color:#fafafa;") CONFIG
|
|
||||||
button.submit-macros(title="Cancel Macros",@click="print_state",style="margin-left:5px;background-color:#fafafa;") STATE
|
|
||||||
|
|
||||||
.progress(v-if="toolpath_progress && toolpath_progress < 1",
|
.progress(v-if="toolpath_progress && toolpath_progress < 1",
|
||||||
title="Simulating GCode to check for errors, calculate ETA and " +
|
title="Simulating GCode to check for errors, calculate ETA and " +
|
||||||
"generate 3D view. You can run GCode before the simulation " +
|
"generate 3D view. You can run GCode before the simulation " +
|
||||||
|
|||||||
Reference in New Issue
Block a user