Skip to content

Commit

Permalink
Merge branch 'develop' into reminder-panel
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou committed Mar 21, 2024
2 parents 3a636f8 + c859440 commit 6e8231d
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
fetch-depth: 0

- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20

Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: 'develop'
token: ${{ secrets.PAT }}
Expand All @@ -141,7 +141,7 @@ jobs:
- name: Show CHANGELOG
run: |
cat CHANGELOG.md
- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'docs(changelog): update changelog'
file_pattern: CHANGELOG.md
6 changes: 3 additions & 3 deletions package-lock.json

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

56 changes: 56 additions & 0 deletions src/components/dialogs/CoolDownDialog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<template>
<v-dialog :value="showDialog" width="400" persistent>
<panel
:title="$t('CoolDownDialog.CoolDown')"
card-class="cool-down-dialog"
:icon="mdiSnowflake"
:margin-bottom="false">
<template #buttons>
<v-btn icon tile @click="closePrompt">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>{{ $t('CoolDownDialog.AreYouSure') }}</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn text @click="closePrompt">{{ $t('CoolDownDialog.No') }}</v-btn>
<v-btn color="primary" text @click="cooldown">{{ $t('CoolDownDialog.Yes') }}</v-btn>
</v-card-actions>
</panel>
</v-dialog>
</template>

<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import Panel from '@/components/ui/Panel.vue'
import { mdiCloseThick, mdiSnowflake } from '@mdi/js'
@Component({
components: { Panel },
})
export default class CoolDownDialog extends Mixins(BaseMixin) {
mdiCloseThick = mdiCloseThick
mdiSnowflake = mdiSnowflake
@Prop({ type: Boolean, default: false }) showDialog!: boolean
get cooldownGcode(): string {
return this.$store.getters['gui/presets/getCooldownGcode']
}
cooldown(): void {
this.$store.dispatch('server/addEvent', { message: this.cooldownGcode, type: 'command' })
this.$socket.emit('printer.gcode.script', { script: this.cooldownGcode })
this.closePrompt()
}
closePrompt() {
this.$emit('close')
}
}
</script>

