From b35eb23193e4b4dca59b518d5ca6fdb0e17fa082 Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Fri, 5 Jan 2024 00:31:18 +0530 Subject: [PATCH] fixed cancel with id, --- src/js/macros.js | 4 ++-- src/pug/templates/macros.pug | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/js/macros.js b/src/js/macros.js index 338c22b..39f53c2 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -80,7 +80,7 @@ module.exports = { this.config.macros[id].gcode_file_name = this.state.selected; this.config.macros[id].gcode_file_time = this.state.selected_time; console.log(this.config.macros); - this.cancelMacros(); + this.cancelMacros(id); try { await api.put("config/save", this.config); console.log("Successfully saved"); @@ -134,7 +134,7 @@ module.exports = { gcode_file_time: 0, }, ]; - this.confirmReset=false; + this.confirmReset = false; try { await api.put("config/save", this.config); console.log("Successfully flushed"); diff --git a/src/pug/templates/macros.pug b/src/pug/templates/macros.pug index 94f263b..ddcf931 100644 --- a/src/pug/templates/macros.pug +++ b/src/pug/templates/macros.pug @@ -44,15 +44,16 @@ script#macros-template(type="text/x-template") input.input-name(type="text",minlength='1',maxlength='15',id="macros-name-0") p.title G-Code .select-upload-gcode - select(title="Select previously uploaded GCode programs.", + select#gcodeSelect(title="Select previously uploaded GCode programs.",selected v-model="state.selected",@change="load", :disabled="!is_ready", style="max-width:100%;height:40px;border-radius:5px") + option(disabled='' selected='' value='default') -- select an option -- option(v-for="file in state.files", :value="file") {{file}} button.pure-button(title="Upload a new GCode program.", @click="open", :disabled="!is_ready",style="height:40px;width:130px;font-weight:normal;border-radius:5px;margin-left:4px;background-color:#5a9ad7;color:#fff;display:flex;align-items:center;justify-content:space-around") Upload .fa.fa-upload - + form.gcode-file-input.file-upload input(type="file", @change="upload", :disabled="!is_ready", accept=".nc,.ngc,.gcode,.gc")