From 63e473994a9b4d022b02b40fcaf8d62ce4da008b Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Sat, 30 Dec 2023 03:02:26 +0530 Subject: [PATCH] testing with pug and variables --- src/js/macros.js | 3 +-- src/pug/templates/macros.pug | 38 +++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/js/macros.js b/src/js/macros.js index c18c8be..b41bda1 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -13,12 +13,11 @@ module.exports = { } }, components: { - "axis-control": require("./axis-control"), - "path-viewer": require("./path-viewer"), "gcode-viewer": require("./gcode-viewer") }, computed:{ is_ready: function() { + console.log("is_ready: ",this.mach_state); return this.mach_state == "READY"; }, }, diff --git a/src/pug/templates/macros.pug b/src/pug/templates/macros.pug index d37a13a..47809fc 100644 --- a/src/pug/templates/macros.pug +++ b/src/pug/templates/macros.pug @@ -1,21 +1,23 @@ script#macros-template(type="text/x-template") #macros - h2 Macros - input(type="text",id="inputField") - button.printVariable(title="print Varibale", @click='print()', - style="height:100px;width:100px;font-weight:normal") - .fa.fa-folder-download - button.pure-button(title="Upload a new GCode program.", @click="open", - :disabled="!is_ready",style="height:100px;width:100px;font-weight:normal") - .fa.fa-folder-open - select(title="Select previously uploaded GCode programs.", - v-model="state.selected", @change="load", :disabled="!is_ready", - style="max-width:100%") - option(v-for="file in state.files", :value="file") {{file}} + h2 Macros + input(type="text",id="inputField") + button.printVariable(title="print Varibale", @click='print()', + style="height:100px;width:100px;font-weight:normal") PrintVariable + button.printVariable(title="print Varibale", @click='print()', + style="height:100px;width:200px;font-weight:normal") Print No of Macros + button.pure-button(title="Upload a new GCode program.", @click="open", + :disabled="!is_ready",style="height:100px;width:100px;font-weight:normal") + .fa.fa-folder-open + select(title="Select previously uploaded GCode programs.", + v-model="state.selected", @change="load", :disabled="!is_ready", + style="max-width:100%") + option(v-for="file in state.files", :value="file") {{file}} - .progress(v-if="toolpath_progress && toolpath_progress < 1", - title="Simulating GCode to check for errors, calculate ETA and " + - "generate 3D view. You can run GCode before the simulation " + - "finishes.") - div(:style="'width:' + (toolpath_progress || 0) * 100 + '%'") - label Simulating {{(toolpath_progress || 0) | percent}} + .progress(v-if="toolpath_progress && toolpath_progress < 1", + title="Simulating GCode to check for errors, calculate ETA and " + + "generate 3D view. You can run GCode before the simulation " + + "finishes.") + div(:style="'width:' + (toolpath_progress || 0) * 100 + '%'") + label Simulating {{(toolpath_progress || 0) | percent}} + gcode-viewer