fixing big in macros name
This commit is contained in:
@@ -12,10 +12,13 @@ module.exports = {
|
|||||||
tab: "1",
|
tab: "1",
|
||||||
confirmReset: false,
|
confirmReset: false,
|
||||||
confirmSave: false,
|
confirmSave: false,
|
||||||
|
currentTab:undefined,
|
||||||
newGcode: ["", "", "", "", "", "", "", ""],
|
newGcode: ["", "", "", "", "", "", "", ""],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
"axis-control": require("./axis-control"),
|
||||||
|
"path-viewer": require("./path-viewer"),
|
||||||
"gcode-viewer": require("./gcode-viewer"),
|
"gcode-viewer": require("./gcode-viewer"),
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -35,7 +38,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateNewGcode(event) {
|
updateNewGcode(event) {
|
||||||
this.newGcode[this.tab - 1] = event.target.value;
|
this.newGcode[this.currentTab] = event.target.value;
|
||||||
},
|
},
|
||||||
open: function () {
|
open: function () {
|
||||||
utils.clickFileInput("gcode-file-input");
|
utils.clickFileInput("gcode-file-input");
|
||||||
@@ -77,23 +80,23 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
saveMacros: async function () {
|
saveMacros: async function () {
|
||||||
var macrosName = document.getElementById(
|
var macrosName = document.getElementById(
|
||||||
`macros-name-${this.tab - 1}`
|
`macros-name-${this.currentTab}`
|
||||||
).value;
|
).value;
|
||||||
var macrosColor = document.getElementById(
|
var macrosColor = document.getElementById(
|
||||||
`macros-color-${this.tab - 1}`
|
`macros-color-${this.currentTab}`
|
||||||
).value;
|
).value;
|
||||||
|
|
||||||
console.log(this.tab - 1);
|
console.log(this.currentTab);
|
||||||
console.log(macrosColor, macrosName);
|
console.log(macrosColor, macrosName);
|
||||||
|
|
||||||
this.config.macros[this.tab - 1].name = macrosName;
|
this.config.macros[this.currentTab].name = macrosName;
|
||||||
console.log(this.config.macros[this.tab-1]);
|
console.log(this.config.macros[this.tab-1]);
|
||||||
this.config.macros[this.tab - 1].color = macrosColor;
|
this.config.macros[this.currentTab].color = macrosColor;
|
||||||
this.config.macros[this.tab - 1].gcode_file_name = this.state.selected;
|
this.config.macros[this.currentTab].gcode_file_name = this.state.selected;
|
||||||
this.config.macros[this.tab - 1].gcode_file_time =
|
this.config.macros[this.currentTab].gcode_file_time =
|
||||||
this.state.selected_time;
|
this.state.selected_time;
|
||||||
console.log(this.config.macros);
|
console.log(this.config.macros);
|
||||||
this.cancelMacros(this.tab - 1);
|
this.cancelMacros(this.currentTab);
|
||||||
this.confirmSave = false;
|
this.confirmSave = false;
|
||||||
try {
|
try {
|
||||||
await api.put("config/save", this.config);
|
await api.put("config/save", this.config);
|
||||||
@@ -105,9 +108,9 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
cancelMacros: function () {
|
cancelMacros: function () {
|
||||||
document.getElementById(`macros-name-${this.tab - 1}`).value = "";
|
document.getElementById(`macros-name-${this.currentTab}`).value = "";
|
||||||
document.getElementById(`macros-color-${this.tab - 1}`).value = "#ffffff";
|
document.getElementById(`macros-color-${this.currentTab}`).value = "#ffffff";
|
||||||
document.getElementById(`gcodeSelect-${this.tab - 1}`).value = "default";
|
document.getElementById(`gcodeSelect-${this.currentTab}`).value = "default";
|
||||||
this.$broadcast("gcode-clear");
|
this.$broadcast("gcode-clear");
|
||||||
},
|
},
|
||||||
resetConfig: async function () {
|
resetConfig: async function () {
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
||||||
gcode-viewer(v-if="state.selected !== 'default'")
|
gcode-viewer(v-if="state.selected !== 'default'")
|
||||||
button.submit-macros(title="Save Macros",@click="confirmSave=true",
|
button.submit-macros(title="Save Macros",@click="currentTab=0;confirmSave=true",
|
||||||
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
||||||
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
||||||
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
||||||
@@ -107,7 +107,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
||||||
gcode-viewer(v-if="state.selected !== 'default'")
|
gcode-viewer(v-if="state.selected !== 'default'")
|
||||||
button.submit-macros(title="Save Macros",@click="confirmSave=true",
|
button.submit-macros(title="Save Macros",@click="currentTab=1;confirmSave=true",
|
||||||
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
||||||
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
||||||
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
||||||
@@ -137,7 +137,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
||||||
gcode-viewer(v-if="state.selected !== 'default'")
|
gcode-viewer(v-if="state.selected !== 'default'")
|
||||||
button.submit-macros(title="Save Macros",@click="confirmSave=true",
|
button.submit-macros(title="Save Macros",@click="currentTab=2;confirmSave=true",
|
||||||
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
||||||
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
||||||
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
||||||
@@ -167,7 +167,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
||||||
gcode-viewer(v-if="state.selected !== 'default'")
|
gcode-viewer(v-if="state.selected !== 'default'")
|
||||||
button.submit-macros(title="Save Macros",@click="confirmSave=true",
|
button.submit-macros(title="Save Macros",@click="currentTab=3;confirmSave=true",
|
||||||
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
||||||
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
||||||
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
||||||
@@ -197,7 +197,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
||||||
gcode-viewer(v-if="state.selected !== 'default'")
|
gcode-viewer(v-if="state.selected !== 'default'")
|
||||||
button.submit-macros(title="Save Macros",@click="confirmSave=true",
|
button.submit-macros(title="Save Macros",@click="currentTab=4;confirmSave=true",
|
||||||
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
||||||
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
||||||
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
||||||
@@ -227,7 +227,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
||||||
gcode-viewer(v-if="state.selected !== 'default'")
|
gcode-viewer(v-if="state.selected !== 'default'")
|
||||||
button.submit-macros(title="Save Macros",@click="confirmSave=true",
|
button.submit-macros(title="Save Macros",@click="currentTab=5;confirmSave=true",
|
||||||
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
||||||
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
||||||
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
||||||
@@ -257,7 +257,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
||||||
gcode-viewer(v-if="state.selected !== 'default'")
|
gcode-viewer(v-if="state.selected !== 'default'")
|
||||||
button.submit-macros(title="Save Macros",@click="confirmSave=true",
|
button.submit-macros(title="Save Macros",@click="currentTab=6;confirmSave=true",
|
||||||
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
||||||
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
||||||
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
||||||
@@ -287,7 +287,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode")
|
||||||
gcode-viewer(v-if="state.selected !== 'default'")
|
gcode-viewer(v-if="state.selected !== 'default'")
|
||||||
button.submit-macros(title="Save Macros",@click="confirmSave=true",
|
button.submit-macros(title="Save Macros",@click="currentTab=7;confirmSave=true",
|
||||||
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
|
||||||
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
button.submit-macros(title="Cancel Macros",@click="cancelMacros",
|
||||||
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel
|
||||||
|
|||||||
Reference in New Issue
Block a user