fix: dont polling printer.info in klipper state disconnected
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
parent
d161cf875c
commit
f12d0dd89b
@ -13,21 +13,23 @@
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list dense>
|
||||
<v-subheader class="" style="height: auto;">{{ $t("App.TopCornerMenu.KlipperControl") }}</v-subheader>
|
||||
<v-list-item class="minheight30 pr-2" link @click="klipperRestart()">
|
||||
<v-list-item-title>{{ $t("App.TopCornerMenu.KlipperRestart") }}</v-list-item-title>
|
||||
<v-list-item-action class="my-0 d-flex flex-row" style="min-width: auto;">
|
||||
<v-icon class="mr-2" small>mdi-restart</v-icon>
|
||||
</v-list-item-action>
|
||||
</v-list-item>
|
||||
<v-list-item class="minheight30 pr-2" link @click="klipperFirmwareRestart()">
|
||||
<v-list-item-title>{{ $t("App.TopCornerMenu.KlipperFirmwareRestart") }}</v-list-item-title>
|
||||
<v-list-item-action class="my-0 d-flex flex-row" style="min-width: auto;">
|
||||
<v-icon class="mr-2" small>mdi-restart</v-icon>
|
||||
</v-list-item-action>
|
||||
</v-list-item>
|
||||
<template v-if="klipperState !== 'disconnected'">
|
||||
<v-subheader class="" style="height: auto;">{{ $t("App.TopCornerMenu.KlipperControl") }}</v-subheader>
|
||||
<v-list-item class="minheight30 pr-2" link @click="klipperRestart()">
|
||||
<v-list-item-title>{{ $t("App.TopCornerMenu.KlipperRestart") }}</v-list-item-title>
|
||||
<v-list-item-action class="my-0 d-flex flex-row" style="min-width: auto;">
|
||||
<v-icon class="mr-2" small>mdi-restart</v-icon>
|
||||
</v-list-item-action>
|
||||
</v-list-item>
|
||||
<v-list-item class="minheight30 pr-2" link @click="klipperFirmwareRestart()">
|
||||
<v-list-item-title>{{ $t("App.TopCornerMenu.KlipperFirmwareRestart") }}</v-list-item-title>
|
||||
<v-list-item-action class="my-0 d-flex flex-row" style="min-width: auto;">
|
||||
<v-icon class="mr-2" small>mdi-restart</v-icon>
|
||||
</v-list-item-action>
|
||||
</v-list-item>
|
||||
</template>
|
||||
<template v-if="services.length">
|
||||
<v-divider class="mt-0"></v-divider>
|
||||
<v-divider class="mt-0" v-if="klipperState !== 'disconnected'"></v-divider>
|
||||
<v-subheader class="pt-2" style="height: auto;">{{ $t("App.TopCornerMenu.ServiceControl") }}</v-subheader>
|
||||
<v-list-item class="minheight30 pr-2" v-for="service in services" v-bind:key="service">
|
||||
<v-list-item-title>
|
||||
|
@ -58,7 +58,7 @@ export default class KlippyStatePanel extends Mixins(BaseMixin) {
|
||||
|
||||
@Watch('klipperState')
|
||||
klipperStateChanged(newVal: string) {
|
||||
if (newVal === 'ready') {
|
||||
if (['ready', 'disconnected'].includes(newVal)) {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
<template>
|
||||
<panel
|
||||
v-if="socketIsConnected"
|
||||
v-if="socketIsConnected && klipperState !== 'disconnected'"
|
||||
icon="mdi-console-line"
|
||||
:title="$t('Panels.MiniconsolePanel.Headline')"
|
||||
:collapsible="true"
|
||||
|
@ -57,10 +57,12 @@ export const actions: ActionTree<SocketState, RootState> = {
|
||||
break
|
||||
|
||||
case 'notify_klippy_disconnected':
|
||||
window.console.log('notify disconnected')
|
||||
commit('server/setKlippyDisconnected', null, { root: true })
|
||||
break
|
||||
|
||||
case 'notify_klippy_shutdown':
|
||||
window.console.log('notify shutdown')
|
||||
commit('server/setKlippyShutdown', null, { root: true })
|
||||
break
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user