naming conventions

This commit is contained in:
sanjayk03-dev
2024-03-29 01:22:01 +05:30
parent d129c0290c
commit ab186be3ea
2 changed files with 10 additions and 12 deletions

View File

@@ -60,7 +60,7 @@ module.exports = {
open: function () {
utils.clickFileInput("gcode-file-input");
},
updateNewGcode: function (event) {
update_new_gcode: function (event) {
if (this.tab != 0) {
this.newGcode = event.target.value;
this.$dispatch("macros-edited");
@@ -93,7 +93,7 @@ module.exports = {
});
});
},
loadMacrosGcode: async function () {
load: async function () {
if (this.tab == 0) {
return;
}
@@ -115,7 +115,7 @@ module.exports = {
this.$dispatch("macros-edited");
}
},
uploadMacrosGcode: async function (e) {
upload: async function (e) {
const files = e.target.files || e.dataTransfer.files;
if (!files.length) {
return;
@@ -148,18 +148,16 @@ module.exports = {
console.error("Restore Failed: ", error);
alert("Restore failed");
}
} else {
//
}
this.$dispatch("macros-edited");
try {
await this.showDialogAsync("Upload", file);
this.loadMacrosGcode();
this.load();
} catch (error) {
console.error("Error uploading: ", error);
}
},
uploadGCode: async function (filename, file) {
upload_gcode: async function (filename, file) {
const xhr = new XMLHttpRequest();
xhr.onload = function () {
@@ -217,7 +215,7 @@ module.exports = {
var file = this.newGcode;
if (file.trim() != "") {
this.uploadGCode(file_name, file);
this.upload_gcode(file_name, file);
}
this.config.macros[this.tab - 1].name = this.macrosName;
@@ -269,7 +267,7 @@ module.exports = {
document.getElementById("macros-color").value = defaultValue.color;
this.isChecked = defaultValue.alert;
this.fileName = defaultValue.file_name;
this.loadMacrosGcode();
this.load();
}
this.edited = false;
},

View File

@@ -88,7 +88,7 @@ script#macros-template(type="text/x-template")
p.title Macro G-Code
.flex-row-container
select(id="gcode-select",title="Select previously uploaded GCode programs.",selected
v-model="fileName",@change="loadMacrosGcode", :disabled="!is_ready",
v-model="fileName",@change="load", :disabled="!is_ready",
style="max-width:100%;height:40px;border-radius:5px")
option( selected='' value='default') Create G-Code
option(v-for="file in macros_gcode_list", :value="file") {{file}}
@@ -98,14 +98,14 @@ script#macros-template(type="text/x-template")
.fa.fa-upload
form.gcode-file-input.file-upload
input(type="file", @change="uploadMacrosGcode", :disabled="!is_ready",
input(type="file", @change="upload", :disabled="!is_ready",
accept=".nc,.ngc,.gcode,.gc")
button.config-button.button-blue(title="Delete Macro GCode",@click="deleteGCode = true",
:disabled="!fileName =='default'") Delete
.fa.fa-trash
br
.gcodeContainer
textarea.new-gcode(id="gcode-field", v-model="newGcode" ,@keypress="updateNewGcode")
textarea.new-gcode(id="gcode-field", v-model="newGcode" ,@keypress="update_new_gcode")
button.submit-macros.button-success(title="Save Macro",@click="confirmSave=true",:disabled="!edited") Save
button.submit-macros(title="Cancel Macro",@click="clear_macro",style="margin-left:5px;background-color:#fafafa;",:disabled="initial_tab") Cancel