diff --git a/CHANGELOG.md b/CHANGELOG.md
index 87dd6ccb8..eeb6ff5f2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/package.json b/package.json
index 370807e7c..690863221 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "mainsail",
- "version": "2.6.2",
+ "version": "2.7.1",
"private": true,
"decription": "a klipper web interface",
"author": {
diff --git a/src/components/TheSidebar.vue b/src/components/TheSidebar.vue
index 6be678c99..2417d25ed 100644
--- a/src/components/TheSidebar.vue
+++ b/src/components/TheSidebar.vue
@@ -1,7 +1,7 @@
{
- 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)
}
diff --git a/src/components/inputs/ToolSlider.vue b/src/components/inputs/ToolSlider.vue
index 9b61a65b6..ba30623da 100644
--- a/src/components/inputs/ToolSlider.vue
+++ b/src/components/inputs/ToolSlider.vue
@@ -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) {
@@ -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
diff --git a/src/components/panels/ToolheadControlPanel.vue b/src/components/panels/ToolheadControlPanel.vue
index 1a2c3a814..25d0277c3 100644
--- a/src/components/panels/ToolheadControlPanel.vue
+++ b/src/components/panels/ToolheadControlPanel.vue
@@ -2,19 +2,11 @@
-
+
@@ -92,21 +84,21 @@
-
+
-
+
-
+
-
+
-
+
+ attribute-name="S" />
@@ -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
+ }
}
diff --git a/src/components/settings/General/GeneralReset.vue b/src/components/settings/General/GeneralReset.vue
index 8573611f4..d2553a1be 100644
--- a/src/components/settings/General/GeneralReset.vue
+++ b/src/components/settings/General/GeneralReset.vue
@@ -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[]) {
@@ -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
}
diff --git a/src/components/webcams/WebrtcCameraStreamer.vue b/src/components/webcams/WebrtcCameraStreamer.vue
index 91e8d49c7..010392985 100644
--- a/src/components/webcams/WebrtcCameraStreamer.vue
+++ b/src/components/webcams/WebrtcCameraStreamer.vue
@@ -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
@@ -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) => {
@@ -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)
})
}
@@ -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()
}
}
diff --git a/src/locales/en.json b/src/locales/en.json
index 134950d01..d73e40cb4 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -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",
diff --git a/src/locales/pl.json b/src/locales/pl.json
index b806ca4ed..6f0731d1e 100644
--- a/src/locales/pl.json
+++ b/src/locales/pl.json
@@ -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",
@@ -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",
@@ -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ć",
diff --git a/src/locales/zh.json b/src/locales/zh.json
index fd5f96ee6..3cd0bccb5 100644
--- a/src/locales/zh.json
+++ b/src/locales/zh.json
@@ -44,14 +44,14 @@
"DescriptionPreviouslyUnderVolted": "自从开机以来树莓派供电电压至少有一次低于4.65V。",
"DescriptionTemperatureLimitActive": "树莓派uC(仅3A+/3B+)温度目前超过软件限值(默认60C)。",
"DescriptionUnderVoltageDetected": "树莓派供电电压目前低于4.65V",
- "TitleCurrentlyThrottled": "当前受到限制",
- "TitleFrequencyCapped": "频率上限",
- "TitlePreviouslyFrequencyCapped": "历史频率上限",
- "TitlePreviouslyTemperatureLimited": "历史温度限制",
- "TitlePreviouslyThrottled": "历史限制",
- "TitlePreviouslyUnderVolted": "历史电压过低",
- "TitleTemperatureLimitActive": "温度限制",
- "TitleUnderVoltageDetected": "检测到电压过低"
+ "TitleCurrentlyThrottled": "受限提醒",
+ "TitleFrequencyCapped": "频率上限提醒",
+ "TitlePreviouslyFrequencyCapped": "频率上限提醒",
+ "TitlePreviouslyTemperatureLimited": "温度限制提醒",
+ "TitlePreviouslyThrottled": "受限提醒",
+ "TitlePreviouslyUnderVolted": "电压过低提醒",
+ "TitleTemperatureLimitActive": "温度限制提醒",
+ "TitleUnderVoltageDetected": "电压过低提醒"
},
"Titles": {
"Complete": "已完成 - {filename}",
@@ -677,6 +677,7 @@
"Temperature": "当前温度"
},
"Headline": "温度",
+ "HideMcuHostSensors": "隐藏Host/MCU传感器",
"Max": "最高",
"Min": "最低",
"Name": "名称",
@@ -792,6 +793,7 @@
"Circle": "圆形",
"Control": "控制",
"Cross": "交叉",
+ "HideDuringPrint": "打印期间隐藏轴控制",
"EnableXYHoming": "显示X&Y轴归零按钮",
"EstimatedExtrusionInfo": "显示预估的挤出信息",
"EstimatedExtrusionInfoDescription": "显示/隐藏根据挤出量和进给速度预估的挤出信息",
@@ -867,8 +869,7 @@
"CannotReadJson": "无法读取/解析备份文件。",
"DateFormat": "日期格式",
"DbConsoleHistory": "控制台历史记录",
- "DbHistoryJobs": "历史任务",
- "DbHistoryTotals": "历史统计",
+ "DBNavigation": "侧边栏",
"DbTimelapseSettings": "延时摄影设置",
"DbView": "视图设置",
"EstimateValues": {
@@ -885,7 +886,8 @@
"Reset": "重启",
"Restore": "恢复",
"RestoreDialog": "请选择你想要恢复的项:",
- "TimeFormat": "时间格式"
+ "TimeFormat": "时间格式",
+ "Everything": "全部"
},
"InterfaceSettings": "Mainsail设置",
"MacrosTab": {
@@ -1056,6 +1058,11 @@
"ConfirmOnEmergencyStopDescription": "在按下\"紧急停止\"时显示确认对话框",
"ConfirmOnPowerDeviceChange": "控制设备电源时需要确认",
"ConfirmOnPowerDeviceChangeDescription": "控制设备电源时显示确认对话框",
+ "DefaultNavigationState": "侧边栏默认状态",
+ "DefaultNavigationStateAlwaysClosed": "始终隐藏",
+ "DefaultNavigationStateAlwaysOpen": "始终显示",
+ "DefaultNavigationStateDescription": "侧边栏默认显示状态。",
+ "DefaultNavigationStateLastState": "上一次的状态",
"DisableFanAnimation": "关闭风扇动画",
"DisableFanAnimationDescription": "这会一定程度减少浏览器的资源消耗",
"DisplayCANCEL_PRINT": "显示\"取消打印\"按钮",
@@ -1094,6 +1101,7 @@
"EditCrowsnestConf": "编辑 crowsnest.conf",
"EditWebcam": "编辑摄像头",
"FlipWebcam": "翻转摄像头图像:",
+ "HideFps": "隐藏FPS数值显示",
"Horizontally": "水平",
"IconBed": "热床",
"IconCam": "摄像头",
diff --git a/src/pages/Heightmap.vue b/src/pages/Heightmap.vue
index ad624fee8..660a93bf4 100644
--- a/src/pages/Heightmap.vue
+++ b/src/pages/Heightmap.vue
@@ -2,7 +2,7 @@
-
+
+ style="height: 400px; width: 100%; overflow: hidden" />
@@ -98,33 +98,33 @@
+ class="mt-0 ml-5" />
+ class="mx-3 mt-0" />
+ class="mx-3 mt-0" />
+ class="mx-3 mt-0" />
+ class="mx-3 mt-0" />
-
+
@@ -136,7 +136,7 @@
:step="0.1"
ticks="always"
class="mt-4"
- hide-details>
+ hide-details />
@@ -146,7 +146,7 @@
-
+
{{ $t('Heightmap.CurrentMesh.Size') }}
{{ currentProfile.data.x_count }}x{{ currentProfile.data.y_count }}
-
+
{{ $t('Heightmap.CurrentMesh.Max') }} [{{ bedMeshMaxPoint.positionX }},
@@ -176,7 +176,7 @@
{{ currentProfile.max.toFixed(3) }} mm
-
+
{{ $t('Heightmap.CurrentMesh.Min') }} [{{ bedMeshMinPoint.positionX }},
@@ -184,7 +184,7 @@
{{ currentProfile.min.toFixed(3) }} mm
-
+
{{ $t('Heightmap.CurrentMesh.Range') }}
{{ currentProfile.variance.toFixed(3) }} mm
@@ -192,14 +192,14 @@
-
+
@@ -299,7 +299,7 @@
@keyup.enter="renameProfile" />
-
+
{{ $t('Heightmap.Abort') }}
{{ $t('Heightmap.Rename') }}
@@ -313,7 +313,7 @@
:max-width="400"
@keydown.esc="calibrateDialog.boolShow = false">
@@ -337,7 +337,7 @@
@keyup.enter="calibrateMesh" />
-
+
{{ $t('Heightmap.Abort') }}
{{ $t('Heightmap.Calibrate') }}
@@ -347,7 +347,7 @@
@@ -360,7 +360,7 @@
{{ $t('Heightmap.DoYouReallyWantToDelete', { name: removeDialogProfile }) }}
-
+
{{ $t('Heightmap.Abort') }}
{{ $t('Heightmap.Remove') }}
@@ -368,7 +368,7 @@
@@ -381,7 +381,7 @@
{{ $t('Heightmap.RemoveSaveDescription') }}
-
+
{{ $t('Heightmap.Ok') }}
@@ -971,6 +971,24 @@ export default class PageHeightmap extends Mixins(BaseMixin, ControlMixin) {
return output
}
+ get probed_matrix() {
+ return this.bed_mesh.probed_matrix ?? [[]]
+ }
+
+ get bedMeshXLength() {
+ let x_length = this.probed_matrix[0].length - 1
+ if (x_length < 1) x_length = 1
+
+ return x_length
+ }
+
+ get bedMeshYLength() {
+ let y_length = this.probed_matrix.length - 1
+ if (y_length < 1) y_length = 1
+
+ return y_length
+ }
+
get bedMeshMaxPoint() {
if (this.bed_mesh.profile_name === '') return { row: 0, col: 0, positionX: 0, positionY: 0, value: 0 }
@@ -988,15 +1006,13 @@ export default class PageHeightmap extends Mixins(BaseMixin, ControlMixin) {
const positionX =
Math.round(
(this.bed_mesh.mesh_min[0] +
- ((this.bed_mesh.mesh_max[0] - this.bed_mesh.mesh_min[0]) / this.bed_mesh.probed_matrix[0].length) *
- (col - 1)) *
+ ((this.bed_mesh.mesh_max[0] - this.bed_mesh.mesh_min[0]) / this.bedMeshXLength) * (col - 1)) *
10
) / 10
const positionY =
Math.round(
(this.bed_mesh.mesh_min[1] +
- ((this.bed_mesh.mesh_max[1] - this.bed_mesh.mesh_min[1]) / this.bed_mesh.probed_matrix.length) *
- (row - 1)) *
+ ((this.bed_mesh.mesh_max[1] - this.bed_mesh.mesh_min[1]) / this.bedMeshYLength) * (row - 1)) *
10
) / 10
@@ -1026,15 +1042,13 @@ export default class PageHeightmap extends Mixins(BaseMixin, ControlMixin) {
const positionX =
Math.round(
(this.bed_mesh.mesh_min[0] +
- ((this.bed_mesh.mesh_max[0] - this.bed_mesh.mesh_min[0]) / this.bed_mesh.probed_matrix[0].length) *
- (col - 1)) *
+ ((this.bed_mesh.mesh_max[0] - this.bed_mesh.mesh_min[0]) / this.bedMeshXLength) * (col - 1)) *
10
) / 10
const positionY =
Math.round(
(this.bed_mesh.mesh_min[1] +
- ((this.bed_mesh.mesh_max[1] - this.bed_mesh.mesh_min[1]) / this.bed_mesh.probed_matrix.length) *
- (row - 1)) *
+ ((this.bed_mesh.mesh_max[1] - this.bed_mesh.mesh_min[1]) / this.bedMeshYLength) * (row - 1)) *
10
) / 10
diff --git a/src/store/gui/getters.ts b/src/store/gui/getters.ts
index f114cb3af..039b9846c 100644
--- a/src/store/gui/getters.ts
+++ b/src/store/gui/getters.ts
@@ -152,10 +152,8 @@ export const getters: GetterTree = {
const setting = state.general.timeFormat
if (setting === '12hours') return true
if (setting === null) {
- const browserLocale =
- navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language
-
- if (browserLocale === 'en_us') return true
+ const timestring = new Date().toLocaleTimeString().split(' ')
+ return timestring.includes('AM') || timestring.includes('PM')
}
return false
diff --git a/src/store/gui/presets/getters.ts b/src/store/gui/presets/getters.ts
index 02c05d419..a00420a0b 100644
--- a/src/store/gui/presets/getters.ts
+++ b/src/store/gui/presets/getters.ts
@@ -33,22 +33,24 @@ export const getters: GetterTree = {
text: '0 °C',
})
- if ('presets' in state) {
- Object.keys(state.presets).forEach((id: string) => {
- const preset = state.presets[id]
-
- if (
- payload.name in preset.values &&
- preset.values[payload.name].bool &&
- output.findIndex((entry: preset) => entry.value === preset.values[payload.name].value) === -1
- ) {
- output.push({
- value: preset.values[payload.name].value,
- text: preset.values[payload.name].value + ' °C',
- })
- }
- })
- }
+ // return only 0 entry, if there is no presets set
+ if (!('presets' in state)) return output
+
+ Object.keys(state.presets).forEach((id: string) => {
+ const preset = state.presets[id]
+
+ if (
+ payload.name in preset.values &&
+ preset.values[payload.name].bool &&
+ output.findIndex((entry: preset) => entry.value === preset.values[payload.name].value) === -1
+ ) {
+ output.push({
+ // @ts-ignore
+ value: parseFloat(preset.values[payload.name].value),
+ text: preset.values[payload.name].value + ' °C',
+ })
+ }
+ })
return output.sort((a: preset, b: preset) => {
if (a.value > b.value) return -1
diff --git a/src/store/gui/presets/mutations.ts b/src/store/gui/presets/mutations.ts
index 1a4085689..ebb9e80c7 100644
--- a/src/store/gui/presets/mutations.ts
+++ b/src/store/gui/presets/mutations.ts
@@ -22,12 +22,9 @@ export const mutations: MutationTree = {
},
update(state, payload) {
- if (payload.id in state.presets) {
- const preset = { ...state.presets[payload.id] }
- Object.assign(preset, payload.values)
+ if (!(payload.id in state.presets)) return
- Vue.set(state.presets, payload.id, preset)
- }
+ Vue.set(state.presets, payload.id, payload.values)
},
updateCooldownGcode(state, payload) {