fixing bug
This commit is contained in:
@@ -74,12 +74,12 @@ module.exports = {
|
|||||||
if (response.status == 200) {
|
if (response.status == 200) {
|
||||||
const text = (await response.text()).split(" ").join("\n");
|
const text = (await response.text()).split(" ").join("\n");
|
||||||
console.log("text: ", text);
|
console.log("text: ", text);
|
||||||
this.$set("newGcode", text);
|
this.newGcode = text;
|
||||||
} else {
|
} else {
|
||||||
console.log("error loading");
|
console.log("error loading");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$set("newGcode", "");
|
this.newGcode = "";
|
||||||
}
|
}
|
||||||
this.$dispatch("macros-edited");
|
this.$dispatch("macros-edited");
|
||||||
console.log("loaded GCode: ", this.newGcode);
|
console.log("loaded GCode: ", this.newGcode);
|
||||||
@@ -204,10 +204,10 @@ module.exports = {
|
|||||||
const filename = this.fileName;
|
const filename = this.fileName;
|
||||||
console.log("delete a gcode");
|
console.log("delete a gcode");
|
||||||
if (filename == "default") {
|
if (filename == "default") {
|
||||||
this.$set("newGcode", "");
|
this.newGcode = "";
|
||||||
} else {
|
} else {
|
||||||
api.delete(`file/${filename}`);
|
api.delete(`file/${filename}`);
|
||||||
this.$set("newGcode", "");
|
this.newGcode = "";
|
||||||
this.config.macros[this.tab - 1].file_name = "default";
|
this.config.macros[this.tab - 1].file_name = "default";
|
||||||
this.config.macrosList = this.config.macrosList.filter(item => item.file_name !== filename);
|
this.config.macrosList = this.config.macrosList.filter(item => item.file_name !== filename);
|
||||||
}
|
}
|
||||||
@@ -234,7 +234,7 @@ module.exports = {
|
|||||||
console.log("DefaultValue: ", defaultValue);
|
console.log("DefaultValue: ", defaultValue);
|
||||||
document.getElementById("macros-name").value = defaultValue.name;
|
document.getElementById("macros-name").value = defaultValue.name;
|
||||||
document.getElementById("macros-color").value = defaultValue.color;
|
document.getElementById("macros-color").value = defaultValue.color;
|
||||||
this.$set("newGcode", "");
|
this.newGcode = "";
|
||||||
this.fileName = "default";
|
this.fileName = "default";
|
||||||
},
|
},
|
||||||
deleteAllMacros: async function () {
|
deleteAllMacros: async function () {
|
||||||
@@ -320,7 +320,6 @@ module.exports = {
|
|||||||
color: "#dedede",
|
color: "#dedede",
|
||||||
file_name: "default",
|
file_name: "default",
|
||||||
};
|
};
|
||||||
this.newGcode.push("");
|
|
||||||
this.config.macros.push(newMacros);
|
this.config.macros.push(newMacros);
|
||||||
try {
|
try {
|
||||||
await api.put("config/save", this.config);
|
await api.put("config/save", this.config);
|
||||||
@@ -350,7 +349,7 @@ module.exports = {
|
|||||||
document.getElementById("macros-name").value = macros.name;
|
document.getElementById("macros-name").value = macros.name;
|
||||||
document.getElementById("macros-color").value = macros.color;
|
document.getElementById("macros-color").value = macros.color;
|
||||||
// document.getElementById("gcode-field").value = "";
|
// document.getElementById("gcode-field").value = "";
|
||||||
this.$set("newGCode", "");
|
this.newGcode = "";
|
||||||
this.$set("fileName", macros.name);
|
this.$set("fileName", macros.name);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user