finxing alert
This commit is contained in:
@@ -178,22 +178,16 @@ module.exports = {
|
|||||||
if (!this.config.macrosList.some(item => item.file_name == filename)) {
|
if (!this.config.macrosList.some(item => item.file_name == filename)) {
|
||||||
console.log("new gcode uploaded for macros");
|
console.log("new gcode uploaded for macros");
|
||||||
this.config.macrosList.push(gcodeData);
|
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");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
saveMacros: async function () {
|
saveMacros: async function () {
|
||||||
const macrosList = this.config.macros.map(item => item.name);
|
const macrosList = this.config.macros.splice(this.tab - 1, 1).map(item => item.name);
|
||||||
var macrosName = document.getElementById("macros-name").value;
|
var macrosName = document.getElementById("macros-name").value;
|
||||||
console.log("Macros Name: ", this.macrosName);
|
console.log("Macros Name: ", this.macrosName);
|
||||||
var macrosColor = document.getElementById("macros-color").value;
|
var macrosColor = document.getElementById("macros-color").value;
|
||||||
if (macrosList.includes(macrosName)) {
|
if (macrosList.includes(macrosName)) {
|
||||||
this.sameName = true;
|
this.sameName = true;
|
||||||
|
this.confirmSave = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,13 +206,13 @@ module.exports = {
|
|||||||
this.confirmSave = false;
|
this.confirmSave = false;
|
||||||
try {
|
try {
|
||||||
await api.put("config/save", this.config);
|
await api.put("config/save", this.config);
|
||||||
this.edited = false;
|
|
||||||
console.log("Successfully saved");
|
console.log("Successfully saved");
|
||||||
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");
|
||||||
}
|
}
|
||||||
|
this.edited = false;
|
||||||
console.log("tab in saveMacros:", this.tab);
|
console.log("tab in saveMacros:", this.tab);
|
||||||
},
|
},
|
||||||
delete_current: async function () {
|
delete_current: async function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user