moved config
This commit is contained in:
@@ -69,10 +69,10 @@ module.exports = {
|
||||
return this.config.macrosList.map(el => el.gcode_file_name);
|
||||
},
|
||||
getMacrosColor: function () {
|
||||
return this.config.macros[this.tab - 1]['color'];
|
||||
return this.config.macros[this.tab - 1]["color"];
|
||||
},
|
||||
getMacrosName: function () {
|
||||
return this.config.macros[this.tab - 1]['name'];
|
||||
return this.config.macros[this.tab - 1]["name"];
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
@@ -179,16 +179,16 @@ module.exports = {
|
||||
gcode_file_time: this.state.selected_time,
|
||||
};
|
||||
if (this.config.macrosList.some(item => item.gcode_file_name !== filename)) {
|
||||
console.log('new item');
|
||||
console.log("new item");
|
||||
this.config.macrosList.push(gcodeData);
|
||||
}
|
||||
|
||||
try {
|
||||
await api.put("config/save", this.config);
|
||||
this.$dispatch("update");
|
||||
} catch (error) {
|
||||
console.error("Restore Failed: ", error);
|
||||
alert("Restore failed");
|
||||
try {
|
||||
await api.put("config/save", this.config);
|
||||
this.$dispatch("update");
|
||||
} catch (error) {
|
||||
console.error("Restore Failed: ", error);
|
||||
alert("Restore failed");
|
||||
}
|
||||
}
|
||||
},
|
||||
saveMacros: async function () {
|
||||
@@ -225,7 +225,7 @@ module.exports = {
|
||||
this.$set("newGcode[this.tab-1]", "");
|
||||
} else {
|
||||
if (!this.isPresent({ gcode_file_name: this.selectedValues[this.tab - 1] })) {
|
||||
console.log('this is not default macros');
|
||||
console.log("this is not default macros");
|
||||
api.delete(`file/${this.selectedValues[this.tab - 1]}`);
|
||||
this.$set("newGcode[this.tab-1]", "");
|
||||
this.config.macrosList = this.config.macrosList.filter(
|
||||
@@ -238,7 +238,7 @@ module.exports = {
|
||||
console.error("Restore Failed: ", error);
|
||||
alert("Restore failed");
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
alert("You cannot delete GCode of Default Macros");
|
||||
}
|
||||
}
|
||||
@@ -330,41 +330,41 @@ module.exports = {
|
||||
printConfig: function () {
|
||||
console.log(this.config);
|
||||
},
|
||||
resetMacrosList: async function (){
|
||||
this.config.macrosList=[
|
||||
resetMacrosList: async function () {
|
||||
this.config.macrosList = [
|
||||
{
|
||||
"gcode_file_name": "FireLaser.ngc",
|
||||
"gcode_file_time": 1705008250.2333415
|
||||
gcode_file_name: "FireLaser.ngc",
|
||||
gcode_file_time: 1705008250.2333415,
|
||||
},
|
||||
{
|
||||
"gcode_file_name": "GoHomeXYZ.ngc",
|
||||
"gcode_file_time": 1705008321.710827
|
||||
gcode_file_name: "GoHomeXYZ.ngc",
|
||||
gcode_file_time: 1705008321.710827,
|
||||
},
|
||||
{
|
||||
"gcode_file_name": "ParkRearRightWW.ngc",
|
||||
"gcode_file_time": 1705008360.977644
|
||||
gcode_file_name: "ParkRearRightWW.ngc",
|
||||
gcode_file_time: 1705008360.977644,
|
||||
},
|
||||
{
|
||||
"gcode_file_name": "SpindleWarmUp1Minute.ngc",
|
||||
"gcode_file_time": 1705008372.967075
|
||||
gcode_file_name: "SpindleWarmUp1Minute.ngc",
|
||||
gcode_file_time: 1705008372.967075,
|
||||
},
|
||||
{
|
||||
"gcode_file_name": "TurnOnSpindle.ngc",
|
||||
"gcode_file_time": 1705008405.5059154
|
||||
gcode_file_name: "TurnOnSpindle.ngc",
|
||||
gcode_file_time: 1705008405.5059154,
|
||||
},
|
||||
{
|
||||
"gcode_file_name": "TurnOffSpindleAndLaser.ngc",
|
||||
"gcode_file_time": 1705008384.6566093
|
||||
gcode_file_name: "TurnOffSpindleAndLaser.ngc",
|
||||
gcode_file_time: 1705008384.6566093,
|
||||
},
|
||||
{
|
||||
"gcode_file_name": "VacOn.ngc",
|
||||
"gcode_file_time": 1705008413.7756715
|
||||
gcode_file_name: "VacOn.ngc",
|
||||
gcode_file_time: 1705008413.7756715,
|
||||
},
|
||||
{
|
||||
"gcode_file_name": "TurnOffVac.ngc",
|
||||
"gcode_file_time": 1705008395.476232
|
||||
}
|
||||
]
|
||||
gcode_file_name: "TurnOffVac.ngc",
|
||||
gcode_file_time: 1705008395.476232,
|
||||
},
|
||||
];
|
||||
try {
|
||||
await api.put("config/save", this.config);
|
||||
this.$dispatch("update");
|
||||
|
||||
Reference in New Issue
Block a user