created tabs for macros and buttons in control-view

This commit is contained in:
sanjayk03-dev
2024-01-02 14:54:53 +05:30
parent 6aaf167d4e
commit 06b1cde647
6 changed files with 148 additions and 41 deletions

View File

@@ -202,8 +202,8 @@ module.exports = {
const p = this.plan_time / this.toolpath.time;
return Math.min(1, p);
},
isMacrosPresent: function(){
return this.config.macros!=undefined;
isMacrosPresent: function(val){
return this.config.macros[val].name=null;
},
},

View File

@@ -9,7 +9,7 @@ module.exports = {
data: function (){
return {
toolpath_progress: 0,
tab: "1",
}
},
components: {
@@ -81,16 +81,16 @@ module.exports = {
}
});
},
saveMacros: async function(){
saveMacros: async function(id){
var macrosName = document.getElementById("macros-name").value;
var macrosColor = document.getElementById("macros-color").value;
if(this.config.macros == undefined) {
console.log("macros is undefined");
this.config.macros=[];
}else{
this.config.macros[0].name=macrosName;
this.config.macros[0].color=macrosColor;
this.config.macros[0].gcode=this.state.selected;
this.config.macros[id].name=macrosName;
this.config.macros[id].color=macrosColor;
this.config.macros[id].gcode=this.state.selected;
}
console.log(this.config.macros);
try {