From 03ca19a8b3991d59c625236373ff70aaa382cae1 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Tue, 27 Aug 2024 21:16:40 +0200 Subject: [PATCH] feat(console): add option for RAW-output (for debugging) (#1975) --- src/components/console/ConsoleTableEntry.vue | 12 +++++++++++- src/components/panels/MiniconsolePanel.vue | 15 +++++++++++++++ src/locales/en.json | 1 + src/pages/Console.vue | 15 +++++++++++++++ src/store/gui/console/index.ts | 1 + src/store/gui/console/types.ts | 1 + 6 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/components/console/ConsoleTableEntry.vue b/src/components/console/ConsoleTableEntry.vue index e00ff72c2..f8d14f631 100644 --- a/src/components/console/ConsoleTableEntry.vue +++ b/src/components/console/ConsoleTableEntry.vue @@ -1,7 +1,13 @@ @@ -38,6 +44,10 @@ export default class ConsoleTableEntry extends Mixins(BaseMixin) { return classes } + get rawOutput() { + return this.$store.state.gui.console.rawOutput ?? false + } + commandClick(event: Event) { const eventTarget = event.target as Element if (eventTarget.localName === 'a' && eventTarget.className.indexOf('command') !== -1) { diff --git a/src/components/panels/MiniconsolePanel.vue b/src/components/panels/MiniconsolePanel.vue index 1c5d0daf3..8a5168dc6 100644 --- a/src/components/panels/MiniconsolePanel.vue +++ b/src/components/panels/MiniconsolePanel.vue @@ -50,6 +50,13 @@ :label="filter.name" @change="toggleFilter(filter)" /> + + + @@ -204,6 +211,14 @@ export default class MiniconsolePanel extends Mixins(BaseMixin) { this.$store.dispatch('gui/saveSetting', { name: 'console.autoscroll', value: newVal }) } + get rawOutput(): boolean { + return this.$store.state.gui.console.rawOutput ?? false + } + + set rawOutput(newVal) { + this.$store.dispatch('gui/saveSetting', { name: 'console.rawOutput', value: newVal }) + } + commandClick(msg: string): void { this.gcode = msg diff --git a/src/locales/en.json b/src/locales/en.json index 5c403574b..2f0c91bf3 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -663,6 +663,7 @@ "Headline": "Console", "HideTemperatures": "Hide temperatures", "HideTimelapse": "Hide Timelapse", + "RawOutput": "RAW-Output (for debugging)", "SendCode": "Send code...", "SetupConsole": "Setup Console" }, diff --git a/src/pages/Console.vue b/src/pages/Console.vue index a37067bcb..39a5da20b 100644 --- a/src/pages/Console.vue +++ b/src/pages/Console.vue @@ -71,6 +71,13 @@ :label="filter.name" @change="toggleFilter(filter)" /> + + + @@ -193,6 +200,14 @@ export default class PageConsole extends Mixins(BaseMixin) { this.$store.dispatch('gui/saveSetting', { name: 'console.autoscroll', value: newVal }) } + get rawOutput(): boolean { + return this.$store.state.gui.console.rawOutput ?? false + } + + set rawOutput(newVal) { + this.$store.dispatch('gui/saveSetting', { name: 'console.rawOutput', value: newVal }) + } + commandClick(msg: string): void { this.gcode = msg diff --git a/src/store/gui/console/index.ts b/src/store/gui/console/index.ts index b152a5c7e..d8e6e31c8 100644 --- a/src/store/gui/console/index.ts +++ b/src/store/gui/console/index.ts @@ -13,6 +13,7 @@ export const getDefaultState = (): GuiConsoleState => { height: 300, autoscroll: true, consolefilters: {}, + rawOutput: false, } } diff --git a/src/store/gui/console/types.ts b/src/store/gui/console/types.ts index 35e63cda8..6e487f9f3 100644 --- a/src/store/gui/console/types.ts +++ b/src/store/gui/console/types.ts @@ -9,6 +9,7 @@ export interface GuiConsoleState { consolefilters: { [key: string]: GuiConsoleStateFilter } + rawOutput: boolean } export interface GuiConsoleStateFilter {