Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(console): add option for RAW-output (for debugging) #1975

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading