testing with pug and variables

This commit is contained in:
sanjayk03-dev
2023-12-30 03:02:26 +05:30
parent 53aadd1f87
commit 63e473994a
2 changed files with 21 additions and 20 deletions

View File

@@ -13,12 +13,11 @@ module.exports = {
} }
}, },
components: { components: {
"axis-control": require("./axis-control"),
"path-viewer": require("./path-viewer"),
"gcode-viewer": require("./gcode-viewer") "gcode-viewer": require("./gcode-viewer")
}, },
computed:{ computed:{
is_ready: function() { is_ready: function() {
console.log("is_ready: ",this.mach_state);
return this.mach_state == "READY"; return this.mach_state == "READY";
}, },
}, },

View File

@@ -1,21 +1,23 @@
script#macros-template(type="text/x-template") script#macros-template(type="text/x-template")
#macros #macros
h2 Macros h2 Macros
input(type="text",id="inputField") input(type="text",id="inputField")
button.printVariable(title="print Varibale", @click='print()', button.printVariable(title="print Varibale", @click='print()',
style="height:100px;width:100px;font-weight:normal") style="height:100px;width:100px;font-weight:normal") PrintVariable
.fa.fa-folder-download button.printVariable(title="print Varibale", @click='print()',
button.pure-button(title="Upload a new GCode program.", @click="open", style="height:100px;width:200px;font-weight:normal") Print No of Macros
:disabled="!is_ready",style="height:100px;width:100px;font-weight:normal") button.pure-button(title="Upload a new GCode program.", @click="open",
.fa.fa-folder-open :disabled="!is_ready",style="height:100px;width:100px;font-weight:normal")
select(title="Select previously uploaded GCode programs.", .fa.fa-folder-open
v-model="state.selected", @change="load", :disabled="!is_ready", select(title="Select previously uploaded GCode programs.",
style="max-width:100%") v-model="state.selected", @change="load", :disabled="!is_ready",
option(v-for="file in state.files", :value="file") {{file}} style="max-width:100%")
option(v-for="file in state.files", :value="file") {{file}}
.progress(v-if="toolpath_progress && toolpath_progress < 1", .progress(v-if="toolpath_progress && toolpath_progress < 1",
title="Simulating GCode to check for errors, calculate ETA and " + title="Simulating GCode to check for errors, calculate ETA and " +
"generate 3D view. You can run GCode before the simulation " + "generate 3D view. You can run GCode before the simulation " +
"finishes.") "finishes.")
div(:style="'width:' + (toolpath_progress || 0) * 100 + '%'") div(:style="'width:' + (toolpath_progress || 0) * 100 + '%'")
label Simulating {{(toolpath_progress || 0) | percent}} label Simulating {{(toolpath_progress || 0) | percent}}
gcode-viewer