added flushing and printing config

This commit is contained in:
sanjayk03-dev
2024-01-02 19:08:01 +05:30
parent 505ea06c73
commit 20c4a3b39d
3 changed files with 18 additions and 13 deletions

View File

@@ -511,7 +511,7 @@ module.exports = {
try{
this.load();
console.log("Loaded file");
// this.start_pause();
this.start_pause();
}catch(error){
console.warn("Error running program: ",error);
}

View File

@@ -100,7 +100,10 @@ module.exports = {
alert("Restore failed");
}
},
printConfig: async function(){
printConfig: function(){
console.log(this.config);
},
flushConfig: async function(){
this.config.macros=[
{
name:"Macros 1",
@@ -110,25 +113,25 @@ module.exports = {
},
{
name:"Macros 2",
color: "",
color: "#efefef",
gcode_file_name: " ",
gcode_file_time: 0
},
{
name:"Macros 3",
color: "",
color: "#efefef",
gcode_file_name: " ",
gcode_file_time: 0
},
{
name:"Macros 4",
color: "",
color: "#efefef",
gcode_file_name: " ",
gcode_file_time: 0
},
{
name:"Macros 5",
color: "",
color: "#efefef",
gcode_file_name: " ",
gcode_file_time: 0
},
@@ -141,7 +144,7 @@ module.exports = {
]
try {
await api.put("config/save",this.config);
console.log("Successfully saved");
console.log("Successfully flushed");
this.$dispatch("update");
} catch (error) {
console.error("Restore Failed: ",error);