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