From a5dcba42cfd2f4e412910a268d45f56197d46bc0 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sat, 21 May 2022 10:42:04 +0200 Subject: [PATCH 1/2] fix: add u4vl-mjpeg to printfarm panel Signed-off-by: Stefan Dej --- src/components/panels/FarmPrinterPanel.vue | 37 ++++++++++++++-------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/src/components/panels/FarmPrinterPanel.vue b/src/components/panels/FarmPrinterPanel.vue index 2ff76171a..17982b1f2 100644 --- a/src/components/panels/FarmPrinterPanel.vue +++ b/src/components/panels/FarmPrinterPanel.vue @@ -45,21 +45,28 @@
- - + + +
Date: Sat, 21 May 2022 10:49:24 +0200 Subject: [PATCH 2/2] fix: only display supported webcams in print farm panel Signed-off-by: Stefan Dej --- src/components/panels/FarmPrinterPanel.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/panels/FarmPrinterPanel.vue b/src/components/panels/FarmPrinterPanel.vue index 17982b1f2..5d688c975 100644 --- a/src/components/panels/FarmPrinterPanel.vue +++ b/src/components/panels/FarmPrinterPanel.vue @@ -26,7 +26,7 @@ @@ -137,6 +137,7 @@ import MainsailLogo from '@/components/ui/MainsailLogo.vue' import Panel from '@/components/ui/Panel.vue' import { mdiPrinter3d, mdiWebcam, mdiMenuDown, mdiWebcamOff, mdiFileOutline } from '@mdi/js' import { Debounce } from 'vue-debounce-decorator' +import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types' @Component({ components: { @@ -216,13 +217,19 @@ export default class FarmPrinterPanel extends Mixins(BaseMixin) { } get showWebcamSwitch() { - return this.printer.socket.isConnected && this.printer_webcams.length > 0 + return this.printer.socket.isConnected && this.supportedPrinterWebcams.length > 0 } get printer_webcams() { return this.$store.getters['farm/' + this.printer._namespace + '/getPrinterWebcams'] } + get supportedPrinterWebcams() { + return this.printer_webcams.filter((webcam: GuiWebcamStateWebcam) => + ['mjpegstreamer', 'mjpegstreamer-adaptive', 'uv4l-mjpeg'].includes(webcam.service) + ) + } + get currentWebcam() { const currentCam = this.printer_webcams.find((webcam: any) => webcam.id === this.currentCamId) if (currentCam) return currentCam