trying file name and removed default name in config

This commit is contained in:
sanjayk03-dev
2024-01-12 01:24:01 +05:30
parent bc0242b242
commit 04b2a66093
2 changed files with 9 additions and 13 deletions

View File

@@ -77,8 +77,16 @@ module.exports = {
});
},
saveMacros: async function () {
var macrosName = document.getElementById(
`macros-name-${this.tab-1}`
).value;
var macrosColor = document.getElementById(
`macros-color-${this.tab-1}`
).value;
if(this.state.selected =='default'){
const file = this.newGcode[this.tab-1];
file.name = macrosName;
SvelteComponents.showDialog("Upload", {
file,
onComplete: () => {
@@ -87,20 +95,13 @@ module.exports = {
},
});
}
var macrosName = document.getElementById(
`macros-name-${this.tab-1}`
).value;
var macrosColor = document.getElementById(
`macros-color-${this.tab-1}`
).value;
console.log(this.tab-1);
console.log(macrosColor, macrosName);
this.config.macros[this.tab-1].name = macrosName;
console.log(this.config.macros[this.tab-1].name);
this.config.macros[this.tab-1].color = macrosColor;
this.config.macros[this.tab-1].gcode_file_name = this.state.selected;
this.config.macros[this.tab-1].gcode_file_name = file.name;
this.config.macros[this.tab-1].gcode_file_time =
this.state.selected_time;
console.log(this.config.macros);

View File

@@ -638,11 +638,6 @@
}
],
"template": {
"name": {
"type": "enum",
"values": ["FireLaser", "Home", "Perk", "Spindle Warmup", "Spindle ON", "Spindle OFF","Vacuum ON","Vacuum OFF"],
"default": " "
},
"color": {
"type": "text",
"default": "#e6e6e6"