front for delete and
This commit is contained in:
@@ -405,9 +405,11 @@ module.exports = {
|
||||
},
|
||||
|
||||
delete_current: function() {
|
||||
if(this.config.macrosList.find(item=>item.gcode_file_name==this.state.selected)==undefined){
|
||||
if (this.state.selected) {
|
||||
api.delete(`file/${this.state.selected}`);
|
||||
}
|
||||
}
|
||||
|
||||
this.deleteGCode = false;
|
||||
},
|
||||
@@ -417,6 +419,12 @@ module.exports = {
|
||||
this.deleteGCode = false;
|
||||
},
|
||||
|
||||
delete_all_except_macros: function() {
|
||||
macrosList=this.config.macros.map(item=>item.gcode_file_name).toString();
|
||||
api.delete(`file/EgZjaHJvbWUqCggBEAAYsQMYgAQyBggAEEUYOTIKCAE${macrosList}`);
|
||||
this.deleteGCode = false;
|
||||
},
|
||||
|
||||
home: function(axis) {
|
||||
this.ask_home = false;
|
||||
|
||||
|
||||
@@ -293,6 +293,9 @@ script#control-view-template(type="text/x-template")
|
||||
button.pure-button.button-success(@click="delete_current")
|
||||
.fa.fa-trash
|
||||
| Selected
|
||||
button.pure-button.button-success(@click="delete_all_except_macros")
|
||||
.fa.fa-trash
|
||||
| Not Macros
|
||||
|
||||
select(title="Select previously uploaded GCode programs.",
|
||||
v-model="state.selected", @change="loadGCode", :disabled="!is_ready",
|
||||
|
||||
@@ -137,8 +137,9 @@ class State(object):
|
||||
|
||||
def load_gcodes(self):
|
||||
GCodeList = []
|
||||
files = copy.deepcopy(self.get('files'))
|
||||
macrosList = self.ctrl.config.get('macrosList', [])
|
||||
# GCodeList = copy.deepcopy(self.get('files'))
|
||||
|
||||
# macrosList = self.ctrl.config.get('macrosList', [])
|
||||
|
||||
# macro_names = [macro["gcode_file_name"] for macro in macrosList]
|
||||
# GCodeList = [file for file in files if file not in macro_names]
|
||||
|
||||
Reference in New Issue
Block a user