* fix: truncated settings menu Signed-off-by: steadyjaw <martin.keilaus@gmail.com> * refactor: change probe chips to label Signed-off-by: steadyjaw <martin.keilaus@gmail.com> * refactor(timelapse): change button color and make responsive Signed-off-by: steadyjaw <martin.keilaus@gmail.com> * refactor: change display helpers of some buttons * fix(#390): encodeURI of thumbnails in files page Signed-off-by: steadyjaw <martin.keilaus@gmail.com> * fix: responsivity of timelapse-page Signed-off-by: steadyjaw <martin.keilaus@gmail.com> * refactor(timelapse): more responsiveness Signed-off-by: steadyjaw <martin.keilaus@gmail.com> * refactor(timelapse): no frames found visibility Signed-off-by: steadyjaw <martin.keilaus@gmail.com> * refactor: tooltip on disabled retract /extrude buttons * refactor(editor): show "read-only" in title if file is not writable * fix: visibility of reload button Signed-off-by: steadyjaw <martin.keilaus@gmail.com> * refactor: select printer dialog new ui style Signed-off-by: steadyjaw <martin.keilaus@gmail.com> * refactor: add attach prop to inputs w dropdowns Signed-off-by: steadyjaw <martin.keilaus@gmail.com> * fix: paddings of panels on spec. viewports Signed-off-by: steadyjaw <martin.keilaus@gmail.com> * refactor: hide spin buttons on number inputs Signed-off-by: steadyjaw <martin.keilaus@gmail.com> * refactor: hide-spin-buttons after merging timelapseTab Signed-off-by: steadyjaw <martin.keilaus@gmail.com>
79 lines
2.5 KiB
Vue
79 lines
2.5 KiB
Vue
<style scoped>
|
|
.tool-input {
|
|
min-width: 5rem;
|
|
margin-top: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
.tool-input .v-input__slot { margin-bottom: 0; }
|
|
.tool-input .v-text-field__details { display: none; }
|
|
|
|
.tool-input input {
|
|
-moz-appearance: textfield;
|
|
}
|
|
.tool-input input::-webkit-outer-spin-button,
|
|
.tool-input input::-webkit-inner-spin-button {
|
|
-webkit-appearance: none;
|
|
margin: 0;
|
|
}
|
|
</style>
|
|
|
|
<template>
|
|
<v-combobox
|
|
dense
|
|
hide-details
|
|
v-model="value"
|
|
:items="items"
|
|
item-text="value"
|
|
type="number"
|
|
@change="setTemps"
|
|
attach
|
|
hide-spin-buttons
|
|
></v-combobox>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import Component from 'vue-class-component'
|
|
import {Mixins, Prop, Watch} from 'vue-property-decorator'
|
|
import BaseMixin from '@/components/mixins/base'
|
|
|
|
@Component
|
|
export default class ToolInput extends Mixins(BaseMixin) {
|
|
private value: any = 0
|
|
|
|
@Prop({ type: String, required: true }) readonly name!: string
|
|
@Prop({ type: Number, required: true, default: 0 }) readonly target!: number
|
|
@Prop({ type: Number, required: true }) readonly min_temp!: number
|
|
@Prop({ type: Number, required: true }) readonly max_temp!: number
|
|
@Prop({ type: String, required: true }) readonly command!: string
|
|
@Prop({ type: String, required: true }) readonly attributeName!: string
|
|
@Prop({ type: Array, default: [] }) items!: number[]
|
|
|
|
setTemps(): void {
|
|
if (typeof this.value === 'object') this.value = this.value.value ?? 0
|
|
if (this.value === '') this.value = 0
|
|
|
|
if (this.value > this.max_temp) {
|
|
this.value = { value: this.target, text: this.target }
|
|
this.$toast.error('Temperature too high for '+this.name+'! (max: '+this.max_temp+')')
|
|
} else if (this.value < this.min_temp && this.value != 0) {
|
|
this.value = { value: this.target, text: this.target }
|
|
this.$toast.error('Temperature too low for '+this.name+'! (min: '+this.min_temp+')')
|
|
} else {
|
|
const gcode = this.command+' '+this.attributeName+'='+this.name+' TARGET='+this.value
|
|
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
|
this.$socket.emit('printer.gcode.script', { script: gcode })
|
|
}
|
|
}
|
|
|
|
mounted() {
|
|
this.value = this.target
|
|
}
|
|
|
|
@Watch('target')
|
|
targetChanged(newVal: number): void {
|
|
this.value = newVal
|
|
}
|
|
|
|
}
|
|
</script> |