back to config.py
This commit is contained in:
@@ -206,8 +206,7 @@ module.exports = {
|
||||
const filesWithNoMacros=this.state.files.filter(item => !this.config.macrosList.some(compareItem => compareItem.gcode_file_name == item));
|
||||
console.log('filesWithNoMacros: ',filesWithNoMacros);
|
||||
console.log("this.config.GCodeList",this.config.GCodeList)
|
||||
const GCodeListArray=this.config.GCodeList.map(item=> item['gcode_file_name'])
|
||||
const unionSet = new Set([...filesWithNoMacros, ...GCodeListArray]);
|
||||
const unionSet = new Set([...filesWithNoMacros, ...this.config.GCodeList]);
|
||||
const files = [...unionSet];
|
||||
console.log("files: ",files);
|
||||
return files;
|
||||
@@ -376,11 +375,10 @@ module.exports = {
|
||||
return;
|
||||
}
|
||||
|
||||
const isAlreadyPresent = this.config.GCodeList.find((element) => element['gcode_file_name'] == file.name);
|
||||
const isAlreadyPresent = this.config.GCodeList.find((element) => element == file.name);
|
||||
if(isAlreadyPresent == undefined){
|
||||
console.log('new gcode file');
|
||||
const GCode={gcode_file_name: file.name }
|
||||
this.config.GCodeList.push(GCode);
|
||||
this.config.GCodeList.push(file.name);
|
||||
try {
|
||||
await api.put("config/save", this.config);
|
||||
this.$dispatch("update");
|
||||
|
||||
@@ -41,6 +41,7 @@ class Config(object):
|
||||
self.log = ctrl.log.get('Config')
|
||||
|
||||
self.values = {}
|
||||
self.values['GCodeList'] = []
|
||||
|
||||
try:
|
||||
self.version = "1.4.0"
|
||||
@@ -62,6 +63,7 @@ class Config(object):
|
||||
|
||||
try:
|
||||
self._upgrade(config)
|
||||
config['GCodeList'] = self.get('GCodeList', ["Test.ngc"])
|
||||
except Exception: self.log.exception('Internal error: Failed to upgrade config')
|
||||
|
||||
except Exception as e:
|
||||
|
||||
@@ -690,18 +690,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
"GCodeList": {
|
||||
"type": "list",
|
||||
"index": "numeric",
|
||||
"default": [],
|
||||
"template": {
|
||||
"gcode_file_time": {
|
||||
"type": "int",
|
||||
"default": 1705008395
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"admin": {
|
||||
"auto-check-upgrade": {
|
||||
"type": "bool",
|
||||
|
||||
Reference in New Issue
Block a user