Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeanon committed Dec 22, 2024
1 parent 45b861e commit 8b89707
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mainsail",
"version": "2.13.4",
"version": "2.13.3",
"private": true,
"decription": "a klipper web interface",
"author": {
Expand Down
13 changes: 13 additions & 0 deletions src/components/panels/Temperature/TemperaturePanelList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ export default class TemperaturePanelList extends Mixins(BaseMixin) {
// hide MCU & Host sensors, if the function is enabled
if (this.hideMcuHostSensors && this.checkMcuHostSensor(fullName)) return false
if (this.mcuSensorDisconnected(fullName)) return false
return !this.mpcBlockTemperatures.includes(fullName)
&& !this.mpcAmbientTemperatures.includes(fullName)
})
Expand All @@ -160,6 +162,17 @@ export default class TemperaturePanelList extends Mixins(BaseMixin) {
return ['temperature_mcu', 'temperature_host'].includes(sensor_type)
}
mcuSensorDisconnected(fullName: string) {
const settingsObject = this.settings[fullName.toLowerCase()] ?? {}
const sensor_type = settingsObject.sensor_type ?? ''
if (sensor_type != "temperature_mcu") return false
if (!(("mcu " + settingsObject.sensor_mcu) in this.$store.state.printer)) return false
const mcu = this.$store.state.printer["mcu " + settingsObject.sensor_mcu]
return mcu.non_critical_disconnected ?? false
}
filterNamesAndSort(fullNames: string[]) {
return fullNames.filter(this.isVisibleName).sort(this.sortObjectName)
}
Expand Down
35 changes: 31 additions & 4 deletions src/components/ui/TopCornerMenuService.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
<v-icon small>{{ mdiStop }}</v-icon>
</v-btn>
</v-list-item-action>
<confirmation-dialog
:show="showStartDialog"
:title="dialogStartTitle"
:text="dialogStartDescription"
:action-button-text="$t('App.TopCornerMenu.Start')"
:cancel-button-text="$t('App.TopCornerMenu.Cancel')"
@action="serviceStart"
@close="showStartDialog = false" />
<confirmation-dialog
:show="showRestartDialog"
:title="dialogRestartTitle"
Expand Down Expand Up @@ -55,6 +63,7 @@ export default class TopCornerMenuService extends Mixins(BaseMixin, ServiceMixin
showRestartDialog = false
showStopDialog = false
showStartDialog = false
get name() {
if (this.hideOtherInstances && this.service === this.klipperInstance) return 'Klipper'
Expand All @@ -79,6 +88,10 @@ export default class TopCornerMenuService extends Mixins(BaseMixin, ServiceMixin
return null
}
get dialogStartTitle() {
return this.$t('App.TopCornerMenu.ConfirmationDialog.Title.ServiceStart')
}
get dialogRestartTitle() {
if (this.service === this.klipperInstance)
return this.$t('App.TopCornerMenu.ConfirmationDialog.Title.KlipperRestart')
Expand All @@ -90,18 +103,22 @@ export default class TopCornerMenuService extends Mixins(BaseMixin, ServiceMixin
return this.$t('App.TopCornerMenu.ConfirmationDialog.Title.ServiceStop')
}
get dialogStartDescription() {
return this.$t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceStart', {serviceName: this.service}).toString()
}
get dialogRestartDescription() {
if (this.service === this.klipperInstance)
return this.$t('App.TopCornerMenu.ConfirmationDialog.Description.KlipperRestart')
return this.$t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceRestart')
return this.$t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceRestart', {serviceName: this.service}).toString()
}
get dialogStopDescription() {
if (this.service === this.klipperInstance)
return this.$t('App.TopCornerMenu.ConfirmationDialog.Description.KlipperStop')
return this.$t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceStop')
return this.$t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceStop', {serviceName: this.service}).toString()
}
get disableStopButton() {
Expand All @@ -113,8 +130,12 @@ export default class TopCornerMenuService extends Mixins(BaseMixin, ServiceMixin
}
clickStart() {
this.$socket.emit('machine.services.start', { service: this.service })
this.closeMenu()
if (this.printerIsPrinting) {
this.showStartDialog = true
return
}
this.serviceStart()
}
clickRestart() {
Expand All @@ -135,6 +156,12 @@ export default class TopCornerMenuService extends Mixins(BaseMixin, ServiceMixin
this.serviceStop()
}
serviceStart() {
this.showStartDialog = false
this.$socket.emit('machine.services.start', { service: this.service })
this.closeMenu()
}
serviceRestart() {
this.showRestartDialog = false
this.$socket.emit('machine.services.restart', { service: this.service })
Expand Down

0 comments on commit 8b89707

Please sign in to comment.