changed from arr to arrayobjects GCodeList
This commit is contained in:
@@ -206,7 +206,8 @@ module.exports = {
|
|||||||
const filesWithNoMacros=this.state.files.filter(item => !this.config.macrosList.some(compareItem => compareItem.gcode_file_name == item));
|
const filesWithNoMacros=this.state.files.filter(item => !this.config.macrosList.some(compareItem => compareItem.gcode_file_name == item));
|
||||||
console.log('filesWithNoMacros: ',filesWithNoMacros);
|
console.log('filesWithNoMacros: ',filesWithNoMacros);
|
||||||
console.log("this.config.GCodeList",this.config.GCodeList)
|
console.log("this.config.GCodeList",this.config.GCodeList)
|
||||||
const unionSet = new Set([...filesWithNoMacros, ...this.config.GCodeList]);
|
const GCodeListArray=this.config.GCodeList.map(item=> item['gcode_file_name'])
|
||||||
|
const unionSet = new Set([...filesWithNoMacros, ...GCodeListArray]);
|
||||||
const files = [...unionSet];
|
const files = [...unionSet];
|
||||||
console.log("files: ",files);
|
console.log("files: ",files);
|
||||||
return files;
|
return files;
|
||||||
@@ -375,10 +376,11 @@ module.exports = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isAlreadyPresent = this.config.GCodeList.find((element) => element == file.name);
|
const isAlreadyPresent = this.config.GCodeList.find((element) => element['gcode_file_name'] == file.name);
|
||||||
if(isAlreadyPresent == undefined){
|
if(isAlreadyPresent == undefined){
|
||||||
console.log('new gcode file');
|
console.log('new gcode file');
|
||||||
this.config.GCodeList.push(file.name);
|
const GCode={gcode_file_name: file.name }
|
||||||
|
this.config.GCodeList.push(GCode);
|
||||||
try {
|
try {
|
||||||
await api.put("config/save", this.config);
|
await api.put("config/save", this.config);
|
||||||
this.$dispatch("update");
|
this.$dispatch("update");
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ class FileHandler(bbctrl.APIHandler):
|
|||||||
self.uploadFile.write(data)
|
self.uploadFile.write(data)
|
||||||
|
|
||||||
def delete_ok(self, filename):
|
def delete_ok(self, filename):
|
||||||
self.get_log('FileHandler').info('filename ' + filename)
|
|
||||||
allFiles = self.get_ctrl().state.return_files()
|
allFiles = self.get_ctrl().state.return_files()
|
||||||
for file in allFiles:
|
for file in allFiles:
|
||||||
self.get_log('FileHandler').info('filename ' + file)
|
self.get_log('FileHandler').info('filename ' + file)
|
||||||
|
|||||||
@@ -693,9 +693,12 @@
|
|||||||
"GCodeList": {
|
"GCodeList": {
|
||||||
"type": "list",
|
"type": "list",
|
||||||
"index": "numeric",
|
"index": "numeric",
|
||||||
"default": [ ],
|
"default": [],
|
||||||
"template": {
|
"template": {
|
||||||
"type": "text"
|
"gcode_file_time": {
|
||||||
|
"type": "int",
|
||||||
|
"default": 1705008395
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user