Skip to content

Commit

Permalink
[Automated] Merged develop into target master
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Dec 25, 2024
2 parents 8b8b000 + f48b606 commit 9ba039e
Show file tree
Hide file tree
Showing 16 changed files with 171 additions and 83 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
# Changelog
All notable changes to Mainsail will be documented in this file.

## [2.13.1](https://github.com/mainsail-crew/mainsail/releases/tag/v2.13.1) - 2024-12-07
### Bug Fixes and Improvements

- **Webcam**: Add ICE Candidates check to support older camera-streamer versions ([#2069](https://github.com/mainsail-crew/mainsail/pull/2069))
- Fix interface settings Control-Tab when printer is not available ([#2071](https://github.com/mainsail-crew/mainsail/pull/2071))

### Localization

- **de**: Update german locale ([#2070](https://github.com/mainsail-crew/mainsail/pull/2070))

## [2.13.0](https://github.com/mainsail-crew/mainsail/releases/tag/v2.13.0) - 2024-12-04
### Features

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mainsail",
"version": "2.13.1",
"version": "2.13.2",
"private": true,
"decription": "a klipper web interface",
"author": {
Expand Down
13 changes: 8 additions & 5 deletions src/components/TheEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ import { Component, Mixins, Ref, Watch } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { capitalize, formatFilesize, windowBeforeUnloadFunction } from '@/plugins/helpers'
import Panel from '@/components/ui/Panel.vue'
import { availableKlipperConfigReferenceTranslations } from '@/store/variables'
import { klipperRepos } from '@/store/variables'
import CodemirrorAsync from '@/components/inputs/CodemirrorAsync'
import {
mdiClose,
Expand Down Expand Up @@ -346,13 +346,15 @@ export default class TheEditor extends Mixins(BaseMixin) {
get klipperConfigReference(): string {
const currentLanguage = this.currentLanguage
const translations = availableKlipperConfigReferenceTranslations
let url = 'https://www.klipper3d.org/Config_Reference.html'
const klipperRepo = klipperRepos[this.klipperAppName] ?? klipperRepos.Klipper
if (translations.includes(currentLanguage)) {
url = `https://www.klipper3d.org/${currentLanguage}/Config_Reference.html`
let url = klipperRepo.url
if (klipperRepo.docsLanguages?.includes(currentLanguage)) {
url += `${currentLanguage}/`
}
url += 'Config_Reference.html'
return url
}
Expand Down Expand Up @@ -542,6 +544,7 @@ export default class TheEditor extends Mixins(BaseMixin) {
.structure-sidebar {
width: 300px;
overflow-y: auto;
max-height: calc(100vh - 48px);
}
._structure-sidebar-item {
text-overflow: ellipsis;
Expand Down
7 changes: 6 additions & 1 deletion src/components/dialogs/StartPrintDialog.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<template>
<v-dialog v-model="bool" :max-width="400" @click:outside="closeDialog" @keydown.esc="closeDialog">
<v-dialog
v-model="bool"
:max-width="400"
content-class="overflow-x-hidden"
@click:outside="closeDialog"
@keydown.esc="closeDialog">
<v-card>
<div v-if="file.big_thumbnail" class="d-flex align-center justify-center" style="min-height: 200px">
<v-img
Expand Down
5 changes: 2 additions & 3 deletions src/components/dialogs/TheMacroPrompt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ export default class TheMacroPrompt extends Mixins(BaseMixin) {
private checkpointEvent: ServerStateEvent | null = null
private currentPrompt: ServerStateEventPrompt[] = []
// regex that extracts the type and message, omitting the wrapping double quotes of the message (if any)
private promptMessageExp =
/^\/\/ action:prompt_(?<type>[^\s]+) *(?:(?<quote>['"])(?<msg1>.*)\k<quote>|(?<msg2>.*))\s*$/
private promptMessageExp = /^\/\/ action:prompt_(?<type>[^\s]+) *(?<msg>.*)$/
get events() {
return this.$store.state.server.events
Expand Down Expand Up @@ -95,7 +94,7 @@ export default class TheMacroPrompt extends Mixins(BaseMixin) {
break
}
const message = (match?.groups?.msg1 || match?.groups?.msg2 || '').trim()
const message = (match?.groups?.msg || '').trim()
// prepend the event to prompt events found in this chunk
promptEvents.unshift({
Expand Down
4 changes: 4 additions & 0 deletions src/components/mixins/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export default class BaseMixin extends Vue {
return this.socketIsConnected && this.klipperState === 'ready'
}

get klipperAppName() {
return this.$store.state.printer.app_name ?? 'Klipper'
}

get printerIsPrinting() {
return this.klipperReadyForGui && ['printing', 'paused'].includes(this.printer_state)
}
Expand Down
24 changes: 16 additions & 8 deletions src/components/mixins/control.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Vue from 'vue'
import Component from 'vue-class-component'
import { PrinterStateMacro, PrinterStateToolchangeMacro } from '@/store/printer/types'

@Component
export default class ControlMixin extends Vue {
Expand Down Expand Up @@ -55,7 +54,16 @@ export default class ControlMixin extends Vue {
}

get colorZTilt() {
const status = this.$store.state.printer.z_tilt?.applied ?? true
let status = true

// normal Klipper z_tilt
if ('z_tilt' in this.$store.state.printer) {
status = this.$store.state.printer.z_tilt?.applied
}
// check Kalico next gen z_tilt
else if ('z_tilt_ng' in this.$store.state.printer) {
status = this.$store.state.printer.z_tilt_ng?.applied
}

return status ? 'primary' : 'warning'
}
Expand Down Expand Up @@ -101,12 +109,12 @@ export default class ControlMixin extends Vue {
return this.$store.getters['printer/getMacros']
}

get toolchangeMacros(): PrinterStateToolchangeMacro[] {
return this.macros
.filter((macro: PrinterStateMacro) => macro.name.toUpperCase().match(/^T\d+/))
.sort((a: PrinterStateMacro, b: PrinterStateMacro) => {
const numberA = parseInt(a.name.slice(1))
const numberB = parseInt(b.name.slice(1))
get toolchangeMacros(): string[] {
return Object.keys(this.$store.state.printer.gcode?.commands ?? {})
.filter((gcode) => gcode.match(/^T\d+/))
.sort((a: string, b: string) => {
const numberA = parseInt(a.slice(1))
const numberB = parseInt(b.slice(1))

return numberA - numberB
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<v-row v-for="(row, index) in rows" :key="'row_' + index" class="mt-0">
<v-col>
<v-item-group class="_btn-group py-0 px-3">
<extruder-control-panel-tools-item v-for="macro in row" :key="macro.name" :macro="macro" />
<extruder-control-panel-tools-item v-for="macro in row" :key="macro" :name="macro" />
</v-item-group>
</v-col>
</v-row>
Expand Down
31 changes: 19 additions & 12 deletions src/components/panels/Extruder/ExtruderControlPanelToolsItem.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
<template>
<v-btn
:disabled="printerIsPrintingOnly"
dense
class="flex-grow-1 px-0"
:style="buttonStyle"
@click="doSend(macro.name)">
<v-btn :disabled="printerIsPrintingOnly" dense class="flex-grow-1 px-0" :style="buttonStyle" @click="changeTool">
<span v-if="color != null" class="_extruderColorState mr-1" :style="dotStyle" />
{{ macro.name }}
{{ name.toUpperCase() }}
</v-btn>
</template>

<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import { PrinterStateMacro } from '@/store/printer/types'
import BaseMixin from '@/components/mixins/base'
import ControlMixin from '@/components/mixins/control'
import { ServerSpoolmanStateSpool } from '@/store/server/spoolman/types'
Expand All @@ -21,25 +15,34 @@ import { ServerSpoolmanStateSpool } from '@/store/server/spoolman/types'
components: {},
})
export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin) {
@Prop({ type: Object }) macro!: PrinterStateMacro
@Prop({ type: String }) name!: string
get macro() {
const objectName = Object.keys(this.$store.state.printer).find(
(key) => key.toLowerCase() === `gcode_macro ${this.name?.toLowerCase()}`
)
if (!objectName) return undefined
return this.$store.state.printer[objectName] ?? {}
}
get active() {
return this.macro.variables.active ?? false
return this.macro?.active ?? false
}
get color() {
if (this.spool) {
return this.spool.filament?.color_hex ?? '000000'
}
const color = this.macro.variables.color ?? this.macro.variables.colour ?? null
const color = this.macro?.color ?? this.macro?.colour ?? null
if (color === '' || color === 'undefined') return null
return color
}
get spoolId() {
return this.macro.variables.spool_id ?? null
return this.macro?.spool_id ?? null
}
get spool() {
Expand Down Expand Up @@ -90,6 +93,10 @@ export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin
'background-color': '#' + this.color,
}
}
changeTool() {
this.doSend(this.name.toUpperCase())
}
}
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/components/panels/Status/GcodefilesEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<start-print-dialog
:bool="showPrintDialog"
:file="item"
:current-path="pathOfFile"
current-path=""
@closeDialog="showPrintDialog = false" />
<add-batch-to-queue-dialog
:is-visible="showAddBatchToQueueDialog"
Expand Down
Loading

0 comments on commit 9ba039e

Please sign in to comment.