<style scoped></style>
5 changes: 3 additions & 2 deletions src/components/mixins/zoffset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ export default class ZoffsetMixin extends Vue {
get endstop_pin() {
const stepperConfig = this.settings[this.stepper_name] ?? {}

return stepperConfig?.endstop_pin
return stepperConfig?.endstop_pin.trim()
}

get zOffset(): number {
return this.$store.state.printer?.gcode_move?.homing_origin[2].toFixed(3)
}
get isEndstopProbe() {
return this.endstop_pin.search('probe:z_virtual_endstop') !== -1
// remove spaces and search for probe:z_virtual_endstop
return this.endstop_pin.replaceAll(' ', '').search('probe:z_virtual_endstop') !== -1
}

get existZOffsetApplyProbe() {
Expand Down
11 changes: 9 additions & 2 deletions src/components/panels/Machine/ConfigFilesPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,15 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin, ThemeMixin) {
}
if (this.hideBackupFiles) {
const backupFileMatcher = /.*\/?printer-\d{8}_\d{6}\.cfg$/
files = files.filter((file) => !file.filename.match(backupFileMatcher))
const klipperBackupFileMatcher = /^printer-\d{8}_\d{6}\.cfg$/
const crowsnestBackupFileMatcher = /^crowsnest\.conf\.\d{4}-\d{2}-\d{2}-\d{4}$/
files = files.filter(
(file) =>
!file.filename.match(klipperBackupFileMatcher) &&
!file.filename.match(crowsnestBackupFileMatcher) &&
!file.filename.endsWith('.bkp')
)
}
return files
Expand Down
29 changes: 25 additions & 4 deletions src/components/panels/Temperature/TemperaturePanelPresets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</v-list>
<v-divider class="_fix_transparency" />
<v-list dense class="py-0">
<v-list-item link @click="cooldown">
<v-list-item link @click="btnCoolDown">
<div class="d-flex align-center _preset-title">
<v-icon small color="primary" class="mr-1">{{ mdiSnowflake }}</v-icon>
<span class="primary--text">{{ $t('Panels.TemperaturePanel.Cooldown') }}</span>
Expand All @@ -39,10 +39,11 @@
:text="$vuetify.breakpoint.mdAndUp"
tile
color="primary"
@click="cooldown">
@click="btnCoolDown">
<v-icon small>{{ mdiSnowflake }}</v-icon>
<span class="d-none ml-1 d-md-inline">{{ $t('Panels.TemperaturePanel.Cooldown') }}</span>
</v-btn>
<cool-down-dialog :show-dialog="showCoolDownDialog" @close="showCoolDownDialog = false" />
</div>
</template>

Expand All @@ -51,13 +52,19 @@ import Component from 'vue-class-component'
import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { GuiPresetsStatePreset } from '@/store/gui/presets/types'
import { mdiFire, mdiMenuDown, mdiSnowflake } from '@mdi/js'
import { mdiFire, mdiMenuDown, mdiSnowflake, mdiCloseThick } from '@mdi/js'
import CoolDownDialog from '@/components/dialogs/CoolDownDialog.vue'
@Component
@Component({
components: { CoolDownDialog },
})
export default class TemperaturePanelPresets extends Mixins(BaseMixin) {
mdiFire = mdiFire
mdiMenuDown = mdiMenuDown
mdiSnowflake = mdiSnowflake
mdiCloseThick = mdiCloseThick
showCoolDownDialog = false
get presets(): GuiPresetsStatePreset[] {
return this.$store.getters['gui/presets/getPresets'] ?? []
Expand All @@ -67,6 +74,10 @@ export default class TemperaturePanelPresets extends Mixins(BaseMixin) {
return this.$store.getters['gui/presets/getCooldownGcode']
}
get confirmOnCoolDown(): boolean {
return this.$store.state.gui.uiSettings.confirmOnCoolDown
}
preheat(preset: GuiPresetsStatePreset): void {
for (const [name, attributes] of Object.entries(preset.values)) {
if (attributes.bool) {
Expand Down Expand Up @@ -100,7 +111,17 @@ export default class TemperaturePanelPresets extends Mixins(BaseMixin) {
}
}
btnCoolDown(): void {
if (this.confirmOnCoolDown) {
this.showCoolDownDialog = true
return
}
this.cooldown()
}
cooldown(): void {
this.showCoolDownDialog = false
this.$store.dispatch('server/addEvent', { message: this.cooldownGcode, type: 'command' })
this.$socket.emit('printer.gcode.script', { script: this.cooldownGcode })
}
Expand Down
15 changes: 15 additions & 0 deletions src/components/settings/SettingsUiSettingsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@
<v-switch v-model="confirmOnEmergencyStop" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.ConfirmOnCoolDown')"
:sub-title="$t('Settings.UiSettingsTab.ConfirmOnCoolDownDescription')"
:dynamic-slot-width="true">
<v-switch v-model="confirmOnCoolDown" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.ConfirmOnPowerDeviceChange')"
:sub-title="$t('Settings.UiSettingsTab.ConfirmOnPowerDeviceChangeDescription')"
Expand Down Expand Up @@ -341,6 +348,14 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin) {
this.$store.dispatch('gui/saveSetting', { name: 'uiSettings.confirmOnEmergencyStop', value: newVal })
}
get confirmOnCoolDown() {
return this.$store.state.gui.uiSettings.confirmOnCoolDown
}
set confirmOnCoolDown(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'uiSettings.confirmOnCoolDown', value: newVal })
}
get confirmOnPowerDeviceChange() {
return this.$store.state.gui.uiSettings.confirmOnPowerDeviceChange
}
Expand Down
8 changes: 8 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@
"SendCode": "Send code...",
"SetupConsole": "Setup Console"
},
"CoolDownDialog": {
"AreYouSure": "Are you sure?",
"CoolDown": "CoolDown",
"No": "No",
"Yes": "Yes"
},
"DevicesDialog": {
"CanBusInfo": "Only unassigned nodes can be detected. It’s recommended to have only one unassigned device connected to the can bus to avoid communication issues. For more details, please click on the link:",
"ClickRefresh": "Click on the refresh button to search for devices.",
Expand Down Expand Up @@ -1170,6 +1176,8 @@
"BoolBigThumbnailDescription": "Display a large thumbnail in the status panel during a print.",
"BoolHideUploadAndPrintButton": "Hide Upload and Print Button",
"BoolHideUploadAndPrintButtonDescription": "Show or hide the \"Upload and Print\" button in the top bar.",
"ConfirmOnCoolDown": "Require confirm on CoolDown",
"ConfirmOnCoolDownDescription": "Show a confirmation dialog on CoolDown",
"ConfirmOnEmergencyStop": "Require confirm on Emergency Stop",
"ConfirmOnEmergencyStopDescription": "Show a confirmation dialog on Emergency Stop",
"ConfirmOnPowerDeviceChange": "Require confirm on Device Power changes",
Expand Down
1 change: 1 addition & 0 deletions src/store/gui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export const getDefaultState = (): GuiState => {
lockSlidersOnTouchDevices: true,
lockSlidersDelay: 1.5,
confirmOnEmergencyStop: false,
confirmOnCoolDown: false,
confirmOnPowerDeviceChange: false,
boolBigThumbnail: true,
bigThumbnailBackground: defaultBigThumbnailBackground,
Expand Down
1 change: 1 addition & 0 deletions src/store/gui/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export interface GuiState {
lockSlidersOnTouchDevices: boolean
lockSlidersDelay: number
confirmOnEmergencyStop: boolean
confirmOnCoolDown: boolean
confirmOnPowerDeviceChange: boolean
boolBigThumbnail: boolean
bigThumbnailBackground: string
Expand Down

0 comments on commit 6e8231d

Please sign in to comment.