From cbf6fc6f0d36f76c35520b2e786b34d856bd4f0b Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Mon, 4 Nov 2024 19:17:15 +0530 Subject: [PATCH] bug fix, conditional rendering of rotary control buttons --- src/pug/index.pug | 2 +- src/pug/templates/control-view.pug | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/pug/index.pug b/src/pug/index.pug index ee51eec..be60861 100644 --- a/src/pug/index.pug +++ b/src/pug/index.pug @@ -93,7 +93,7 @@ html(lang="en") div button.rotary-button(:disabled="!enable_rotary", :class="is_rotary_active && 'active'", @click="toggle_rotary") - img(src="/images/rotary.svg", alt="rotary", style="is_rotary_active ? 'width:90%;' : 'width:85%;'") + img(src="/images/rotary.svg", alt="rotary", :style="is_rotary_active ? 'width:90%;' : 'width:85%;'") .video(title="Plug camera into USB.\n" + "Left click to toggle video size.\n" + diff --git a/src/pug/templates/control-view.pug b/src/pug/templates/control-view.pug index af8c6ac..f43b719 100644 --- a/src/pug/templates/control-view.pug +++ b/src/pug/templates/control-view.pug @@ -97,7 +97,25 @@ script#control-view-template(type="text/x-template") td(style="height:100px",align="center") button(:style="getJogIncrStyle('large')", @click="jog_incr = 'large'") span {{jog_incr_amounts[display_units].large}}#[span.jog-units {{metric ? 'mm' : 'in'}}] - tr + + tr(v-if="is_rotary_active") + td(style="height:100px", align="center", colspan="2") + button(@click="console.log('button pressed: Probe Rotary')") + | Probe Rotary + + td(style="height:100px", align="center", colspan="2") + button(@click="console.log('button pressed: A-')") + | A- + + td(style="height:100px", align="center", colspan="2") + button(@click="console.log('button pressed: A Origin')") + | A Origin + + td(style="height:100px", align="center", colspan="2") + button(@click="console.log('button pressed: A+')") + | A+ + + tr(v-else) td(style="height:100px", align="center", colspan="2") button(:class="state['pw'] ? '' : 'load-on'", style="height:100px;width:200px", @@ -278,10 +296,8 @@ script#control-view-template(type="text/x-template") title="{{is_running ? 'Pause' : 'Start'}} program.", @click="start_pause", :disabled="!state.selected", style="height:100px;width:100px;font-weight:normal") - if is_running - img(src="images/pause_gcode.png" style="height: 55px;") - else - img(src="images/play_gcode.png" style="height: 55px;") + img(v-if="is_running" src="images/pause_gcode.png" style="height: 55px;") + img(v-else src="images/play_gcode.png" style="height: 55px;") button.pure-button(title="Stop program.", @click="stop", style="height:100px;width:100px;font-weight:normal") img(src="images/stop.png" style="height: 55px;")