From 8ef89d42f0009d40d232aeca5b2ebf61a827a00f Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sun, 5 Dec 2021 16:55:50 +0100 Subject: [PATCH] fix: enable g-code files, history and jobqueue when klipper is not ready also disable all start print buttons in each component Signed-off-by: Stefan Dej --- src/components/TheSidebar.vue | 14 ++++++++------ src/components/panels/GcodefilesPanel.vue | 4 ++-- src/components/panels/HistoryListPanel.vue | 2 +- src/components/panels/JobqueuePanel.vue | 1 + src/routes/index.ts | 6 +++--- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/components/TheSidebar.vue b/src/components/TheSidebar.vue index 0b138e22..c6ce91cd 100644 --- a/src/components/TheSidebar.vue +++ b/src/components/TheSidebar.vue @@ -147,15 +147,17 @@ export default class TheSidebarAlt extends Mixins(BaseMixin) { } showInNavi(route: AppRoute): boolean { - if (['shutdown', 'error', 'disconnected'].includes(this.klippy_state) && !route.alwaysShow) return false + let bool = true - if (route.title === 'Webcam') return this.boolNaviWebcam + if (['shutdown', 'error', 'disconnected'].includes(this.klippy_state) && !route.alwaysShow) bool = false - if (route.moonrakerComponent) return this.moonrakerComponents.includes(route.moonrakerComponent) - if (route.registeredDirectory) return this.registeredDirectories.includes(route.registeredDirectory) - if (route.klipperComponent) return (route.klipperComponent in this.klipperConfigfileSettings) + if (route.title === 'Webcam' && !this.boolNaviWebcam) bool = false - return true + if (route.moonrakerComponent && !this.moonrakerComponents.includes(route.moonrakerComponent)) bool = false + if (route.registeredDirectory && !this.registeredDirectories.includes(route.registeredDirectory)) bool = false + if (route.klipperComponent && !(route.klipperComponent in this.klipperConfigfileSettings)) bool = false + + return bool } mounted() { diff --git a/src/components/panels/GcodefilesPanel.vue b/src/components/panels/GcodefilesPanel.vue index 5ca2b526..9a0eb9ae 100644 --- a/src/components/panels/GcodefilesPanel.vue +++ b/src/components/panels/GcodefilesPanel.vue @@ -268,13 +268,13 @@ {{ $t('Files.Cancel')}} - {{$t('Files.StartPrint')}} + {{$t('Files.StartPrint')}} - + mdi-play {{ $t('Files.PrintStart')}} diff --git a/src/components/panels/HistoryListPanel.vue b/src/components/panels/HistoryListPanel.vue index 78e0202d..c9f0fe65 100644 --- a/src/components/panels/HistoryListPanel.vue +++ b/src/components/panels/HistoryListPanel.vue @@ -131,7 +131,7 @@ mdi-text-box-search {{ $t('History.Details') }} - + mdi-printer {{ $t('History.Reprint') }} diff --git a/src/components/panels/JobqueuePanel.vue b/src/components/panels/JobqueuePanel.vue index c5bf1e1f..3e2d7d77 100644 --- a/src/components/panels/JobqueuePanel.vue +++ b/src/components/panels/JobqueuePanel.vue @@ -13,6 +13,7 @@ icon tile v-if="queueState === 'paused'" + :disabled="!klipperReadyForGui" >