logging cancel macros
This commit is contained in:
@@ -65,9 +65,13 @@ module.exports = {
|
|||||||
cache: "no-cache",
|
cache: "no-cache",
|
||||||
});
|
});
|
||||||
console.log("response status: ", response.status);
|
console.log("response status: ", response.status);
|
||||||
|
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[this.tab-1]", text);
|
this.$set("newGcode[this.tab-1]", text);
|
||||||
|
} else {
|
||||||
|
console.log("error loading");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$set("newGcode[this.tab-1]", "");
|
this.$set("newGcode[this.tab-1]", "");
|
||||||
}
|
}
|
||||||
@@ -220,12 +224,14 @@ module.exports = {
|
|||||||
this.config.macrosList = [];
|
this.config.macrosList = [];
|
||||||
},
|
},
|
||||||
cancelMacros: async function () {
|
cancelMacros: async function () {
|
||||||
console.log("this.tab", this.tab);
|
console.log("this.tab", this.tab - 1);
|
||||||
|
console.log(document.getElementById(`macros-name-${this.tab - 1}`).value);
|
||||||
const defaultValue = this.config.macros[this.tab - 1];
|
const defaultValue = this.config.macros[this.tab - 1];
|
||||||
|
console.log(defaultValue);
|
||||||
document.getElementById(`macros-name-${this.tab - 1}`).value = defaultValue.name;
|
document.getElementById(`macros-name-${this.tab - 1}`).value = defaultValue.name;
|
||||||
document.getElementById(`macros-color-${this.tab - 1}`).value = defaultValue.color;
|
document.getElementById(`macros-color-${this.tab - 1}`).value = defaultValue.color;
|
||||||
document.getElementById("gcode-field").value = "";
|
document.getElementById("gcode-field").value = "";
|
||||||
this.$set("newGcode[this.tab]", "");
|
this.$set("newGcode[this.tab-1]", "");
|
||||||
this.config.macros[this.tab - 1].file_name = "default";
|
this.config.macros[this.tab - 1].file_name = "default";
|
||||||
},
|
},
|
||||||
deleteAllMacros: async function () {
|
deleteAllMacros: async function () {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ script#macros-template(type="text/x-template")
|
|||||||
|
|
||||||
div(slot="footer")
|
div(slot="footer")
|
||||||
button.pure-button(@click="confirmReset=false") Cancel
|
button.pure-button(@click="confirmReset=false") Cancel
|
||||||
button.pure-button.pure-button-primary(@click="deleteAllMacros")
|
button.pure-button.button-error(@click="deleteAllMacros")
|
||||||
| Delete All
|
| Delete All
|
||||||
|
|
||||||
message(:show.sync="confirmSave")
|
message(:show.sync="confirmSave")
|
||||||
@@ -24,7 +24,7 @@ script#macros-template(type="text/x-template")
|
|||||||
p(slot="body")
|
p(slot="body")
|
||||||
div(slot="footer")
|
div(slot="footer")
|
||||||
button.pure-button(@click="deleteGCode = false") Cancel
|
button.pure-button(@click="deleteGCode = false") Cancel
|
||||||
button.pure-button.button-success(@click="delete_current")
|
button.pure-button.button-error(@click="delete_current")
|
||||||
.fa.fa-trash
|
.fa.fa-trash
|
||||||
| Selected
|
| Selected
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ script#macros-template(type="text/x-template")
|
|||||||
p(slot="body")
|
p(slot="body")
|
||||||
div(slot="footer")
|
div(slot="footer")
|
||||||
button.pure-button(@click="deleteSelected = false") Cancel
|
button.pure-button(@click="deleteSelected = false") Cancel
|
||||||
button.pure-button.button-success(@click="deleteSelectedMacros")
|
button.pure-button.button-error(@click="deleteSelectedMacros")
|
||||||
.fa.fa-trash
|
.fa.fa-trash
|
||||||
| Yes
|
| Yes
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user