modified save func, corrected form tag

This commit is contained in:
sanjayk03-dev
2024-01-02 16:23:19 +05:30
parent 6feca58a81
commit ccf5ff651f
2 changed files with 19 additions and 26 deletions

View File

@@ -82,29 +82,22 @@ module.exports = {
}); });
}, },
saveMacros: async function(id){ saveMacros: async function(id){
console.log(typeof(id)," type");
var macrosName = document.getElementById(`macros-name-${id}`).value; var macrosName = document.getElementById(`macros-name-${id}`).value;
var macrosColor = document.getElementById(`macros-color-${id}`).value; var macrosColor = document.getElementById(`macros-color-${id}`).value;
console.log(macrosName); this.config.macros[id].name=macrosName;
console.log(macrosColor); this.config.macros[id].color=macrosColor;
// if(this.config.macros == undefined) { this.config.macros[id].gcode=this.state.selected;
// console.log("macros is undefined");
// this.config.macros=[]; console.log(this.config.macros);
// }else{ try {
// this.config.macros[id].name=macrosName; await api.put("config/save",this.config);
// this.config.macros[id].color=macrosColor; console.log("Successfully saved");
// this.config.macros[id].gcode=this.state.selected; this.$dispatch("update");
// } } catch (error) {
// console.log(this.config.macros); console.error("Restore Failed: ",error);
// try { alert("Restore failed");
// await api.put("config/save",this.config); }
// console.log("Successfully saved");
// this.$dispatch("update");
// } catch (error) {
// console.error("Restore Failed: ",error);
// alert("Restore failed");
// }
}, },
printConfig: function(){ printConfig: function(){
console.log(this.config); console.log(this.config);

View File

@@ -209,17 +209,17 @@ script#control-view-template(type="text/x-template")
.macros-div(class="present") .macros-div(class="present")
button.macros-buttons(title="Click to run Macros 1", @click="open", button.macros-buttons(title="Click to run Macros 1", @click="open",
:disabled="!isMacrosPresent(0)",style="height:60px;width:100px;font-weight:normal") Macros 1 :disabled="!true",style="height:60px;width:100px;font-weight:normal;border-radius:4px") Macros 1
button.macros-buttons(title="Click to run Macros 2", @click="open", button.macros-buttons(title="Click to run Macros 2", @click="open",
:disabled="!isMacrosPresent(1)",style="height:60px;width:100px;font-weight:normal") Macros 2 :disabled="!true",style="height:60px;width:100px;font-weight:normal;border-radius:4px") Macros 2
button.macros-buttons(title="Click to run Macros 3", @click="open", button.macros-buttons(title="Click to run Macros 3", @click="open",
:disabled="!isMacrosPresent(2)",style="height:60px;width:100px;font-weight:normal") Macros 3 :disabled="!true",style="height:60px;width:100px;font-weight:normal;border-radius:4px") Macros 3
button.macros-buttons(title="Click to run Macros 4", @click="open", button.macros-buttons(title="Click to run Macros 4", @click="open",
:disabled="!isMacrosPresent(3)",style="height:60px;width:100px;font-weight:normal") Macros 4 :disabled="!true",style="height:60px;width:100px;font-weight:normal;border-radius:4px") Macros 4
button.macros-buttons(title="Click to run Macros 5", @click="open", button.macros-buttons(title="Click to run Macros 5", @click="open",
:disabled="!isMacrosPresent(4)",style="height:60px;width:100px;font-weight:normal") Macros 5 :disabled="!true",style="height:60px;width:100px;font-weight:normal;border-radius:4px") Macros 5
button.macros-buttons(title="Click to run Macros 6", @click="open", button.macros-buttons(title="Click to run Macros 6", @click="open",
:disabled="!isMacrosPresent(5)",style="height:60px;width:100px;font-weight:normal") Macros 6 :disabled="!true",style="height:60px;width:100px;font-weight:normal;border-radius:4px") Macros 6
.tabs .tabs