Skip to content

Commit

Permalink
feat(console): add option for RAW-output (for debugging) (#1975)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Aug 27, 2024
1 parent cc584c0 commit 03ca19a
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/components/console/ConsoleTableEntry.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<template>
<v-row :class="entryStyle">
<v-col class="col-auto pr-0 text--disabled console-time">{{ entryFormatTime }}</v-col>
<v-col :class="messageClass" style="min-width: 0" @click.capture="commandClick" v-html="event.formatMessage" />
<v-col
v-if="!rawOutput"
:class="messageClass"
style="min-width: 0"
@click.capture="commandClick"
v-html="event.formatMessage" />
<v-col v-else :class="messageClass" style="min-width: 0" @click.capture="commandClick" v-text="event.message" />
</v-row>
</template>

Expand Down Expand Up @@ -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) {
Expand Down
15 changes: 15 additions & 0 deletions src/components/panels/MiniconsolePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@
:label="filter.name"
@change="toggleFilter(filter)" />
</v-list-item>
<v-list-item class="minHeight36">
<v-checkbox
v-model="rawOutput"
class="mt-0"
hide-details
:label="$t('Panels.MiniconsolePanel.RawOutput')" />
</v-list-item>
</v-list>
</v-menu>
</template>
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@
"Headline": "Console",
"HideTemperatures": "Hide temperatures",
"HideTimelapse": "Hide Timelapse",
"RawOutput": "RAW-Output (for debugging)",
"SendCode": "Send code...",
"SetupConsole": "Setup Console"
},
Expand Down
15 changes: 15 additions & 0 deletions src/pages/Console.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@
:label="filter.name"
@change="toggleFilter(filter)" />
</v-list-item>
<v-list-item class="minHeight36">
<v-checkbox
v-model="rawOutput"
class="mt-0"
hide-details
:label="$t('Panels.MiniconsolePanel.RawOutput')" />
</v-list-item>
</v-list>
</v-menu>
</v-col>
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/store/gui/console/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const getDefaultState = (): GuiConsoleState => {
height: 300,
autoscroll: true,
consolefilters: {},
rawOutput: false,
}
}

Expand Down
1 change: 1 addition & 0 deletions src/store/gui/console/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface GuiConsoleState {
consolefilters: {
[key: string]: GuiConsoleStateFilter
}
rawOutput: boolean
}

export interface GuiConsoleStateFilter {
Expand Down

0 comments on commit 03ca19a

Please sign in to comment.