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 () { 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'){ if(this.state.selected =='default'){
const file = this.newGcode[this.tab-1]; const file = this.newGcode[this.tab-1];
file.name = macrosName;
SvelteComponents.showDialog("Upload", { SvelteComponents.showDialog("Upload", {
file, file,
onComplete: () => { 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(this.tab-1);
console.log(macrosColor, macrosName);
this.config.macros[this.tab-1].name = macrosName; this.config.macros[this.tab-1].name = macrosName;
console.log(this.config.macros[this.tab-1].name); console.log(this.config.macros[this.tab-1].name);
this.config.macros[this.tab-1].color = macrosColor; 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.config.macros[this.tab-1].gcode_file_time =
this.state.selected_time; this.state.selected_time;
console.log(this.config.macros); console.log(this.config.macros);

View File

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