bug fix, conditional rendering of rotary control buttons

This commit is contained in:
sanjayk03-dev
2024-11-04 19:17:15 +05:30
parent 4c52c56449
commit cbf6fc6f0d
2 changed files with 22 additions and 6 deletions

View File

@@ -93,7 +93,7 @@ html(lang="en")
div div
button.rotary-button(:disabled="!enable_rotary", :class="is_rotary_active && 'active'", @click="toggle_rotary") 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" + .video(title="Plug camera into USB.\n" +
"Left click to toggle video size.\n" + "Left click to toggle video size.\n" +

View File

@@ -97,7 +97,25 @@ script#control-view-template(type="text/x-template")
td(style="height:100px",align="center") td(style="height:100px",align="center")
button(:style="getJogIncrStyle('large')", @click="jog_incr = 'large'") button(:style="getJogIncrStyle('large')", @click="jog_incr = 'large'")
span {{jog_incr_amounts[display_units].large}}#[span.jog-units {{metric ? 'mm' : 'in'}}] 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") td(style="height:100px", align="center", colspan="2")
button(:class="state['pw'] ? '' : 'load-on'", button(:class="state['pw'] ? '' : 'load-on'",
style="height:100px;width:200px", style="height:100px;width:200px",
@@ -278,10 +296,8 @@ script#control-view-template(type="text/x-template")
title="{{is_running ? 'Pause' : 'Start'}} program.", title="{{is_running ? 'Pause' : 'Start'}} program.",
@click="start_pause", :disabled="!state.selected", @click="start_pause", :disabled="!state.selected",
style="height:100px;width:100px;font-weight:normal") style="height:100px;width:100px;font-weight:normal")
if is_running img(v-if="is_running" src="images/pause_gcode.png" style="height: 55px;")
img(src="images/pause_gcode.png" style="height: 55px;") img(v-else src="images/play_gcode.png" style="height: 55px;")
else
img(src="images/play_gcode.png" style="height: 55px;")
button.pure-button(title="Stop program.", @click="stop", style="height:100px;width:100px;font-weight:normal") button.pure-button(title="Stop program.", @click="stop", style="height:100px;width:100px;font-weight:normal")
img(src="images/stop.png" style="height: 55px;") img(src="images/stop.png" style="height: 55px;")