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 <meteyou@gmail.com>
This commit is contained in:
5 files changed
+15
-12
No files matched your search
@@ -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() {
|
||||
|
||||
@@ -268,13 +268,13 @@
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogPrintFile.show = false">{{ $t('Files.Cancel')}}</v-btn>
|
||||
<v-btn color="primary" text @click="startPrint(dialogPrintFile.item.filename)">{{$t('Files.StartPrint')}}</v-btn>
|
||||
<v-btn color="primary" text @click="startPrint(dialogPrintFile.item.filename)" :disabled="printerIsPrinting || !klipperReadyForGui">{{$t('Files.StartPrint')}}</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
|
||||
<v-list>
|
||||
<v-list-item @click="clickRow(contextMenu.item, true)" :disabled="['error', 'printing', 'paused'].includes(printer_state)" v-if="!contextMenu.item.isDirectory">
|
||||
<v-list-item @click="clickRow(contextMenu.item, true)" :disabled="printerIsPrinting || !klipperReadyForGui" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-play</v-icon> {{ $t('Files.PrintStart')}}
|
||||
</v-list-item>
|
||||
<v-list-item @click="addToQueue(contextMenu.item)" v-if="!contextMenu.item.isDirectory && moonrakerComponents.includes('job_queue')">
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
<v-list-item @click="clickRow(contextMenu.item)">
|
||||
<v-icon class="mr-1">mdi-text-box-search</v-icon> {{ $t('History.Details') }}
|
||||
</v-list-item>
|
||||
<v-list-item @click="startPrint(contextMenu.item)" v-if="contextMenu.item.exists" :disabled="is_printing">
|
||||
<v-list-item @click="startPrint(contextMenu.item)" v-if="contextMenu.item.exists" :disabled="printerIsPrinting || !klipperReadyForGui">
|
||||
<v-icon class="mr-1">mdi-printer</v-icon> {{ $t('History.Reprint') }}
|
||||
</v-list-item>
|
||||
<v-list-item @click="deleteJob(contextMenu.item)">
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
icon
|
||||
tile
|
||||
v-if="queueState === 'paused'"
|
||||
:disabled="!klipperReadyForGui"
|
||||
>
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
|
||||
+3
-3
@@ -56,7 +56,7 @@ const routes: AppRoute[] = [
|
||||
path: '/files',
|
||||
icon: 'file-document-multiple-outline',
|
||||
component: Files,
|
||||
alwaysShow: false,
|
||||
alwaysShow: true,
|
||||
showInNavi: true,
|
||||
registeredDirectory: 'gcodes',
|
||||
},
|
||||
@@ -73,7 +73,7 @@ const routes: AppRoute[] = [
|
||||
path: '/history',
|
||||
icon: 'history',
|
||||
component: History,
|
||||
alwaysShow: false,
|
||||
alwaysShow: true,
|
||||
showInNavi: true,
|
||||
moonrakerComponent: 'history'
|
||||
},
|
||||
@@ -82,7 +82,7 @@ const routes: AppRoute[] = [
|
||||
path: '/timelapse',
|
||||
icon: 'timelapse',
|
||||
component: Timelapse,
|
||||
alwaysShow: false,
|
||||
alwaysShow: true,
|
||||
showInNavi: true,
|
||||
moonrakerComponent: 'timelapse'
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user