Skip to content

Commit

Permalink
Merge pull request #2 from mainsail-crew/develop
Browse files Browse the repository at this point in the history
update
  • Loading branch information
HelgeKeck committed Sep 15, 2023
2 parents 1680a05 + c87586a commit 77d8c19
Show file tree
Hide file tree
Showing 16 changed files with 210 additions and 116 deletions.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,40 @@
# Changelog
All notable changes to Mainsail will be documented in this file.

## [2.7.1](https://github.com/mainsail-crew/mainsail/releases/tag/v2.7.1) - 2023-08-16
### Bug Fixes and Improvements

- Fix issue on tablet and smaller devices with the sidebar (#1518) | [218f85c](218f85c81feafecc80043e26e880f45be5bc5e3d)

### Localization

- **zh**: Update Chinese (zh) localization (#1521) | [caaf5e1](caaf5e16062d12f765d2e7d6c985dbc351e34336)

## [2.7.0](https://github.com/mainsail-crew/mainsail/releases/tag/v2.7.0) - 2023-08-12
### Features

- Hide screws tilt adjust dialog, when using MAX_DEVIATION (#1474) | [15371ad](15371adc3d550817663aabca6c2f4b76fd585e4f)
- Add option to hide MCU/Host sensors in the temp panel (#1496) | [9883457](9883457e9d622c16f6edb8e368c77b99e6728085)
- Hide axis controls during print (#1452) | [da15789](da157891a44bc6a6b9cdec87e0e8fb2c0f060dba)
- Add an option to set the sidebar default state (#1462) | [e9c22d3](e9c22d32bc3615360407caf544ed5751f30adb09)
- Add option to hide FPS counter in webcams (#1488) | [69eaeb6](69eaeb65573c5dda5773c5f9c60fa249d136c213)
- Add a select all option on the backup and restore dialogs (#1448) | [0c4b9e7](0c4b9e75516c55bfe6678ce3a66ed8e281295ace)
- Add nevermore to temperature panel (#1511) | [1cd2541](1cd2541d6f2f7d567f33b00708fe055b929df3dd)

### Bug Fixes and Improvements

- Fix cursor style for item name to be a pointer (#1514) | [98d9b0a](98d9b0aa597ab482314876b11d261c81aae1bbf9)

### Refactor

- Soft down info buttons in update manager (#1513) | [16165ec](16165ec85f05a92edcd52f57be869ea31f8b0460)

### Localization

- **pl**: Update Polish translation (#1502) | [fe7aee9](fe7aee9307cca63ae993c062e2d9a84a6f215856)
- **pl**: Update Polish translation (#1515) | [90d76c1](90d76c1ffeea42bc59f6d7dcc9374eee600f2cc7)
- **zh**: Update Chinese (zh) localization (#1503) | [dbb5f81](dbb5f81206d4d161eb0593b9d5e8c7b5189ffc2d)

## [2.6.2](https://github.com/mainsail-crew/mainsail/releases/tag/v2.6.2) - 2023-07-30
### Bug Fixes and Improvements

Expand Down
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.6.2",
"version": "2.7.1",
"private": true,
"decription": "a klipper web interface",
"author": {
Expand Down
6 changes: 5 additions & 1 deletion src/components/TheSidebar.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-navigation-drawer
:key="navigationStyle"
:value="naviDrawer"
v-model="naviDrawer"
:src="sidebarBackground"
:mini-variant="navigationStyle === 'iconsOnly'"
:width="navigationWidth"
Expand Down Expand Up @@ -70,6 +70,10 @@ export default class TheSidebar extends Mixins(NavigationMixin, BaseMixin) {
return this.$store.state.naviDrawer
}
set naviDrawer(newVal) {
this.$store.dispatch('setNaviDrawer', newVal)
}
get navigationStyle() {
return this.$store.state.gui.uiSettings.navigationStyle
}
Expand Down
7 changes: 5 additions & 2 deletions src/components/TheTopbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,12 @@ export default class TheTopbar extends Mixins(BaseMixin) {
btnEmergencyStop() {
const confirmOnEmergencyStop = this.$store.state.gui.uiSettings.confirmOnEmergencyStop
if (!confirmOnEmergencyStop) this.emergencyStop()
if (confirmOnEmergencyStop) {
this.showEmergencyStopDialog = true
return
}
this.showEmergencyStopDialog = true
this.emergencyStop()
}
emergencyStop() {
Expand Down
8 changes: 6 additions & 2 deletions src/components/inputs/MacroButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,13 @@ export default class MacroButton extends Mixins(BaseMixin) {
sendWithParams() {
let params: string[] = []
this.paramArray.forEach((paramname: string) => {
if (this.params[paramname].value !== null && this.params[paramname].value !== '') {
let value = this.params[paramname].value?.toString().trim()
if (this.params[paramname].value !== null && value !== '') {
let tmp: string = paramname
tmp += this.isGcodeStyle ? this.params[paramname].value : `=${this.params[paramname].value}`
if (value?.includes(' ')) value = `"${value}"`
tmp += this.isGcodeStyle ? value : `=${value}`
params.push(tmp)
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/inputs/ToolSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ import { Component, Mixins, Prop, Watch } from 'vue-property-decorator'
import { Debounce } from 'vue-debounce-decorator'
import BaseMixin from '@/components/mixins/base'
import { mdiLockOpenVariantOutline, mdiLockOutline, mdiMinus, mdiPlus, mdiRestart } from '@mdi/js'
import { TranslateResult } from 'vue-i18n'
@Component
export default class ToolSlider extends Mixins(BaseMixin) {
Expand All @@ -107,7 +108,7 @@ export default class ToolSlider extends Mixins(BaseMixin) {
@Prop({ type: Number, required: true }) declare readonly target: number
@Prop({ type: String, required: true }) declare readonly command: string
@Prop({ type: String, default: '' }) declare readonly attributeName: string
@Prop({ type: String, default: '' }) declare readonly label: string
@Prop({ default: '' }) declare readonly label: string | TranslateResult
@Prop({ type: String, default: '' }) declare readonly icon: string
@Prop({ type: String, default: '%' }) declare readonly unit: string
@Prop({ type: Number, default: 1 }) declare readonly attributeScale: number
Expand Down
32 changes: 15 additions & 17 deletions src/components/panels/ToolheadControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@
<panel
v-if="klipperReadyForGui"
:icon="mdiGamepad"
:title="$t('Panels.ToolheadControlPanel.Headline').toString()"
:title="$t('Panels.ToolheadControlPanel.Headline')"
:collapsible="true"
card-class="toolhead-control-panel">
<!-- PANEL-HEADER 3-DOT-MENU -->
<template
v-if="
(controlStyle !== 'bars' && (existsZtilt || existsQGL)) ||
existsBedScrews ||
existsBedTilt ||
existsDeltaCalibrate ||
existsScrewsTilt
"
#buttons>
<template v-if="showButtons" #buttons>
<v-menu left offset-y :close-on-content-click="false" class="pa-0">
<template #activator="{ on, attrs }">
<v-btn icon tile v-bind="attrs" :disabled="['printing'].includes(printer_state)" v-on="on">
Expand Down Expand Up @@ -92,21 +84,21 @@
</v-menu>
</template>
<!-- MOVE TO CONTROL -->
<move-to-control class="py-0 pt-3"></move-to-control>
<move-to-control class="py-0 pt-3" />
<!-- AXIS CONTROL -->
<v-container v-if="axisControlVisible">
<component :is="`${controlStyle}-control`"></component>
<component :is="`${controlStyle}-control`" />
</v-container>
<!-- Z-OFFSET CONTROL -->
<v-divider :class="{ 'mt-3': !axisControlVisible }"></v-divider>
<v-divider :class="{ 'mt-3': !axisControlVisible }" />
<v-container>
<zoffset-control></zoffset-control>
<zoffset-control />
</v-container>
<!-- SPEED FACTOR -->
<v-divider></v-divider>
<v-divider />
<v-container>
<tool-slider
:label="$t('Panels.ToolheadControlPanel.SpeedFactor').toString()"
:label="$t('Panels.ToolheadControlPanel.SpeedFactor')"
:icon="mdiSpeedometer"
:target="speedFactor"
:min="1"
Expand All @@ -116,7 +108,7 @@
:dynamic-range="true"
:has-input-field="true"
command="M220"
attribute-name="S"></tool-slider>
attribute-name="S" />
</v-container>
</panel>
</template>
Expand Down Expand Up @@ -172,5 +164,11 @@ export default class ToolheadControlPanel extends Mixins(BaseMixin, ControlMixin
get axisControlVisible() {
return !(this.isPrinting && (this.$store.state.gui.control.hideDuringPrint ?? false))
}
get showButtons() {
if (this.controlStyle !== 'bars' && (this.existsZtilt || this.existsQGL)) return true
return this.existsBedScrews || this.existsBedTilt || this.existsDeltaCalibrate || this.existsScrewsTilt
}
}
</script>
20 changes: 18 additions & 2 deletions src/components/settings/General/GeneralReset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class SettingsGeneralTabResetDatabase extends Mixins(BaseMixin, S
resetCheckboxes: string[] = []
async mounted() {
this.resetableNamespaces = await this.loadBackupableNamespaces()
await this.loadResetableNamespaces()
}
onSelectResetCheckboxes(resetCheckboxes: string[]) {
Expand All @@ -78,10 +78,26 @@ export default class SettingsGeneralTabResetDatabase extends Mixins(BaseMixin, S
}
async openDialog() {
this.resetableNamespaces = await this.loadBackupableNamespaces()
await this.loadResetableNamespaces()
this.showDialog = true
}
async loadResetableNamespaces() {
this.resetableNamespaces = await this.loadBackupableNamespaces()
if (this.moonrakerComponents.includes('history')) {
this.resetableNamespaces.push({
value: 'history_jobs',
label: this.$t('Settings.GeneralTab.DbHistoryJobs'),
})
this.resetableNamespaces.push({
value: 'history_totals',
label: this.$t('Settings.GeneralTab.DbHistoryTotals'),
})
}
}
closeDialog() {
this.showDialog = false
}
Expand Down
33 changes: 26 additions & 7 deletions src/components/webcams/WebrtcCameraStreamer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default class WebrtcCameraStreamer extends Mixins(BaseMixin, WebcamMixin)
private remote_pc_id: string | null = null
private aspectRatio: null | number = null
private status: string = 'connecting'
private restartTimer: number | null = null
@Prop({ required: true }) readonly camSettings!: GuiWebcamStateWebcam
@Prop({ default: null }) declare readonly printerUrl: string | null
Expand Down Expand Up @@ -99,11 +100,15 @@ export default class WebrtcCameraStreamer extends Mixins(BaseMixin, WebcamMixin)
)
this.pc.addEventListener('connectionstatechange', () => {
this.status = (this.pc?.connectionState ?? '').toString()
// clear restartTimer if it is set
if (this.restartTimer) window.clearTimeout(this.restartTimer)
if (['failed', 'disconnected'].includes(this.status)) {
setTimeout(async () => {
await this.pc?.close()
this.startStream()
}, 500)
// set restartTimer to restart stream after 5 seconds
this.restartTimer = window.setTimeout(() => {
this.restartStream()
}, 5000)
}
})
this.pc.addEventListener('icecandidate', (e) => {
Expand Down Expand Up @@ -147,8 +152,16 @@ export default class WebrtcCameraStreamer extends Mixins(BaseMixin, WebcamMixin)
if (isFirefox) this.status = 'connected'
return response.json()
})
.catch(function (e) {
.catch((e) => {
window.console.error(e)
// clear restartTimer if it is set
if (this.restartTimer) window.clearTimeout(this.restartTimer)
// set restartTimer to restart stream after 5 seconds
this.restartTimer = window.setTimeout(() => {
this.restartStream()
}, 5000)
})
}
Expand All @@ -160,10 +173,16 @@ export default class WebrtcCameraStreamer extends Mixins(BaseMixin, WebcamMixin)
this.pc?.close()
}
restartStream() {
this.pc?.close()
setTimeout(async () => {
this.startStream()
}, 500)
}
@Watch('url')
async changedUrl() {
await this.pc?.close()
this.startStream()
this.restartStream()
}
}
</script>
Expand Down
4 changes: 0 additions & 4 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,6 @@
"KlipperUpdateQuestionConfig": "This update may also contain changes to config parameters that would need to be modified in the printer.cfg file, see the change log for details.",
"MoonrakerUpdateQuestion": "This will update the Moonraker API. Changes to the moonraker.conf file may be required to continue using the machine.",
"MoreCommitsInfo": "A maximum of 30 commits can be displayed here. To see all commits, please click on the following link:",
"Notification": {
"Detached": "Detached state is not an error nor is it a problem. It only means that additional commits exist in the local repository that do not exist in the remote repository.",
"Dirty": "The local repository has been modified and cannot be updated in this state. Please recover this repository."
},
"OSPackages": "OS-Packages",
"SoftRecovery": "Soft Recovery",
"StartUpdate": "Start Update",
Expand Down
22 changes: 11 additions & 11 deletions src/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,13 @@
},
"UpdatePanel": {
"CheckForUpdates": "Sprawdź dostępność aktualizacji",
"Commits": "Zmiany",
"CommitsAvailable": "Brak nowych wydań | {count} dostępne wydanie | {count} dostępnych wydań",
"CommitsOnDate": "Zmiany w {date}",
"CommittedDaysAgo": "Wydano {days} dni temu",
"CommittedHoursAgo": "Wydano {hours} godzin temu",
"CommittedOnDate": "Wydano {date}",
"CommittedYesterday": "Wydano wczoraj",
"Commits": "Zatwierdzenia",
"CommitsAvailable": "Brak nowych zatwierdzeń | Dostępne zatwierdzenia: {count} | Dostępne zatwierdzenia: {count}",
"CommitsOnDate": "zatwierdzenia w {date}",
"CommittedDaysAgo": "zatwierdzono {days} dni temu",
"CommittedHoursAgo": "zatwierdzono {hours} godz. temu",
"CommittedOnDate": "zatwierdzono w {date}",
"CommittedYesterday": "zatwierdzono wczoraj",
"Detached": "Osobne",
"Dirty": "brudny",
"Invalid": "Nieprawidłowe",
Expand All @@ -487,15 +487,15 @@
"Upgrade": "Uaktualnij",
"UpToDate": "aktualny",
"Abort": "Przerwij",
"GenericUpdateQuestion": "Sprawdź historię zmian (jeśli jest dostępna) i stronę GitHub dla tego projektu, aby sprawdzić, czy konieczne są jakiekolwiek ręczne korekty dla tej aktualizacji.",
"GenericUpdateQuestion": "Sprawdź historię zatwierdzeń (jeśli dostępne) i stronę GitHub dla tego projektu, aby sprawdzić, czy konieczne są jakiekolwiek ręczne korekty dla tej aktualizacji.",
"InitUpdateManager": "Menedżer aktualizacji nie został jeszcze zainicjowany. Jest to normalne zjawisko podczas pierwszego uruchomienia systemu. Kliknij przycisk odświeżania, aby zainicjować wszystkie komponenty.",
"MoonrakerUpdateQuestion": "Spowoduje to aktualizację API Moonraker. Zmiany w pliku moonraker.conf mogą być wymagane do dalszego korzystania z urządzenia.",
"MoonrakerUpdateQuestion": "Spowoduje to aktualizację API Moonrakera. Zmiany w pliku moonraker.conf mogą być wymagane do prawidłowego funkcjonowania drukarki.",
"StartUpdate": "Rozpocznij aktualizację",
"ThesePackagesCanBeUpgrade": "Te pakiety systemowe mogą być zaktualizowane:",
"WebClientUpdateQuestion": "W niektórych przypadkach aktualizacja klienta sieciowego może spowodować zmiany, które mogą spowodować niezgodność. Więcej informacji można znaleźć w uwagach wydania.",
"AreYouSure": "Czy na pewno?",
"Close": "Zamknij",
"CommitHistory": "Historia zmian",
"CommitHistory": "Historia zatwierdzeń",
"ConfigChanges": "Zmiany konfiguracji",
"CountPackagesCanBeUpgraded": "Można uaktualnić {count} pakietów",
"GitHubPage": "Strona GitHub",
Expand All @@ -504,7 +504,7 @@
"LinkToGithub": "Link do GitHub",
"KlipperUpdateQuestionFirmware": "Spowoduje to aktualizację oprogramowania hosta Klipper. Płyty sterujące z działającym firmware Klipper mogą wymagać flashowania ponownie skompilowanym firmware przed przywróceniem urządzenia do pracy.",
"KlipperUpdateQuestionConfig": "Ta aktualizacja może również zawierać zmiany w parametrach konfiguracyjnych, które będą musiały zostać zmodyfikowane w pliku printer.cfg, szczegóły można znaleźć w dzienniku zmian.",
"MoreCommitsInfo": "Można tu wyświetlić maksymalnie 30 zmian. Aby zobaczyć wszystkie zmiany, kliknij poniższy link:",
"MoreCommitsInfo": "Można zobaczyć tutaj maksymalnie 30 zatwierdzeń. Kliknij poniższy przycisk, aby zobaczyć wszystkie:",
"SoftRecovery": "Przywróć miękko",
"UpdateWarning": "Ostrzeżenie o aktualizacji: {name}",
"UpgradeableSystemPackages": "Pakiety systemowe, które można uaktualnić",
Expand Down
Loading

0 comments on commit 77d8c19

Please sign in to comment.