Compare commits

...
14 Commits
Author SHA1 Message Date
github-actions b0491deb93 chore: push version number to v2.7.0 2023-08-12 16:06:03 +00:00
DaviteuszandStefan Dej 90d76c1ffe locale(pl): Update Polish translation (#1515)
Co-authored-by: Stefan Dej <meteyou@gmail.com>
2023-08-10 22:07:35 +02:00
Stefan Dejandrackrick 1cd2541d6f feat: add nevermore to temperature panel (#1511)
Co-authored-by: rackrick <45207681+rackrick@users.noreply.github.com>
2023-08-09 23:40:48 +02:00
François LaBergeandStefan Dej 0c4b9e7551 feat: add a select all option on the backup and restore dialogs (#1448)
Co-authored-by: Stefan Dej <meteyou@gmail.com>
2023-08-09 23:40:12 +02:00
Stefan Dej 16165ec85f refactor: soft down info buttons in update manager (#1513) 2023-08-09 20:05:26 +02:00
Stefan Dej 69eaeb6557 feat: add option to hide FPS counter in webcams (#1488) 2023-08-09 20:04:48 +02:00
Stefan Dej e9c22d32bc feat: add an option to set the sidebar default state (#1462) 2023-08-09 01:08:49 +02:00
rackrick 98d9b0aa59 fix: fix cursor style for item name to be a pointer (#1514)
Signed-off-by: Patrick Stainbrook <patrick@hohestadt.de>
2023-08-09 00:56:34 +02:00
sddev0andSebastian Duerholt da157891a4 feat: hide axis controls during print (#1452)
Co-authored-by: Sebastian Duerholt <s.duerholt@gmail.com>
2023-08-07 23:43:20 +02:00
Stefan Dej 9883457e9d feat: add option to hide MCU/Host sensors in the temp panel (#1496) 2023-08-07 23:25:43 +02:00
Stefan Dej 15371adc3d feat: hide screws tilt adjust dialog, when using MAX_DEVIATION (#1474) 2023-08-07 23:25:00 +02:00
DaviteuszandStefan Dej fe7aee9307 locale(pl): Update Polish translation (#1502)
Co-authored-by: Stefan Dej <meteyou@gmail.com>
2023-08-07 23:03:29 +02:00
Samuel-0-0andStefan Dej dbb5f81206 locale(zh): Update Chinese (zh) localization (#1503)
Co-authored-by: Stefan Dej <meteyou@gmail.com>
2023-08-07 22:54:54 +02:00
meteyou 9e2e923a8f docs(changelog): update changelog 2023-07-30 19:26:46 +00:00
38 changed files with 1273 additions and 618 deletions

No files matched your search

+21
View File
@@ -2,6 +2,27 @@
# Changelog
All notable changes to Mainsail will be documented in this file.
## [2.6.2](https://github.com/mainsail-crew/mainsail/releases/tag/v2.6.2) - 2023-07-30
### Bug Fixes and Improvements
- Fix editor save & restart button behavior (#1483) | [8447be2](8447be2ecee64fa4a3c0211ac57f42c3adf1d050)
- Hide rpm in temperature_fans without tachometer_pin (#1489) | [e929c7c](e929c7cc0f45074f40407420b3585d9c02284fa1)
- Fix flip function in several webcam clients (#1487) | [5c40820](5c4082010890e0b341754f42673affe7d1ca9d99)
- Fix issue with camel-case object names in temperature panel (#1491) | [aeee198](aeee1982398acca803f7f4eae7b7b39a29253179)
- Use webcam name instead of UUID for timelapse plugin (#1492) | [d67ef3a](d67ef3aa908601b6bb87353957bcc97ea4f829ea)
- Fix issue with create/edit presets and refactor settings (#1499) | [6a4cca7](6a4cca751c88e89ddf5f2cc0f09a58f097a461af)
- Fix multiple issues in the refactored update manager (#1497) | [9eb133b](9eb133bd85530ac08416e94f02ebe19f060bc095)
- Fix issue with cannot extrude after a Klipper restart (#1495) | [cda3098](cda3098c9e09a054aa7baa69a3195e0a73f43e54)
### Refactor
- Refactor SettingsRow (#1484) | [0b47a80](0b47a80b133e6093aecdb0d7d87b718899dff0c7)
### Localization
- **pl**: Update Polish translation (#1482) | [0c5aca8](0c5aca8baffb65198f43a7d3b2b57571d8e911c9)
- **zh**: Update chinese locale (#1486) | [7251a8c](7251a8c6bae2b92395de4c8c23e8e8e3900df66a)
## [2.6.1](https://github.com/mainsail-crew/mainsail/releases/tag/v2.6.1) - 2023-07-24
### Bug Fixes and Improvements
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "mainsail",
"version": "2.6.2",
"version": "2.7.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "mainsail",
"version": "2.6.2",
"version": "2.7.0",
"dependencies": {
"@codemirror/commands": "^6.0.1",
"@codemirror/lang-css": "^6.0.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "mainsail",
"version": "2.6.2",
"version": "2.7.0",
"private": true,
"decription": "a klipper web interface",
"author": {
+46 -33
View File
@@ -1,37 +1,11 @@
<style>
@import './assets/styles/fonts.css';
@import './assets/styles/toastr.css';
@import './assets/styles/page.scss';
@import './assets/styles/sidebar.scss';
@import './assets/styles/utils.scss';
@import './assets/styles/updateManager.scss';
:root {
--app-height: 100%;
}
#content {
background-attachment: fixed;
background-size: cover;
background-repeat: no-repeat;
}
/*noinspection CssUnusedSymbol*/
.v-btn:not(.v-btn--outlined).primary {
/*noinspection CssUnresolvedCustomProperty*/
color: var(--v-btn-text-primary);
}
</style>
<template>
<v-app dark :style="cssVars">
<template v-if="socketIsConnected && guiIsReady">
<the-sidebar></the-sidebar>
<the-topbar></the-topbar>
<the-sidebar />
<the-topbar />
<v-main id="content" :style="mainStyle">
<v-container id="page-container" fluid class="container px-3 px-sm-6 py-sm-6 mx-auto">
<router-view></router-view>
<router-view />
</v-container>
</v-main>
<the-service-worker />
@@ -44,8 +18,8 @@
<the-bed-screws-dialog />
<the-screws-tilt-adjust-dialog />
</template>
<the-select-printer-dialog v-else-if="instancesDB !== 'moonraker'"></the-select-printer-dialog>
<the-connecting-dialog v-else></the-connecting-dialog>
<the-select-printer-dialog v-else-if="instancesDB !== 'moonraker'" />
<the-connecting-dialog v-else />
</v-app>
</template>
@@ -105,13 +79,27 @@ export default class App extends Mixins(BaseMixin) {
return this.$store.getters['files/getMainBackground']
}
get naviDrawer(): boolean {
return this.$store.state.naviDrawer
}
get navigationStyle() {
return this.$store.state.gui.uiSettings.navigationStyle
}
get mainStyle() {
let style = ''
let style: any = {
paddingLeft: '0',
}
if (this.mainBackground !== null) {
style = 'background-image: url(' + this.mainBackground + ');'
style.backgroundImage = 'url(' + this.mainBackground + ')'
}
// overwrite padding left for the sidebar
if (this.naviDrawer && this.navigationStyle === 'iconsAndText') style.paddingLeft = '220px'
if (this.naviDrawer && this.navigationStyle === 'iconsOnly') style.paddingLeft = '56px'
return style
}
@@ -311,3 +299,28 @@ export default class App extends Mixins(BaseMixin) {
}
}
</script>
<style>
@import './assets/styles/fonts.css';
@import './assets/styles/toastr.css';
@import './assets/styles/page.scss';
@import './assets/styles/sidebar.scss';
@import './assets/styles/utils.scss';
@import './assets/styles/updateManager.scss';
:root {
--app-height: 100%;
}
#content {
background-attachment: fixed;
background-size: cover;
background-repeat: no-repeat;
}
/*noinspection CssUnusedSymbol*/
.v-btn:not(.v-btn--outlined).primary {
/*noinspection CssUnresolvedCustomProperty*/
color: var(--v-btn-text-primary);
}
</style>
+1 -9
View File
@@ -1,7 +1,7 @@
<template>
<v-navigation-drawer
:key="navigationStyle"
v-model="naviDrawer"
:value="naviDrawer"
:src="sidebarBackground"
:mini-variant="navigationStyle === 'iconsOnly'"
:width="navigationWidth"
@@ -70,10 +70,6 @@ export default class TheSidebar extends Mixins(NavigationMixin, BaseMixin) {
return this.$store.state.naviDrawer
}
set naviDrawer(newVal: boolean) {
this.$store.dispatch('setNaviDrawer', newVal)
}
get navigationStyle() {
return this.$store.state.gui.uiSettings.navigationStyle
}
@@ -133,10 +129,6 @@ export default class TheSidebar extends Mixins(NavigationMixin, BaseMixin) {
return output
}
mounted() {
this.naviDrawer = this.$vuetify.breakpoint.lgAndUp
}
}
</script>
+35 -18
View File
@@ -1,7 +1,7 @@
<template>
<div>
<v-app-bar app elevate-on-scroll :height="topbarHeight" class="topbar pa-0" clipped-left>
<v-app-bar-nav-icon tile @click.stop="naviDrawer = !naviDrawer"></v-app-bar-nav-icon>
<v-app-bar-nav-icon tile @click.stop="naviDrawer = !naviDrawer" />
<router-link to="/">
<template v-if="sidebarLogo">
<img
@@ -17,12 +17,12 @@
class="nav-logo ml-4 mr-1 d-none d-sm-flex"
router
to="/"
:ripple="false"></mainsail-logo>
:ripple="false" />
</template>
</router-link>
<v-toolbar-title class="text-no-wrap ml-0 pl-2 mr-2">{{ printerName }}</v-toolbar-title>
<printer-selector v-if="countPrinters"></printer-selector>
<v-spacer></v-spacer>
<printer-selector v-if="countPrinters" />
<v-spacer />
<input
ref="fileUploadAndStart"
type="file"
@@ -66,9 +66,9 @@
<v-icon class="mr-md-2">{{ mdiAlertOctagonOutline }}</v-icon>
<span class="d-none d-md-inline">{{ $t('App.TopBar.EmergencyStop') }}</span>
</v-btn>
<the-notification-menu></the-notification-menu>
<the-settings-menu></the-settings-menu>
<the-top-corner-menu></the-top-corner-menu>
<the-notification-menu />
<the-settings-menu />
<the-top-corner-menu />
</v-app-bar>
<v-snackbar v-model="uploadSnackbar.status" :timeout="-1" :value="true" fixed right bottom dark>
<strong>{{ $t('App.TopBar.Uploading') }} {{ uploadSnackbar.filename }}</strong>
@@ -84,7 +84,7 @@
</v-snackbar>
<v-dialog v-model="showEmergencyStopDialog" width="400" :fullscreen="isMobile">
<panel
:title="$t('EmergencyStopDialog.EmergencyStop').toString()"
:title="$t('EmergencyStopDialog.EmergencyStop')"
toolbar-color="error"
card-class="emergency-stop-dialog"
:icon="mdiAlertOctagonOutline"
@@ -96,7 +96,7 @@
</template>
<v-card-text>{{ $t('EmergencyStopDialog.AreYouSure') }}</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-spacer />
<v-btn text @click="showEmergencyStopDialog = false">{{ $t('EmergencyStopDialog.No') }}</v-btn>
<v-btn color="primary" text @click="emergencyStop">{{ $t('EmergencyStopDialog.Yes') }}</v-btn>
</v-card-actions>
@@ -245,13 +245,31 @@ export default class TheTopbar extends Mixins(BaseMixin) {
)
}
get defaultNavigationStateSetting() {
return this.$store.state.gui?.uiSettings?.defaultNavigationStateSetting ?? 'alwaysOpen'
}
mounted() {
//this.naviDrawer = this.$vuetify.breakpoint.lgAndUp
switch (this.defaultNavigationStateSetting) {
case 'alwaysClosed':
this.naviDrawer = false
break
case 'lastState':
this.naviDrawer = (localStorage.getItem('naviDrawer') ?? 'true') === 'true'
break
default:
this.naviDrawer = this.$vuetify.breakpoint.lgAndUp
}
}
btnEmergencyStop() {
const confirmOnEmergencyStop = this.$store.state.gui.uiSettings.confirmOnEmergencyStop
if (confirmOnEmergencyStop) {
this.showEmergencyStopDialog = true
} else {
this.emergencyStop()
}
if (!confirmOnEmergencyStop) this.emergencyStop()
this.showEmergencyStopDialog = true
}
emergencyStop() {
@@ -342,14 +360,13 @@ export default class TheTopbar extends Mixins(BaseMixin) {
}
</script>
<style>
<style scoped>
/*noinspection CssUnusedSymbol*/
.topbar .v-toolbar__content {
::v-deep .topbar .v-toolbar__content {
padding-top: 0 !important;
padding-bottom: 0 !important;
}
</style>
<style scoped>
.button-min-width-auto {
min-width: auto !important;
}
@@ -65,13 +65,21 @@ export default class TheScrewsTiltAdjustDialog extends Mixins(BaseMixin, Control
return this.$store.state.printer.screws_tilt_adjust?.error ?? false
}
get max_deviation() {
return this.$store.state.printer.screws_tilt_adjust?.max_deviation ?? null
}
get results() {
return this.$store.state.printer.screws_tilt_adjust?.results ?? {}
}
get showDialog() {
// don't display the dialog, if the user disabled it in the UI settings
if (!this.boolScrewsTiltAdjustDialog) return false
// don't display the dialog, if the user add the MAX_DEVIATION attribute to the SCREWS_TILT_CALCULATE command
if (this.max_deviation !== null) return false
return this.error || Object.keys(this.results).length
}
+66
View File
@@ -0,0 +1,66 @@
<template>
<v-col class="pl-6">
<template v-if="selectAll">
<v-checkbox
v-model="selectAllModel"
:label="$t('Settings.GeneralTab.Everything')"
hide-details
class="mt-0"
:indeterminate="selectAllIndeterminate"
@change="$emit('update:selectedCheckboxes', selectedCheckboxes)"></v-checkbox>
<v-divider class="my-2" />
</template>
<template v-for="option in options">
<v-checkbox
:key="option.value"
v-model="selectedCheckboxes"
:label="option.label"
hide-details
class="mt-0"
:value="option.value"
@change="$emit('update:selectedCheckboxes', selectedCheckboxes)"></v-checkbox>
</template>
</v-col>
</template>
<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '../mixins/base'
import { computed } from 'vue'
import { TranslateResult } from 'vue-i18n'
@Component
export default class CheckboxList extends Mixins(BaseMixin) {
@Prop({ required: true })
declare readonly options: { label: string | TranslateResult; value: string }[]
@Prop({ type: Boolean, required: false, default: false })
declare readonly selectAll: boolean
selectedCheckboxes: (string | TranslateResult)[] = []
selectAllIndeterminate: boolean = false
selectAllModel = computed<boolean>({
get: this.getSelectAll,
set: this.setSelectAll,
})
getSelectAll(): boolean {
this.selectAllIndeterminate = false
if (0 < this.selectedCheckboxes.length && this.selectedCheckboxes.length < this.options.length) {
this.selectAllIndeterminate = true
return false
}
return this.selectedCheckboxes.length == this.options.length
}
setSelectAll(state: boolean) {
if (state) {
this.selectedCheckboxes = this.options.map((o) => o.value)
return
}
this.selectedCheckboxes = []
}
}
</script>
@@ -0,0 +1,152 @@
import Component from 'vue-class-component'
import BaseMixin from './base'
import { TranslateResult } from 'vue-i18n'
@Component
export default class SettingsGeneralDatabase extends BaseMixin {
get availableKeys() {
return [
// gui namespace
{
value: 'general',
label: this.$t('Settings.GeneralTab.General'),
},
{
value: 'control',
label: this.$t('Settings.ControlTab.Control'),
},
{
value: 'dashboard',
label: this.$t('Settings.DashboardTab.Dashboard'),
},
{
value: 'editor',
label: this.$t('Settings.EditorTab.Editor'),
},
{
value: 'gcodeViewer',
label: this.$t('Settings.GCodeViewerTab.GCodeViewer'),
},
{
value: 'navigation',
label: this.$t('Settings.GeneralTab.DBNavigation'),
},
{
value: 'uiSettings',
label: this.$t('Settings.UiSettingsTab.UiSettings'),
},
{
value: 'view',
label: this.$t('Settings.GeneralTab.DbView'),
},
// gui modules
{
value: 'console',
label: this.$t('Settings.ConsoleTab.Console'),
},
{
value: 'gcodehistory',
label: this.$t('Settings.GeneralTab.DbConsoleHistory'),
},
{
value: 'macros',
label: this.$t('Settings.MacrosTab.Macros'),
},
{
value: 'notifications',
label: this.$t('App.Notifications.Notifications'),
},
{
value: 'presets',
label: this.$t('Settings.PresetsTab.PreheatPresets'),
},
{
value: 'remoteprinters',
label: this.$t('Settings.RemotePrintersTab.RemotePrinters'),
},
{
value: 'timelapse',
label: this.$t('Settings.TimelapseTab.Timelapse'),
},
]
}
async loadBackupableNamespaces() {
// init namespaces
let backupableNamespaces: { value: string; label: string | TranslateResult }[] = []
// load DB namespaces from moonraker
const urlRequestDbList = this.$store.getters['socket/getUrl'] + '/server/database/list'
const availableNamespaces = await fetch(urlRequestDbList)
// read json
.then((response) => response?.json())
// extract result namespaces
.then((response) => response?.result?.namespaces ?? [])
.catch(() => {
window.console.error('Cannot load Moonraker DB namespaces')
return []
})
// load mainsail keys, if mainsail namespace exists
if (availableNamespaces.includes('mainsail')) {
const urlRequestMainsailNamespace =
this.$store.getters['socket/getUrl'] + '/server/database/item?namespace=mainsail'
backupableNamespaces = await fetch(urlRequestMainsailNamespace)
// read json
.then((response) => response?.json())
// extract result object
.then((response) => response?.result?.value ?? {})
// extract keys from mainsail gui object
.then((objects) => Object.keys(objects))
// filter initVersion
.then((keys) => keys.filter((key) => key !== 'initVersion'))
// convert to locale
.then((keys) =>
keys.map((key) => {
const namespace = this.availableKeys.find((namespace) => namespace.value === key)
if (namespace) return namespace
// fallback return key name
return { value: key, label: key }
})
)
backupableNamespaces = backupableNamespaces.sort(this.sortNamespaces)
}
// add timelapse if exists
if (availableNamespaces.includes('timelapse')) {
backupableNamespaces.push({
value: 'timelapse',
label: this.$t('Settings.GeneralTab.DbTimelapseSettings'),
})
}
// add webcams if exists
if (availableNamespaces.includes('webcams')) {
backupableNamespaces.push({
value: 'webcams',
label: this.$t('Settings.WebcamsTab.Webcams'),
})
}
return backupableNamespaces
}
sortNamespaces(
a: { value: string; label: string | TranslateResult },
b: { value: string; label: string | TranslateResult }
) {
if (a.value === 'general') return -1
if (b.value === 'general') return 1
const stringA = a.label.toString().toLowerCase()
const stringB = b.label.toString().toLowerCase()
if (stringA < stringB) return -1
if (stringA > stringB) return 1
return 0
}
}
@@ -5,14 +5,14 @@
<strong>{{ repo.name }}</strong>
<br />
<template v-if="type === 'git_repo' && commitsBehind.length">
<a class="primary--text cursor--pointer" @click="boolShowCommitList = true">
<v-icon small color="primary" class="mr-1">{{ mdiInformation }}</v-icon>
<a class="info--text cursor--pointer" @click="boolShowCommitList = true">
<v-icon small color="info" class="mr-1">{{ mdiUpdate }}</v-icon>
{{ versionOutput }}
</a>
</template>
<template v-else-if="type === 'web' && webUpdatable">
<a class="primary--text text-decoration-none" :href="webLinkRelease" target="_blank">
<v-icon small color="primary" class="mr-1">{{ mdiInformation }}</v-icon>
<a class="info--text text-decoration-none" :href="webLinkRelease" target="_blank">
<v-icon small color="info" class="mr-1">{{ mdiUpdate }}</v-icon>
{{ versionOutput }}
</a>
</template>
@@ -23,11 +23,11 @@
v-if="anomalies.length > 0"
small
label
outlined
color="primary"
:outlined="!toggleAnomalies"
color="grey"
class="minwidth-0 px-1 mr-2"
@click="toggleAnomalies = !toggleAnomalies">
<v-icon small>{{ mdiInformation }}</v-icon>
<v-icon small>{{ toggleAnomalies ? mdiInformationOutline : mdiInformation }}</v-icon>
</v-chip>
<template v-if="!isValid">
<v-menu :offset-y="true">
@@ -85,12 +85,12 @@
<v-alert
v-for="(message, index) in warnings"
:key="'warnings_' + index"
text
dense
border="left"
text
color="orange"
border="left"
:icon="mdiCloseCircle">
{{ message }}
<p class="text--disabled mb-0">{{ message }}</p>
</v-alert>
</v-col>
</v-row>
@@ -99,10 +99,10 @@
<v-alert
v-for="(message, index) in anomalies"
:key="'anomalies_' + index"
text
dense
text
color="grey"
border="left"
color="info"
:icon="mdiInformation">
{{ message }}
</v-alert>
@@ -131,9 +131,11 @@ import {
mdiCheck,
mdiHelpCircleOutline,
mdiInformation,
mdiInformationOutline,
mdiMenuDown,
mdiProgressUpload,
mdiReload,
mdiUpdate,
} from '@mdi/js'
import semver from 'semver'
import GitCommitsList from '@/components/panels/Machine/UpdatePanel/GitCommitsList.vue'
@@ -146,6 +148,8 @@ export default class UpdatePanelEntry extends Mixins(BaseMixin) {
mdiMenuDown = mdiMenuDown
mdiReload = mdiReload
mdiCloseCircle = mdiCloseCircle
mdiUpdate = mdiUpdate
mdiInformationOutline = mdiInformationOutline
boolShowCommitList = false
boolShowUpdateHint = false
@@ -5,8 +5,8 @@
<strong>{{ $t('Machine.UpdatePanel.System') }}</strong>
<br />
<template v-if="package_count">
<a class="primary--text cursor--pointer" @click="boolShowPackageList = true">
<v-icon small color="primary" class="mr-1">{{ mdiInformation }}</v-icon>
<a class="info--text cursor--pointer" @click="boolShowPackageList = true">
<v-icon small color="info" class="mr-1">{{ mdiInformation }}</v-icon>
{{ $t('Machine.UpdatePanel.CountPackagesCanBeUpgraded', { count: package_count }) }}
</a>
</template>
@@ -22,7 +22,15 @@
</thead>
<tbody>
<temperature-panel-list-item
v-for="objectName in tempObjects"
v-for="objectName in heaterObjects"
:key="objectName"
:object-name="objectName"
:is-responsive-mobile="el.is.mobile ?? false" />
<temperature-panel-list-item-nevermore
v-if="existsNevermoreFilter"
:is-responsive-mobile="el.is.mobile ?? false" />
<temperature-panel-list-item
v-for="objectName in temperature_sensors"
:key="objectName"
:object-name="objectName"
:is-responsive-mobile="el.is.mobile ?? false" />
@@ -36,8 +44,11 @@
import Component from 'vue-class-component'
import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import TemperaturePanelListItemNevermore from '@/components/panels/Temperature/TemperaturePanelListItemNevermore.vue'
@Component
@Component({
components: { TemperaturePanelListItemNevermore },
})
export default class TemperaturePanelList extends Mixins(BaseMixin) {
get available_heaters() {
return this.$store.state.printer?.heaters?.available_heaters ?? []
@@ -65,12 +76,23 @@ export default class TemperaturePanelList extends Mixins(BaseMixin) {
.sort(this.sortObjectName)
}
get existsNevermoreFilter() {
return 'nevermore' in this.$store.state.printer
}
get hideMcuHostSensors(): boolean {
return this.$store.state.gui.view.tempchart.hideMcuHostSensors ?? false
}
get temperature_sensors() {
return this.available_sensors
.filter((fullName: string) => {
if (this.available_heaters.includes(fullName)) return false
if (this.temperature_fans.includes(fullName)) return false
// hide MCU & Host sensors, if the function is enabled
if (this.hideMcuHostSensors && this.checkMcuHostSensor(fullName)) return false
const splits = fullName.split(' ')
let name = splits[0]
if (splits.length > 1) name = splits[1]
@@ -80,8 +102,19 @@ export default class TemperaturePanelList extends Mixins(BaseMixin) {
.sort(this.sortObjectName)
}
get tempObjects() {
return [...this.filteredHeaters, ...this.temperature_fans, ...this.temperature_sensors]
get heaterObjects() {
return [...this.filteredHeaters, ...this.temperature_fans]
}
get settings() {
return this.$store.state.printer?.configfile?.settings ?? {}
}
checkMcuHostSensor(fullName: string) {
const settingsObject = this.settings[fullName.toLowerCase()] ?? {}
const sensor_type = settingsObject.sensor_type ?? ''
return ['temperature_mcu', 'temperature_host'].includes(sensor_type)
}
sortObjectName(a: string, b: string) {
@@ -6,7 +6,7 @@
</v-icon>
</td>
<td class="name">
<span @click="showEditDialog = true">{{ formatName }}</span>
<span class="cursor-pointer" @click="showEditDialog = true">{{ formatName }}</span>
</td>
<td v-if="!isResponsiveMobile" class="state">
<v-tooltip v-if="state !== null" top>
@@ -67,6 +67,7 @@ export default class TemperaturePanelListItemEdit extends Mixins(BaseMixin) {
get additionalValues() {
if (this.objectName === 'z_thermal_adjust') return ['current_z_adjust']
if (this.objectName === 'nevermore') return ['temperature', 'pressure', 'humidity', 'rpm']
return Object.keys(this.printerObjectAdditionalSensor).filter((key) => key !== 'temperature')
}
@@ -0,0 +1,110 @@
<template>
<tr>
<td class="icon">
<v-icon :color="iconColor" :class="iconClass" tabindex="-1" @click="showEditDialog = true">
{{ mdiFan }}
</v-icon>
</td>
<td class="name">
<span class="cursor-pointer" @click="showEditDialog = true">Nevermore</span>
</td>
<td class="text-no-wrap text-center" colspan="3">
<temperature-panel-list-item-nevermore-value
:printer-object="printerObject"
:small="false"
object-name="nevermore"
key-name="gas" />
<temperature-panel-list-item-nevermore-value
v-for="keyName in nevermoreValues"
:key="keyName"
:printer-object="printerObject"
object-name="nevermore"
:key-name="keyName" />
<div v-if="rpm !== null">
<small :class="rpmClass">{{ rpm }} RPM</small>
</div>
</td>
<temperature-panel-list-item-edit
:bool-show="showEditDialog"
object-name="nevermore"
name="nevermore"
format-name="Nevermore"
additional-sensor-name="nevermore"
:icon="mdiFan"
:color="color"
@close-dialog="showEditDialog = false" />
</tr>
</template>
<script lang="ts">
import Component from 'vue-class-component'
import { Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { mdiFan } from '@mdi/js'
import { opacityHeaterActive, opacityHeaterInactive } from '@/store/variables'
@Component
export default class TemperaturePanelListItemNevermore extends Mixins(BaseMixin) {
mdiFan = mdiFan
@Prop({ type: Boolean, required: true }) readonly isResponsiveMobile!: boolean
showEditDialog = false
nevermoreValues = ['temperature', 'pressure', 'humidity']
get printerObject() {
return this.$store.state.printer.nevermore ?? {}
}
get color() {
return this.$store.state.gui?.view?.tempchart?.datasetSettings?.nevermore?.color ?? '#ffffff'
}
get iconColor() {
// set icon color to active, if no target exists (temperature_sensors) or a heater is active
if (this.state === null || this.state > 0) return `${this.color}${opacityHeaterActive}`
return `${this.color}${opacityHeaterInactive}`
}
get iconClass() {
const classes = ['_no-focus-style', 'cursor-pointer']
// add icon animation, when it is a fan and state > 0
const disableFanAnimation = this.$store.state.gui?.uiSettings.disableFanAnimation ?? false
if (!disableFanAnimation && (this.state ?? 0) > 0) classes.push('icon-rotate')
return classes
}
get state(): number | null {
return this.printerObject.speed ?? null
}
get rpm() {
const rpm = this.printerObject.rpm ?? null
// return null when rpm doesn't exist
if (rpm === null) return null
return parseInt(this.printerObject.rpm)
}
get rpmClass() {
if (this.rpm === 0 && (this.printerObject.speed ?? 0) > 0) return 'red--text'
return ''
}
}
</script>
<style lang="scss" scoped>
::v-deep .v-icon._no-focus-style:focus::after {
opacity: 0 !important;
}
::v-deep .cursor-pointer {
cursor: pointer;
}
</style>
@@ -0,0 +1,141 @@
<template>
<div v-if="isVisible">
<v-tooltip top :disabled="disableTooltip">
<template #activator="{ on, attrs }">
<span :style="cssStyle" v-bind="attrs" v-on="on">{{ formatValue }}</span>
</template>
<span>
{{ $t('Panels.TemperaturePanel.Max') }}: {{ formatValue_max }}
<br />
{{ $t('Panels.TemperaturePanel.Min') }}: {{ formatValue_min }}
</span>
</v-tooltip>
</div>
</template>
<script lang="ts">
import Component from 'vue-class-component'
import { Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
@Component
export default class TemperaturePanelListItemNevermoreValue extends Mixins(BaseMixin) {
@Prop({ type: Object, required: true }) readonly printerObject!: { [key: string]: number }
@Prop({ type: String, required: true }) readonly objectName!: string
@Prop({ type: String, required: true }) readonly keyName!: string
@Prop({ type: Boolean, required: false, default: true }) readonly small!: boolean
get cssStyle() {
let style = { cursor: 'default', fontSize: '1em' }
if (this.small) style.fontSize = '0.8em'
return style
}
get value() {
const value = this.printerObject[this.keyName] ?? null
if (isNaN(value)) return null
return value
}
get intake_value(): number | null {
const name = `intake_${this.keyName}`
return this.printerObject[name] ?? null
}
get intake_value_min(): number | null {
const name = `intake_${this.keyName}_min`
return this.printerObject[name] ?? null
}
get intake_value_max(): number | null {
const name = `intake_${this.keyName}_max`
return this.printerObject[name] ?? null
}
get exhaust_value(): number | null {
const name = `exhaust_${this.keyName}`
return this.printerObject[name] ?? null
}
get exhaust_value_min(): number | null {
const name = `exhaust_${this.keyName}_min`
return this.printerObject[name] ?? null
}
get exhaust_value_max(): number | null {
const name = `exhaust_${this.keyName}_max`
return this.printerObject[name] ?? null
}
get unit(): string | null {
switch (this.keyName) {
case 'temperature':
return '°C'
case 'pressure':
return 'hPa'
case 'humidity':
return '%'
}
return null
}
get digits() {
return ['gas', 'pressure'].includes(this.keyName) ? 0 : 1
}
get formatValue() {
return this.getFormatedValue(this.intake_value, this.exhaust_value)
}
get formatValue_min() {
return this.getFormatedValue(this.intake_value_min, this.exhaust_value_min)
}
get formatValue_max() {
return this.getFormatedValue(this.intake_value_max, this.exhaust_value_max)
}
getFormatedValue(intake: number | null, exhaust: number | null): string {
let intake_value = intake?.toFixed(this.digits)
let exhaust_value = exhaust?.toFixed(this.digits)
if (this.intake_value === null) intake_value = '--'
if (this.exhaust_value === null) exhaust_value = '--'
// return only the value, if unit is null
if (this.unit === null) return `${intake_value} > ${exhaust_value}`
return `${intake_value} ${this.unit} > ${exhaust_value} ${this.unit}`
}
get disableTooltip() {
return (
this.intake_value_min === null ||
this.exhaust_value_min === null ||
this.intake_value_max === null ||
this.exhaust_value_max === null
)
}
get guiSetting() {
return this.$store.getters['gui/getDatasetAdditionalSensorValue']({
name: this.objectName,
sensor: this.keyName,
})
}
get isVisible() {
if (this.intake_value === null && this.exhaust_value === null) return false
return this.guiSetting
}
}
</script>
@@ -13,6 +13,13 @@
hide-details
:label="$t('Panels.TemperaturePanel.ShowChart')" />
</v-list-item>
<v-list-item class="minHeight36">
<v-checkbox
v-model="hideMcuHostSensors"
class="mt-0"
hide-details
:label="$t('Panels.TemperaturePanel.HideMcuHostSensors')" />
</v-list-item>
<v-list-item class="minHeight36">
<v-checkbox
v-model="autoscaleTempchart"
@@ -49,5 +56,13 @@ export default class TemperaturePanelSettings extends Mixins(BaseMixin) {
set autoscaleTempchart(newVal: boolean) {
this.$store.dispatch('gui/saveSetting', { name: 'view.tempchart.autoscale', value: newVal })
}
get hideMcuHostSensors(): boolean {
return this.$store.state.gui.view.tempchart.hideMcuHostSensors ?? false
}
set hideMcuHostSensors(newVal: boolean) {
this.$store.dispatch('gui/saveSetting', { name: 'view.tempchart.hideMcuHostSensors', value: newVal })
}
}
</script>
+10 -2
View File
@@ -94,11 +94,11 @@
<!-- MOVE TO CONTROL -->
<move-to-control class="py-0 pt-3"></move-to-control>
<!-- AXIS CONTROL -->
<v-container>
<v-container v-if="axisControlVisible">
<component :is="`${controlStyle}-control`"></component>
</v-container>
<!-- Z-OFFSET CONTROL -->
<v-divider></v-divider>
<v-divider :class="{ 'mt-3': !axisControlVisible }"></v-divider>
<v-container>
<zoffset-control></zoffset-control>
</v-container>
@@ -164,5 +164,13 @@ export default class ToolheadControlPanel extends Mixins(BaseMixin, ControlMixin
get speedFactor(): number {
return this.$store.state.printer?.gcode_move?.speed_factor ?? 1
}
get isPrinting() {
return ['printing'].includes(this.printer_state)
}
get axisControlVisible() {
return !(this.isPrinting && (this.$store.state.gui.control.hideDuringPrint ?? false))
}
}
</script>
@@ -0,0 +1,88 @@
<template>
<div>
<v-btn :loading="loadings.includes('backupDbButton')" small @click="openDialog">
{{ $t('Settings.GeneralTab.Backup') }}
</v-btn>
<v-dialog v-model="showDialog" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.Backup')"
card-class="mainsail-backup-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
<template #buttons>
<v-btn icon tile @click="closeDialog">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>
<v-row>
<v-col>
<p class="mb-0">{{ $t('Settings.GeneralTab.BackupDialog') }}</p>
</v-col>
</v-row>
<v-row>
<checkbox-list
:options="backupableNamespaces"
select-all
@update:selectedCheckboxes="onSelectBackupCheckboxes" />
</v-row>
<v-row>
<v-col class="text-center">
<v-btn color="red" :loading="loadings.includes('backupMainsail')" @click="backupMainsail">
{{ $t('Settings.GeneralTab.Backup') }}
</v-btn>
</v-col>
</v-row>
</v-card-text>
</panel>
</v-dialog>
</div>
</template>
<script lang="ts">
import Component from 'vue-class-component'
import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import Panel from '@/components/ui/Panel.vue'
import { mdiCloseThick, mdiHelpCircle } from '@mdi/js'
import CheckboxList from '@/components/inputs/CheckboxList.vue'
import { TranslateResult } from 'vue-i18n'
import SettingsGeneralDatabase from '@/components/mixins/settingsGeneralDatabase'
@Component({
components: { Panel, SettingsRow, CheckboxList },
})
export default class SettingsGeneralTabBackupDatabase extends Mixins(BaseMixin, SettingsGeneralDatabase) {
mdiHelpCircle = mdiHelpCircle
mdiCloseThick = mdiCloseThick
showDialog = false
backupableNamespaces: { value: string; label: string | TranslateResult }[] = []
backupCheckboxes: string[] = []
async mounted() {
this.backupableNamespaces = await this.loadBackupableNamespaces()
}
onSelectBackupCheckboxes(backupCheckboxes: string[]) {
this.backupCheckboxes = backupCheckboxes
}
async backupMainsail() {
await this.$store.dispatch('socket/addLoading', 'backupMainsail')
await this.$store.dispatch('gui/backupMoonrakerDB', this.backupCheckboxes)
await this.$store.dispatch('socket/removeLoading', 'backupMainsail')
this.closeDialog()
}
async openDialog() {
this.backupableNamespaces = await this.loadBackupableNamespaces()
this.showDialog = true
}
closeDialog() {
this.showDialog = false
}
}
</script>
@@ -0,0 +1,89 @@
<template>
<div>
<v-btn color="error" small @click="openDialog">
{{ $t('Settings.GeneralTab.FactoryReset') }}
</v-btn>
<v-dialog v-model="showDialog" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.FactoryReset')"
card-class="mainsail-reset-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
<template #buttons>
<v-btn icon tile @click="closeDialog">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>
<v-row>
<v-col>
<p class="mb-0">{{ $t('Settings.GeneralTab.FactoryDialog') }}</p>
</v-col>
</v-row>
<v-row>
<checkbox-list
:options="resetableNamespaces"
select-all
@update:selectedCheckboxes="onSelectResetCheckboxes" />
</v-row>
<v-row>
<v-col class="text-center">
<v-btn
color="red"
:loading="loadings.includes('resetMainsail')"
@click="resetMainsailAction">
{{ $t('Settings.GeneralTab.Reset') }}
</v-btn>
</v-col>
</v-row>
</v-card-text>
</panel>
</v-dialog>
</div>
</template>
<script lang="ts">
import Component from 'vue-class-component'
import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import Panel from '@/components/ui/Panel.vue'
import { mdiCloseThick, mdiHelpCircle } from '@mdi/js'
import CheckboxList from '@/components/inputs/CheckboxList.vue'
import { TranslateResult } from 'vue-i18n'
import SettingsGeneralDatabase from '@/components/mixins/settingsGeneralDatabase'
@Component({
components: { Panel, SettingsRow, CheckboxList },
})
export default class SettingsGeneralTabResetDatabase extends Mixins(BaseMixin, SettingsGeneralDatabase) {
mdiHelpCircle = mdiHelpCircle
mdiCloseThick = mdiCloseThick
showDialog = false
resetableNamespaces: { value: string; label: string | TranslateResult }[] = []
resetCheckboxes: string[] = []
async mounted() {
this.resetableNamespaces = await this.loadBackupableNamespaces()
}
onSelectResetCheckboxes(resetCheckboxes: string[]) {
this.resetCheckboxes = resetCheckboxes
}
resetMainsailAction() {
this.$store.dispatch('socket/addLoading', 'resetMainsail')
this.$store.dispatch('gui/resetMoonrakerDB', this.resetCheckboxes)
}
async openDialog() {
this.resetableNamespaces = await this.loadBackupableNamespaces()
this.showDialog = true
}
closeDialog() {
this.showDialog = false
}
}
</script>
@@ -0,0 +1,137 @@
<template>
<div>
<input ref="uploadBackupFile" type="file" :accept="['.json']" class="d-none" @change="uploadRestore" />
<v-btn small :loading="loadings.includes('restoreUploadButton')" class="ml-3" @click="restoreDb">
{{ $t('Settings.GeneralTab.Restore') }}
</v-btn>
<v-dialog :value="showDialog" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.Restore')"
card-class="mainsail-restore-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
<template #buttons>
<v-btn icon tile @click="closeDialog">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>
<v-row>
<v-col>
<p class="mb-0">{{ $t('Settings.GeneralTab.RestoreDialog') }}</p>
</v-col>
</v-row>
<v-row>
<checkbox-list
:options="restoreableNamespaces"
select-all
@update:selectedCheckboxes="onSelectRestoreCheckboxes" />
</v-row>
<v-row>
<v-col class="text-center">
<v-btn color="red" :loading="loadings.includes('restoreMainsail')" @click="restoreDbAction">
{{ $t('Settings.GeneralTab.Restore') }}
</v-btn>
</v-col>
</v-row>
</v-card-text>
</panel>
</v-dialog>
</div>
</template>
<script lang="ts">
import Component from 'vue-class-component'
import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import Panel from '@/components/ui/Panel.vue'
import { mdiCloseThick, mdiHelpCircle } from '@mdi/js'
import CheckboxList from '@/components/inputs/CheckboxList.vue'
import { TranslateResult } from 'vue-i18n'
import SettingsGeneralDatabase from '@/components/mixins/settingsGeneralDatabase'
import SettingsGeneralTabBackupDatabase from '@/components/settings/General/GeneralBackup.vue'
import Vue from 'vue'
@Component({
components: { SettingsGeneralTabBackupDatabase, Panel, SettingsRow, CheckboxList },
})
export default class SettingsGeneralTabRestoreDatabase extends Mixins(BaseMixin, SettingsGeneralDatabase) {
mdiHelpCircle = mdiHelpCircle
mdiCloseThick = mdiCloseThick
declare $refs: {
uploadBackupFile: HTMLInputElement
}
showDialog = false
restoreableNamespaces: { value: string; label: string | TranslateResult }[] = []
restoreCheckboxes: string[] = []
restoreObjects: any = {}
onSelectRestoreCheckboxes(backupCheckboxes: string[]) {
this.restoreCheckboxes = backupCheckboxes
}
async restoreDb() {
this.$refs?.uploadBackupFile?.click()
}
uploadRestore() {
if ((this.$refs.uploadBackupFile.files?.length ?? 0) === 0) {
window.console.error('No json uploaded')
return
}
// get file
// @ts-ignore
const backup = this.$refs?.uploadBackupFile?.files[0]
const reader = new FileReader()
reader.readAsText(backup, 'UTF-8')
reader.onload = (evt) => {
this.restoreableNamespaces = []
try {
this.restoreObjects = JSON.parse(evt?.target?.result + '')
const keys = Object.keys(this.restoreObjects)
this.restoreableNamespaces = keys.map((key) => {
const namespace = this.availableKeys.find((namespace) => namespace.value === key)
if (namespace) return namespace
return { value: key, label: key }
})
// sort restoreableNamespaces
this.restoreableNamespaces = this.restoreableNamespaces.sort(this.sortNamespaces)
this.openDialog()
} catch (e) {
Vue.$toast.error(this.$t('Settings.GeneralTab.CannotReadJson').toString())
}
}
reader.onerror = (evt) => {
window.console.error(evt)
}
// empty input file field
this.$refs.uploadBackupFile.value = ''
}
openDialog() {
this.showDialog = true
}
closeDialog() {
this.showDialog = false
}
restoreDbAction() {
this.$store.dispatch('socket/addLoading', 'restoreDbAction')
this.$store.dispatch('gui/restoreMoonrakerDB', {
dbCheckboxes: this.restoreCheckboxes,
restoreObjects: this.restoreObjects,
})
}
}
</script>
@@ -35,6 +35,12 @@
</settings-row>
<v-divider class="my-2"></v-divider>
</template>
<settings-row
:title="$t('Settings.ControlTab.HideDuringPrint').toString()"
:dynamic-slot-width="true">
<v-switch v-model="hideDuringPrint" hide-details class="mt-0"></v-switch>
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row
:title="$t('Settings.ControlTab.EnableXYHoming').toString()"
:dynamic-slot-width="true">
@@ -336,6 +342,14 @@ export default class SettingsControlTab extends Mixins(BaseMixin, ControlMixin)
this.$store.dispatch('gui/saveSetting', { name: 'control.style', value: newVal })
}
get hideDuringPrint(): Boolean {
return this.$store.state.gui.control.hideDuringPrint ?? false
}
set hideDuringPrint(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'control.hideDuringPrint', value: newVal })
}
get actionOptions() {
let actions = [
{
+23 -414
View File
@@ -7,33 +7,21 @@
</settings-row>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.Language')">
<v-select
v-model="currentLanguage"
:items="availableLanguages"
hide-details
outlined
dense
attach />
<v-select v-model="currentLanguage" :items="availableLanguages" hide-details outlined dense />
</settings-row>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.DateFormat')">
<v-select v-model="dateFormat" :items="dateFormatItems" hide-details outlined dense attach />
<v-select v-model="dateFormat" :items="dateFormatItems" hide-details outlined dense />
</settings-row>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.TimeFormat')">
<v-select v-model="timeFormat" :items="timeFormatItems" hide-details outlined dense attach />
<v-select v-model="timeFormat" :items="timeFormatItems" hide-details outlined dense />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.GeneralTab.CalcPrintProgress')"
:sub-title="$t('Settings.GeneralTab.CalcPrintProgressDescription')">
<v-select
v-model="calcPrintProgress"
:items="calcPrintProgressItems"
hide-details
dense
outlined
attach />
<v-select v-model="calcPrintProgress" :items="calcPrintProgressItems" hide-details dense outlined />
</settings-row>
<v-divider class="my-2" />
<settings-row
@@ -45,189 +33,25 @@
multiple
hide-details
dense
outlined
attach />
outlined />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.GeneralTab.CalcEtaTime')"
:sub-title="$t('Settings.GeneralTab.CalcEtaTimeDescription')">
<v-select
v-model="calcEtaTime"
:items="calcEtaTimeItems"
multiple
hide-details
dense
outlined
attach />
<v-select v-model="calcEtaTime" :items="calcEtaTimeItems" multiple hide-details dense outlined />
</settings-row>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.MainsailSettingsMoonrakerDb')" :dynamic-slot-width="true">
<input
ref="uploadBackupFile"
type="file"
:accept="['.json']"
class="d-none"
@change="uploadRestore" />
<v-btn :loading="loadings.includes('backupDbButton')" small @click="backupDb">
{{ $t('Settings.GeneralTab.Backup') }}
</v-btn>
<v-btn small :loading="loadings.includes('restoreUploadButton')" class="ml-3" @click="restoreDb">
{{ $t('Settings.GeneralTab.Restore') }}
</v-btn>
<settings-general-tab-backup-database />
<settings-general-tab-restore-database />
</settings-row>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.FactoryReset')" :dynamic-slot-width="true">
<v-btn color="error" small @click="resetMainsail">
{{ $t('Settings.GeneralTab.FactoryReset') }}
</v-btn>
<settings-general-tab-reset-database />
</settings-row>
</v-card-text>
</v-card>
<v-dialog v-model="dialogBackupMainsail" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.Backup')"
card-class="mainsail-backup-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
<template #buttons>
<v-btn icon tile @click="dialogBackupMainsail = false">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>
<v-row>
<v-col>
<p class="mb-0">{{ $t('Settings.GeneralTab.BackupDialog') }}</p>
</v-col>
</v-row>
<v-row>
<v-col class="pl-6">
<template v-for="db in mainsailKeys">
<v-checkbox
:key="db.name"
:label="db.label"
hide-details
class="mt-0"
@change="changeNamespace(db.name)" />
</template>
<v-checkbox
v-if="availableNamespaces.includes('timelapse')"
:label="$t('Settings.GeneralTab.DbTimelapseSettings')"
hide-details
class="mt-0"
@change="changeNamespace('timelapse')" />
</v-col>
</v-row>
<v-row>
<v-col class="text-center">
<v-btn color="red" :loading="loadings.includes('backupMainsail')" @click="backupMainsail">
{{ $t('Settings.GeneralTab.Backup') }}
</v-btn>
</v-col>
</v-row>
</v-card-text>
</panel>
</v-dialog>
<v-dialog v-model="dialogResetMainsail" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.FactoryReset')"
card-class="factory-reset-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
<template #buttons>
<v-btn icon tile @click="dialogResetMainsail = false">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>
<v-row>
<v-col>
<p class="mb-0">{{ $t('Settings.GeneralTab.FactoryDialog') }}</p>
</v-col>
</v-row>
<v-row>
<v-col class="pl-6">
<template v-for="db in mainsailKeys">
<v-checkbox
:key="db.name"
:label="db.label"
hide-details
class="mt-0"
@change="changeNamespace(db.name)" />
</template>
<v-checkbox
v-if="availableNamespaces.includes('timelapse')"
:label="$t('Settings.GeneralTab.DbTimelapseSettings')"
hide-details
class="mt-0"
@change="changeNamespace('timelapse')" />
<v-checkbox
v-if="moonrakerComponents.includes('history')"
:label="$t('Settings.GeneralTab.DbHistoryJobs')"
hide-details
class="mt-0"
@change="changeNamespace('history_jobs')" />
<v-checkbox
v-if="moonrakerComponents.includes('history')"
:label="$t('Settings.GeneralTab.DbHistoryTotals')"
hide-details
class="mt-0"
@change="changeNamespace('history_totals')" />
</v-col>
</v-row>
<v-row>
<v-col class="text-center">
<v-btn
color="red"
:loading="loadings.includes('resetMainsail')"
@click="resetMainsailAction">
{{ $t('Settings.GeneralTab.Reset') }}
</v-btn>
</v-col>
</v-row>
</v-card-text>
</panel>
</v-dialog>
<v-dialog v-model="dialogRestoreMainsail" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.Restore')"
card-class="factory-reset-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
<template #buttons>
<v-btn icon tile @click="dialogRestoreMainsail = false">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>
<v-row>
<v-col>
<p class="mb-0">{{ $t('Settings.GeneralTab.RestoreDialog') }}</p>
</v-col>
</v-row>
<v-row>
<v-col class="pl-6">
<template v-for="db in restoreableNamespaces">
<v-checkbox
:key="db.name"
:label="db.label"
hide-details
class="mt-0"
@change="changeNamespace(db.name)" />
</template>
</v-col>
</v-row>
<v-row>
<v-col class="text-center">
<v-btn color="red" :loading="loadings.includes('restoreMainsail')" @click="restoreDbAction">
{{ $t('Settings.GeneralTab.Restore') }}
</v-btn>
</v-col>
</v-row>
</v-card-text>
</panel>
</v-dialog>
</div>
</template>
@@ -237,93 +61,27 @@ import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import Panel from '@/components/ui/Panel.vue'
import Vue from 'vue'
import { mdiCloseThick, mdiHelpCircle } from '@mdi/js'
import CheckboxList from '@/components/inputs/CheckboxList.vue'
import SettingsGeneralTabBackupDatabase from '@/components/settings/General/GeneralBackup.vue'
import SettingsGeneralTabRestoreDatabase from '@/components/settings/General/GeneralRestore.vue'
import SettingsGeneralTabResetDatabase from '@/components/settings/General/GeneralReset.vue'
import SettingsGeneralDatabase from '@/components/mixins/settingsGeneralDatabase'
@Component({
components: { Panel, SettingsRow },
components: {
Panel,
SettingsRow,
CheckboxList,
SettingsGeneralTabBackupDatabase,
SettingsGeneralTabRestoreDatabase,
SettingsGeneralTabResetDatabase,
},
})
export default class SettingsGeneralTab extends Mixins(BaseMixin) {
export default class SettingsGeneralTab extends Mixins(BaseMixin, SettingsGeneralDatabase) {
mdiHelpCircle = mdiHelpCircle
mdiCloseThick = mdiCloseThick
private dialogBackupMainsail = false
private dialogResetMainsail = false
private dialogRestoreMainsail = false
private dbCheckboxes: string[] = []
private restoreableNamespaces: { name: string; label: string }[] = []
private restoreObjects: any = {}
private mainsailKeys: { name: string; label: string }[] = []
private availableNamespaces: string[] = []
declare $refs: {
uploadBackupFile: HTMLInputElement
}
get availableKeys() {
return [
{
name: 'general',
label: this.$t('Settings.GeneralTab.General'),
},
{
name: 'console',
label: this.$t('Settings.ConsoleTab.Console'),
},
{
name: 'control',
label: this.$t('Settings.ControlTab.Control'),
},
{
name: 'dashboard',
label: this.$t('Settings.DashboardTab.Dashboard'),
},
{
name: 'editor',
label: this.$t('Settings.EditorTab.Editor'),
},
{
name: 'gcodeViewer',
label: this.$t('Settings.GCodeViewerTab.GCodeViewer'),
},
{
name: 'gcodehistory',
label: this.$t('Settings.GeneralTab.DbConsoleHistory'),
},
{
name: 'macros',
label: this.$t('Settings.MacrosTab.Macros'),
},
{
name: 'notifications',
label: this.$t('App.Notifications.Notifications'),
},
{
name: 'presets',
label: this.$t('Settings.PresetsTab.PreheatPresets'),
},
{
name: 'remoteprinters',
label: this.$t('Settings.RemotePrintersTab.RemotePrinters'),
},
{
name: 'timelapse',
label: this.$t('Settings.TimelapseTab.Timelapse'),
},
{
name: 'uiSettings',
label: this.$t('Settings.UiSettingsTab.UiSettings'),
},
{
name: 'view',
label: this.$t('Settings.GeneralTab.DbView'),
},
]
}
get printerName() {
return this.$store.state.gui.general.printername
}
@@ -459,154 +217,5 @@ export default class SettingsGeneralTab extends Mixins(BaseMixin) {
set calcEtaTime(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'general.calcEtaTime', value: newVal })
}
get moonrakerDbNamespaces() {
return this.$store.state.server.dbNamespaces ?? []
}
get moonrakerComponents() {
return this.$store.state.server.components ?? []
}
async refreshNamespaces() {
this.availableNamespaces = []
const url = this.$store.getters['socket/getUrl'] + '/server/database/list'
const response = await fetch(url)
if (response) {
const objects = await response.json()
this.availableNamespaces = [...(objects.result?.namespaces || {})] ?? []
}
}
async refreshMainsailKeys() {
this.mainsailKeys = []
const url = this.$store.getters['socket/getUrl'] + '/server/database/item?namespace=mainsail'
const response = await fetch(url)
if (response) {
const objects = await response.json()
if (objects?.result?.value) {
Object.keys(objects?.result?.value).forEach((tmp: string) => {
if (tmp !== 'initVersion') {
const namespace = this.availableKeys.find((namespace) => namespace.name === tmp)
const tmpNamespace = namespace ? namespace : { name: tmp, label: tmp }
this.mainsailKeys.push(tmpNamespace)
}
})
this.mainsailKeys = this.mainsailKeys.sort((a, b) => {
if (a.name === 'general') return -1
if (b.name === 'general') return 1
const stringA = a.label.toString().toLowerCase()
const stringB = b.label.toString().toLowerCase()
if (stringA < stringB) return -1
if (stringA > stringB) return 1
return 0
})
}
}
}
changeNamespace(name: string) {
if (this.dbCheckboxes.includes(name)) {
const index = this.dbCheckboxes.indexOf(name)
if (index >= 0) this.dbCheckboxes.splice(index, 1)
} else this.dbCheckboxes.push(name)
}
async resetMainsail() {
await this.refreshNamespaces()
if (this.availableNamespaces.includes('mainsail')) await this.refreshMainsailKeys()
else this.mainsailKeys = []
this.dbCheckboxes = []
this.dialogResetMainsail = true
}
async resetMainsailAction() {
await this.$store.dispatch('socket/addLoading', 'resetMainsail')
await this.$store.dispatch('gui/resetMoonrakerDB', this.dbCheckboxes)
}
async backupDb() {
await this.$store.dispatch('socket/addLoading', 'backupDbButton')
await this.refreshNamespaces()
if (this.availableNamespaces.includes('mainsail')) await this.refreshMainsailKeys()
else this.mainsailKeys = []
this.dbCheckboxes = []
this.dialogBackupMainsail = true
}
async backupMainsail() {
await this.$store.dispatch('socket/addLoading', 'backupMainsail')
await this.$store.dispatch('gui/backupMoonrakerDB', this.dbCheckboxes)
await this.$store.dispatch('socket/removeLoading', 'backupMainsail')
this.dialogBackupMainsail = false
}
async restoreDb() {
await this.$store.dispatch('socket/addLoading', 'restoreUploadButton')
this.$refs?.uploadBackupFile?.click()
}
uploadRestore() {
if (this.$refs.uploadBackupFile.files?.length) {
const backup = this.$refs.uploadBackupFile.files[0]
if (backup) {
const reader = new FileReader()
reader.readAsText(backup, 'UTF-8')
reader.onload = (evt) => {
this.restoreableNamespaces = []
try {
this.restoreObjects = JSON.parse(evt?.target?.result + '')
Object.keys(this.restoreObjects).forEach((tmp: string) => {
const namespace = this.availableKeys.find((namespace) => namespace.name === tmp)
const tmpNamespace = namespace ? namespace : { name: tmp, label: tmp }
this.restoreableNamespaces.push(tmpNamespace)
})
this.restoreableNamespaces = this.restoreableNamespaces.sort((a, b) => {
if (a.name === 'general') return -1
if (b.name === 'general') return 1
const stringA = a.label.toString().toLowerCase()
const stringB = b.label.toString().toLowerCase()
if (stringA < stringB) return -1
if (stringA > stringB) return 1
return 0
})
this.dbCheckboxes = []
this.dialogRestoreMainsail = true
} catch (e) {
Vue.$toast.error(this.$t('Settings.GeneralTab.CannotReadJson') + '')
}
}
reader.onerror = (evt) => {
window.console.error(evt)
}
}
this.$refs.uploadBackupFile.value = ''
}
}
async restoreDbAction() {
this.$store.dispatch('socket/addLoading', 'restoreDbAction')
this.$store.dispatch('gui/restoreMoonrakerDB', {
dbCheckboxes: this.dbCheckboxes,
restoreObjects: this.restoreObjects,
})
}
}
</script>
@@ -2,7 +2,7 @@
<div>
<v-card flat>
<v-card-text>
<settings-row :title="$t('Settings.UiSettingsTab.Logo').toString()">
<settings-row :title="$t('Settings.UiSettingsTab.Logo')">
<v-btn
v-if="logoColor.toLowerCase() !== defaultLogoColor.toLowerCase()"
small
@@ -19,11 +19,11 @@
:value="logoColor"
hide-mode-switch
mode="rgba"
@update:color="updateLogoColor"></v-color-picker>
@update:color="updateLogoColor" />
</v-menu>
</settings-row>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.UiSettingsTab.Primary').toString()">
<settings-row :title="$t('Settings.UiSettingsTab.Primary')">
<v-btn
v-if="primaryColor.toLowerCase() !== defaultPrimaryColor.toLowerCase()"
small
@@ -45,8 +45,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.GcodeThumbnails').toString()"
:sub-title="$t('Settings.UiSettingsTab.GcodeThumbnailsDescription').toString()"
:title="$t('Settings.UiSettingsTab.GcodeThumbnails')"
:sub-title="$t('Settings.UiSettingsTab.GcodeThumbnailsDescription')"
:dynamic-slot-width="true">
<v-btn
outlined
@@ -54,27 +54,27 @@
color="primary"
href="https://docs.mainsail.xyz/overview/features/thumbnails"
target="_blank">
{{ $t('Settings.UiSettingsTab.Guide').toString() }}
{{ $t('Settings.UiSettingsTab.Guide') }}
</v-btn>
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.BoolBigThumbnail').toString()"
:sub-title="$t('Settings.UiSettingsTab.BoolBigThumbnailDescription').toString()"
:title="$t('Settings.UiSettingsTab.BoolBigThumbnail')"
:sub-title="$t('Settings.UiSettingsTab.BoolBigThumbnailDescription')"
:dynamic-slot-width="true">
<v-switch v-model="boolBigThumbnail" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.DisplayCANCEL_PRINT').toString()"
:sub-title="$t('Settings.UiSettingsTab.DisplayCANCEL_PRINTDescription').toString()"
:title="$t('Settings.UiSettingsTab.DisplayCANCEL_PRINT')"
:sub-title="$t('Settings.UiSettingsTab.DisplayCANCEL_PRINTDescription')"
:dynamic-slot-width="true">
<v-switch v-model="displayCancelPrint" hide-details class="mt-0"></v-switch>
<v-switch v-model="displayCancelPrint" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.LockSliders').toString()"
:sub-title="$t('Settings.UiSettingsTab.LockSlidersDescription').toString()"
:title="$t('Settings.UiSettingsTab.LockSliders')"
:sub-title="$t('Settings.UiSettingsTab.LockSlidersDescription')"
:dynamic-slot-width="true">
<v-switch v-model="lockSliders" hide-details class="mt-0" />
</settings-row>
@@ -82,8 +82,8 @@
<v-expand-transition>
<settings-row
v-show="lockSliders"
:title="$t('Settings.UiSettingsTab.LockSlidersDelay').toString()"
:sub-title="$t('Settings.UiSettingsTab.LockSlidersDelayDescription').toString()"
:title="$t('Settings.UiSettingsTab.LockSlidersDelay')"
:sub-title="$t('Settings.UiSettingsTab.LockSlidersDelayDescription')"
:dynamic-slot-width="true">
<v-text-field
v-model="lockSlidersDelay"
@@ -104,22 +104,22 @@
</v-expand-transition>
<v-divider v-show="lockSliders" class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.ConfirmOnEmergencyStop').toString()"
:sub-title="$t('Settings.UiSettingsTab.ConfirmOnEmergencyStopDescription').toString()"
:title="$t('Settings.UiSettingsTab.ConfirmOnEmergencyStop')"
:sub-title="$t('Settings.UiSettingsTab.ConfirmOnEmergencyStopDescription')"
:dynamic-slot-width="true">
<v-switch v-model="confirmOnEmergencyStop" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.ConfirmOnPowerDeviceChange').toString()"
:sub-title="$t('Settings.UiSettingsTab.ConfirmOnPowerDeviceChangeDescription').toString()"
:title="$t('Settings.UiSettingsTab.ConfirmOnPowerDeviceChange')"
:sub-title="$t('Settings.UiSettingsTab.ConfirmOnPowerDeviceChangeDescription')"
:dynamic-slot-width="true">
<v-switch v-model="confirmOnPowerDeviceChange" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.NavigationStyle').toString()"
:sub-title="$t('Settings.UiSettingsTab.NavigationStyleDescription').toString()">
:title="$t('Settings.UiSettingsTab.NavigationStyle')"
:sub-title="$t('Settings.UiSettingsTab.NavigationStyleDescription')">
<v-select
v-model="navigationStyleSetting"
:items="navigationStyles"
@@ -130,15 +130,27 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.BoolHideUploadAndPrintButton').toString()"
:sub-title="$t('Settings.UiSettingsTab.BoolHideUploadAndPrintButtonDescription').toString()"
:title="$t('Settings.UiSettingsTab.DefaultNavigationState')"
:sub-title="$t('Settings.UiSettingsTab.DefaultNavigationStateDescription')">
<v-select
v-model="defaultNavigationStateSetting"
:items="defaultNavigationStateSettings"
class="mt-0"
hide-details
outlined
dense />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.BoolHideUploadAndPrintButton')"
:sub-title="$t('Settings.UiSettingsTab.BoolHideUploadAndPrintButtonDescription')"
:dynamic-slot-width="true">
<v-switch v-model="boolHideUploadAndPrintButton" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2"></v-divider>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.PowerDeviceName').toString()"
:sub-title="$t('Settings.UiSettingsTab.PowerDeviceNameDescription').toString()"
:title="$t('Settings.UiSettingsTab.PowerDeviceName')"
:sub-title="$t('Settings.UiSettingsTab.PowerDeviceNameDescription')"
:dynamic-slot-width="true">
<v-select
v-model="powerDeviceName"
@@ -150,43 +162,43 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.HideSaveConfigButtonForBedMesh').toString()"
:sub-title="$t('Settings.UiSettingsTab.HideSaveConfigButtonForBedMeshDescription').toString()"
:title="$t('Settings.UiSettingsTab.HideSaveConfigButtonForBedMesh')"
:sub-title="$t('Settings.UiSettingsTab.HideSaveConfigButtonForBedMeshDescription')"
:dynamic-slot-width="true">
<v-switch v-model="hideSaveConfigForBedMash" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.DisableFanAnimation').toString()"
:sub-title="$t('Settings.UiSettingsTab.DisableFanAnimationDescription').toString()"
:title="$t('Settings.UiSettingsTab.DisableFanAnimation')"
:sub-title="$t('Settings.UiSettingsTab.DisableFanAnimationDescription')"
:dynamic-slot-width="true">
<v-switch v-model="disableFanAnimation" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.ManualProbeDialog').toString()"
:sub-title="$t('Settings.UiSettingsTab.ManualProbeDialogDescription').toString()"
:title="$t('Settings.UiSettingsTab.ManualProbeDialog')"
:sub-title="$t('Settings.UiSettingsTab.ManualProbeDialogDescription')"
:dynamic-slot-width="true">
<v-switch v-model="boolManualProbeDialog" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.BedScrewsDialog').toString()"
:sub-title="$t('Settings.UiSettingsTab.BedScrewsDialogDescription').toString()"
:title="$t('Settings.UiSettingsTab.BedScrewsDialog')"
:sub-title="$t('Settings.UiSettingsTab.BedScrewsDialogDescription')"
:dynamic-slot-width="true">
<v-switch v-model="boolBedScrewsDialog" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.ScrewsTiltAdjustDialog').toString()"
:sub-title="$t('Settings.UiSettingsTab.ScrewsTiltAdjustDialogDescription').toString()"
:title="$t('Settings.UiSettingsTab.ScrewsTiltAdjustDialog')"
:sub-title="$t('Settings.UiSettingsTab.ScrewsTiltAdjustDialogDescription')"
:dynamic-slot-width="true">
<v-switch v-model="boolScrewsTiltAdjustDialog" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.TempchartHeight').toString()"
:sub-title="$t('Settings.UiSettingsTab.TempchartHeightDescription').toString()">
:title="$t('Settings.UiSettingsTab.TempchartHeight')"
:sub-title="$t('Settings.UiSettingsTab.TempchartHeightDescription')">
<v-slider
v-model.lazy="tempchartHeight"
hide-details
@@ -224,8 +236,8 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin) {
mdiRestart = mdiRestart
mdiTimerOutline = mdiTimerOutline
private defaultLogoColor = defaultLogoColor
private defaultPrimaryColor = defaultPrimaryColor
defaultLogoColor = defaultLogoColor
defaultPrimaryColor = defaultPrimaryColor
get logoColor() {
return this.$store.state.gui.uiSettings.logo
@@ -318,6 +330,31 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin) {
]
}
get defaultNavigationStateSetting() {
return this.$store.state.gui.uiSettings.defaultNavigationStateSetting
}
set defaultNavigationStateSetting(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'uiSettings.defaultNavigationStateSetting', value: newVal })
}
get defaultNavigationStateSettings() {
return [
{
text: this.$t('Settings.UiSettingsTab.DefaultNavigationStateAlwaysOpen'),
value: 'alwaysOpen',
},
{
text: this.$t('Settings.UiSettingsTab.DefaultNavigationStateAlwaysClosed'),
value: 'alwaysClosed',
},
{
text: this.$t('Settings.UiSettingsTab.DefaultNavigationStateLastState'),
value: 'lastState',
},
]
}
get boolHideUploadAndPrintButton() {
return this.$store.state.gui.uiSettings.boolHideUploadAndPrintButton ?? false
}
@@ -102,6 +102,15 @@
:label="$t('Settings.WebcamsTab.Rotate')" />
</v-col>
</v-row>
<v-row v-if="hasFpsCounter">
<v-col class="pt-1 pb-3">
<v-checkbox
v-model="hideFps"
class="mt-1"
hide-details
:label="$t('Settings.WebcamsTab.HideFps')" />
</v-col>
</v-row>
<v-row>
<v-col class="pt-1 pb-3">
<div class="v-label v-label--active theme--dark text-subtitle-1">
@@ -250,6 +259,27 @@ export default class WebcamForm extends Mixins(BaseMixin, WebcamMixin) {
return classes
}
get hasFpsCounter() {
return ['mjpegstreamer', 'mjpegstreamer-adaptive'].includes(this.webcam.service)
}
get hideFps() {
return this.webcam.extra_data?.hideFps ?? false
}
set hideFps(newVal) {
if (!('extra_data' in this.webcam)) {
this.webcam.extra_data = {
hideFps: newVal,
}
return
}
// @ts-ignore
this.webcam.extra_data.hideFps = newVal
}
mounted() {
this.oldWebcamName = this.webcam.name
}
+7 -1
View File
@@ -6,7 +6,7 @@
class="webcamImage"
:style="webcamStyle"
@load="onload" />
<span v-if="showFps" class="webcamFpsOutput">{{ $t('Panels.WebcamPanel.FPS') }}: {{ fpsOutput }}</span>
<span v-if="showFpsCounter" class="webcamFpsOutput">{{ $t('Panels.WebcamPanel.FPS') }}: {{ fpsOutput }}</span>
</div>
</template>
@@ -72,6 +72,12 @@ export default class Mjpegstreamer extends Mixins(BaseMixin, WebcamMixin) {
return this.currentFPS < 10 ? '0' + this.currentFPS.toString() : this.currentFPS
}
get showFpsCounter() {
if (!this.showFps) return false
return !(this.camSettings.extra_data?.hideFps ?? false)
}
startStream() {
if (this.streamState) return
this.streamState = true
@@ -10,7 +10,7 @@
height="400"
:style="webcamStyle"
:class="'webcamImage ' + (isLoaded ? '' : 'hiddenWebcam')"></canvas>
<span v-if="isLoaded && showFps" class="webcamFpsOutput">
<span v-if="isLoaded && showFpsCounter" class="webcamFpsOutput">
{{ $t('Panels.WebcamPanel.FPS') }}: {{ fpsOutput }}
</span>
</div>
@@ -74,6 +74,12 @@ export default class MjpegstreamerAdaptive extends Mixins(BaseMixin, WebcamMixin
return this.currentFPS < 10 ? '0' + this.currentFPS.toString() : this.currentFPS
}
get showFpsCounter() {
if (!this.showFps) return false
return !(this.camSettings.extra_data?.hideFps ?? false)
}
get rotate() {
return [90, 270].includes(this.camSettings.rotation ?? 0)
}
+8
View File
@@ -680,6 +680,7 @@
"Temperature": "Aktuelle Temperatur"
},
"Headline": "Temperaturen",
"HideMcuHostSensors": "Host/MCU Sensoren ausblenden",
"Max": "max",
"Min": "min",
"Name": "Name",
@@ -794,6 +795,7 @@
"Circle": "Kreis",
"Control": "Steuerung",
"Cross": "Kreuz",
"HideDuringPrint": "Achsensteuerung während des Drucks ausblenden",
"EnableXYHoming": "Aktiviere kombiniertes X & Y homing",
"EstimatedExtrusionInfo": "Zeige Info zur geschätzten Extrusion",
"EstimatedExtrusionInfoDescription": "Anzeigen/ausblenden der Info zur geschätzten Extrusion, basierend auf Extrusionmenge und Extrusionsgeschwindigkeit",
@@ -1058,6 +1060,11 @@
"ConfirmOnEmergencyStopDescription": "Zeige vor einem Notstop einen Bestätigungsdialog.",
"ConfirmOnPowerDeviceChange": "Bestätigung für Änderung der Stromversorgung von Geräten",
"ConfirmOnPowerDeviceChangeDescription": "Zeige vor Änderung der Stromversorgung von Geräten einen Bestätigungsdialog.",
"DefaultNavigationState": "Standard Navigationszustand",
"DefaultNavigationStateAlwaysClosed": "immer geschlossen",
"DefaultNavigationStateAlwaysOpen": "immer geöffnet",
"DefaultNavigationStateDescription": "Welchen zustand soll die Navigation normalerweise haben?",
"DefaultNavigationStateLastState": "letzter Zustand",
"DisableFanAnimation": "Lüfteranimation deaktivieren",
"DisableFanAnimationDescription": "Dies kann die Last im Browser senken.",
"DisplayCANCEL_PRINT": "Zeige CANCEL_PRINT an",
@@ -1097,6 +1104,7 @@
"EditWebcam": "Webcam bearbeiten",
"FlipWebcam": "Webcam-Bild spiegeln:",
"Hlsstream": "HLS-Stream",
"HideFps": "FPS-Anzeige verstecken",
"Horizontally": "horizontal",
"IconBed": "Bett",
"IconCam": "Kamera",
+11 -1
View File
@@ -681,6 +681,7 @@
"Temperature": "current temperature"
},
"Headline": "Temperatures",
"HideMcuHostSensors": "Hide Host/MCU Sensors",
"Max": "max",
"Min": "min",
"Name": "Name",
@@ -795,6 +796,7 @@
"Circle": "Circle",
"Control": "Control",
"Cross": "Cross",
"HideDuringPrint": "Hide axis controls during print",
"EnableXYHoming": "Enable combined X & Y axes homing",
"EstimatedExtrusionInfo": "Show estimated extrusion info",
"EstimatedExtrusionInfoDescription": "Show / Hide info for estimated extrusions based on extrusion amount and feedrate",
@@ -872,6 +874,7 @@
"DbConsoleHistory": "Console History",
"DbHistoryJobs": "History Jobs",
"DbHistoryTotals": "History Totals",
"DBNavigation": "Navigation",
"DbTimelapseSettings": "Timelapse Settings",
"DbView": "View Settings",
"EstimateValues": {
@@ -888,7 +891,8 @@
"Reset": "reset",
"Restore": "Restore",
"RestoreDialog": "Please select all the sections you want to restore:",
"TimeFormat": "Time Format"
"TimeFormat": "Time Format",
"Everything": "Everything"
},
"InterfaceSettings": "Interface Settings",
"MacrosTab": {
@@ -1059,6 +1063,11 @@
"ConfirmOnEmergencyStopDescription": "Show a confirmation dialog on Emergency Stop",
"ConfirmOnPowerDeviceChange": "Require confirm on Device Power changes",
"ConfirmOnPowerDeviceChangeDescription": "Show a confirmation dialog on Device Power changes",
"DefaultNavigationState": "Navigation default state",
"DefaultNavigationStateAlwaysClosed": "always closed",
"DefaultNavigationStateAlwaysOpen": "always open",
"DefaultNavigationStateDescription": "Which state should have the navigation per default.",
"DefaultNavigationStateLastState": "last state",
"DisableFanAnimation": "Disable fan animation",
"DisableFanAnimationDescription": "This can reduce some load in your Browser.",
"DisplayCANCEL_PRINT": "Display CANCEL_PRINT",
@@ -1097,6 +1106,7 @@
"EditCrowsnestConf": "Edit crowsnest.conf",
"EditWebcam": "Edit Webcam",
"FlipWebcam": "Flip webcam image:",
"HideFps": "Hide FPS counter",
"Horizontally": "horizontally",
"IconBed": "Bed",
"IconCam": "Cam",
+2 -1
View File
@@ -829,7 +829,8 @@
"12hours": "12-heures ({time})",
"24hours": "24-heures ({time})",
"DateFormat": "Format de la date",
"TimeFormat": "Format de l'heure"
"TimeFormat": "Format de l'heure",
"Everything": "Tout"
},
"InterfaceSettings": "Réglages interface",
"MacrosTab": {
+26 -21
View File
@@ -193,7 +193,7 @@
"Name": "Nazwa",
"NewDirectory": "Nowy katalog",
"NozzleDiameter": "Średnica dyszy",
"ObjectHeight": "Wysokość objektu",
"ObjectHeight": "Wysokość obiektu",
"Preheat": "Podgrzej",
"PrintedFiles": "Wydrukowane pliki",
"PrintStart": "Start wydruku",
@@ -217,7 +217,7 @@
"AddBatchToQueue": "Dodaj serię do kolejki",
"GcodesRootDirectoryDoesntExists": "Nie znaleziono katalogu G-Code. Sprawdź opcję \"path\" w sekcji [virtual_sdcard] konfiguracji Klippera.",
"ScanMeta": "Skanuj metadane",
"BedTemp": "Temp. łóżka",
"BedTemp": "Temp. stołu",
"ChamberTemp": "Temp. komory",
"Count": "Ilość",
"DuplicateFile": "Powielony plik",
@@ -281,7 +281,7 @@
"Later": "Później",
"Mesh": "Siatka",
"Name": "Nazwa",
"NoBedMeshHasBeenLoadedYet": "Nie została jeszcze wgrana żadna siatka.",
"NoBedMeshHasBeenLoadedYet": "Nie wczytano siatki stołu.",
"NoProfile": "Brak profili",
"Ok": "Ok",
"Probed": "Zmierzone",
@@ -468,9 +468,9 @@
},
"UpdatePanel": {
"CheckForUpdates": "Sprawdź dostępność aktualizacji",
"Commits": "Wydane",
"CommitsAvailable": "Brak nowych wydań | {count} dostępnych wydań| {count} dostępnych wydań",
"CommitsOnDate": "Wydano {date}",
"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}",
@@ -490,10 +490,6 @@
"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.",
"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.",
"Notification": {
"Dirty": "Lokalne repozytorium zostało zmodyfikowane i nie można go zaktualizować w tym stanie. Przywróć to repozytorium.",
"Detached": "Stan odłączony nie jest błędem ani problemem. Oznacza jedynie, że w lokalnym repozytorium istnieją dodatkowe zmiany, które nie istnieją w zdalnym repozytorium."
},
"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.",
@@ -511,7 +507,8 @@
"MoreCommitsInfo": "Można tu wyświetlić maksymalnie 30 zmian. Aby zobaczyć wszystkie zmiany, kliknij poniższy link:",
"SoftRecovery": "Przywróć miękko",
"UpdateWarning": "Ostrzeżenie o aktualizacji: {name}",
"UpgradeableSystemPackages": "Pakiety systemowe, które można uaktualnić"
"UpgradeableSystemPackages": "Pakiety systemowe, które można uaktualnić",
"Corrupt": "uszkodzone"
}
},
"Panels": {
@@ -675,7 +672,8 @@
"Target": "Docelowa",
"TemperaturesInChart": "Temperatura [°C]",
"TempTooHigh": "Temperatura zbyt wysoka dla {name}! (max: {max})",
"TempTooLow": "Temperatura zbyt mała dla {name}! (min: {min})"
"TempTooLow": "Temperatura zbyt mała dla {name}! (min: {min})",
"HideMcuHostSensors": "Ukryj czujniki hosta/MCU"
},
"ToolheadControlPanel": {
"Absolute": "Absolutna",
@@ -799,7 +797,8 @@
"Style": "Styl",
"ValueGreaterThan": "Wartość musi być większa niż {value}",
"ZOffsetIncrements": "Wzrost offsetu osi Z (w mm)",
"ZTiltAdjust": "Dostosuj Z-Tilt {isDefault}"
"ZTiltAdjust": "Dostosuj Z-Tilt {isDefault}",
"HideDuringPrint": "Ukryj sterowanie osiami podczas drukowania"
},
"DashboardTab": {
"Dashboard": "Sterowanie",
@@ -841,8 +840,6 @@
"CalcEtaTimeDescription": "Po wybraniu kilku opcji zostanie obliczona średnia.",
"CannotReadJson": "Brak możliwości przeczytania/przeanalizowania pliku kopii zapasowej.",
"DbConsoleHistory": "Historia Konsoli",
"DbHistoryJobs": "Historia wydruków",
"DbHistoryTotals": "Historia łącznie",
"DbTimelapseSettings": "Ustawienia timelapse",
"DbView": "Ustawienia",
"EstimateValues": {
@@ -852,7 +849,7 @@
},
"FactoryDialog": "Proszę wybrać wszystkie sekcje które mają zostać zresetowane:",
"FactoryReset": "Ustawienia fabryczne",
"General": "Ogólny",
"General": "Ogólne",
"Language": "Język",
"PrinterName": "Nazwa drukarki",
"Reset": "reset",
@@ -870,7 +867,9 @@
"Slicer": "Slicer (M73)"
},
"DateFormat": "Format daty",
"MainsailSettingsMoonrakerDb": "Ustawienia Mainsail w bazie danych Moonraker"
"MainsailSettingsMoonrakerDb": "Ustawienia Mainsail w bazie danych Moonraker",
"DBNavigation": "Nawigacja",
"Everything": "Wszystko"
},
"InterfaceSettings": "Ustawienia interfejsu",
"MacrosTab": {
@@ -1027,7 +1026,7 @@
"NavigationStyleIconsAndText": "Ikony + Tekst",
"NavigationStyleIconsOnly": "Tylko ikony",
"Primary": "Podstawowe",
"UiSettings": "Ustawienia interfejsu",
"UiSettings": "Interfejs",
"DisableFanAnimation": "Wyłącz animację wentylatora",
"DisableFanAnimationDescription": "To może zmniejszyć obciążenie przeglądarki.",
"HideSaveConfigButtonForBedMeshDescription": "Ukryj przycisk \"Zapisz konfigurację\", jeśli oczekują jedynie zmiany w siatce stołu do zapisania w Klipperze.",
@@ -1043,7 +1042,12 @@
"TempchartHeightDescription": "Modyfikuj wysokość wykresu temperatury w panelu sterowania.",
"PowerDeviceName": "Urządzenie zasilające drukarkę",
"HideUpdateWarnings": "Ukryj ostrzeżenia o aktualizacji",
"HideUpdateWarningsDescription": "Ta opcja ukryje wszystkie ostrzeżenia o aktualizacjach w menedżerze aktualizacji."
"HideUpdateWarningsDescription": "Ta opcja ukryje wszystkie ostrzeżenia o aktualizacjach w menedżerze aktualizacji.",
"DefaultNavigationState": "Domyślny stan nawigacji",
"DefaultNavigationStateAlwaysClosed": "zawsze zamknięty",
"DefaultNavigationStateDescription": "Który stan powinien mieć domyślną nawigację?",
"DefaultNavigationStateAlwaysOpen": "zawsze otwarty",
"DefaultNavigationStateLastState": "ostatni stan"
},
"WebcamsTab": {
"AddWebcam": "Dodaj kamerę",
@@ -1080,7 +1084,8 @@
"JMuxerStream": "Nieskompresowany strumień h264 (jmuxer)",
"Rotate": "Obróć",
"WebrtcCameraStreamer": "WebRTC (camera-streamer)",
"WebrtcMediaMTX": "WebRTC (MediaMTX / rtsp-simple-server)"
"WebrtcMediaMTX": "WebRTC (MediaMTX / rtsp-simple-server)",
"HideFps": "Ukryj wskaźnik kl./s"
},
"MiscellaneousTab": {
"AddGroup": "dodaj grupę",
@@ -1169,7 +1174,7 @@
"Accept": "Akceptuj",
"Description": "Kliknij <b>WYREGULOWANO</b>, jeśli bieżąca śruba została wyregulowana. Kliknij <b>AKCEPTUJ</b>, aby kontynuować bez regulacji.",
"Adjusted": "wyregulowano",
"Headline": "Śruby łóżka",
"Headline": "Śruby stołu",
"ScrewAccepted": "Śruby zaakceptowane",
"ScrewIndex": "Indeks śrub",
"ScrewName": "Nazwa śruby",
+39 -43
View File
@@ -478,51 +478,48 @@
}
},
"UpdatePanel": {
"Abort": "中止",
"AreYouSure": "你确定嘛?",
"CheckForUpdates": "检查跟新",
"Abort": "放弃",
"AreYouSure": "你确定吗?",
"CheckForUpdates": "检查更新",
"Close": "关闭",
"CommitHistory": "提交历史记录",
"CommitHistory": "查看提交记录",
"Commits": "提交",
"CommitsAvailable": "没有有效纪录 | {count} 提交可用 | {count} 提交可用",
"CommitsOnDate": "提交于 {date}",
"CommittedDaysAgo": "提交于 {days} 日前",
"CommittedHoursAgo": "提交于 {hours} 小时前",
"CommittedOnDate": "提交于 {date}",
"CommittedYesterday": "昨天完成提交",
"ConfigChanges": "配置修改",
"CountPackagesCanBeUpgraded": "{count} 功能包可以跟新",
"Detached": "分离",
"Dirty": "脏",
"GenericUpdateQuestion": "再Github页面检查此项目的提交记录 (如果有效) 来查看此更新是否需要进行任何手动调整。",
"GitHubPage": "GitHub 页",
"HardRecovery": "硬恢复",
"InitUpdateManager": "更新管理器尚未初始化。 这是第一次启动系统时的正常现象。 请单击刷新按钮来初始化所有组件。",
"CommitsAvailable": "没有新的提交 | 有{count}个提交 | 有{count}个提交",
"CommitsOnDate": "提交于{date}",
"CommittedDaysAgo": "{days}天前提交",
"CommittedHoursAgo": "{hours}小时前提交",
"CommittedOnDate": "提交于{date}",
"CommittedYesterday": "昨天提交",
"Corrupt": "破坏",
"ConfigChanges": "查看变更日志",
"CountPackagesCanBeUpgraded": "有{count}个软件包可以更新",
"Detached": "独立分支",
"Dirty": "被修改",
"GenericUpdateQuestion": "检查提交历史(如果有的话)和该项目的 GitHub 页面,以查看是否需要对此更新进行手动调整。",
"GitHubPage": "GitHub页面",
"HardRecovery": "版本回退(清空修改内容)",
"InitUpdateManager": "更新管理器尚未初始化。这是在您首次启动系统时的正常现象。请点击刷新按钮来初始化所有组件。",
"Invalid": "无效",
"IUnderstandTheRisks": "我了解风险",
"LinkToGithub": "连接到 GitHub",
"KlipperUpdateQuestionFirmware": "这将更新 Klipper 主机软件。 你可能需要重新跟新MCU固件以兼容跟新后的主机。",
"KlipperUpdateQuestionConfig": "此更新还可能包含需要在 Printer.cfg 文件中修改的配置参数的更改,请参阅更改日志了解详细信息。",
"MoonrakerUpdateQuestion": "这将更新 Moonraker API。 可能需要更改 Moonraker.conf 文件才能继续使用计算机。",
"MoreCommitsInfo": "此处最多可显示 30 个提交。 要查看所有提交,请单击以下链接:",
"Notification": {
"Detached": "分离状态不是错误也不是问题。 它仅意味着本地存储库中存在远程存储库中不存在的其他提交。",
"Dirty": "本地存储库已被修改,在此状态下无法更新。 请恢复此存储库。"
},
"OSPackages": "系统包",
"SoftRecovery": "软恢复",
"StartUpdate": "开始跟新",
"IUnderstandTheRisks": "我已了解此风险",
"LinkToGithub": "链接到GitHub",
"KlipperUpdateQuestionFirmware": "此操作将更新Klipper主机软件。运行Klipper固件的打印机控制板,可能需要更新到最新编译的固件后才能使用。",
"KlipperUpdateQuestionConfig": "此更新还可能包含对配置参数的更改,这些更改需要修改printer.cfg文件,有关详细信息请参阅更改日志。",
"MoonrakerUpdateQuestion": "此操作将更新Moonraker API。可能需要更改moonraker.conf文件才能继续使用打印机。",
"MoreCommitsInfo": "这里最多可以显示30个提交。要查看所有提交,请单击以下链接:",
"OSPackages": "操作系统软件包",
"SoftRecovery": "版本回退(保留修改内容)",
"StartUpdate": "开始更新",
"System": "系统",
"ThesePackagesCanBeUpgrade": "一下系统包可以跟新:",
"ThesePackagesCanBeUpgrade": "这些系统软件包可以升级:",
"Unknown": "未知",
"Update": "跟新",
"UpdateAll": "跟新所有组件",
"UpdateManager": "跟新管理",
"UpdateWarning": "跟新警告: {name}",
"Update": "更新",
"UpdateAll": "更新全部组件",
"UpdateManager": "更新管理",
"UpdateWarning": "更新警告: {name}",
"Upgrade": "升级",
"UpgradeableSystemPackages": "可以升级的系统包",
"UpToDate": "最新",
"WebClientUpdateQuestion": "在某些情况下,更新 Web 客户端可能会发生更改,从而导致不兼容。 请参阅发行说明以获取更多信息。"
"UpgradeableSystemPackages": "可升级的系统软件包",
"UpToDate": "已是最新版本",
"WebClientUpdateQuestion": "在某些情况下,更新Web客户端可能会有导致不兼容的更改。有关详细信息,请参阅发行说明。"
}
},
"ManualProbe": {
@@ -649,7 +646,7 @@
"Accept": "接受",
"AtLayer": "所在层",
"Call": "调用",
"DescriptionPauseAtLayerActive": "此功能已激活,会在层{layer}时调用\"{call}\"。如果重复调用命令,此设置将会被覆盖。",
"DescriptionPauseAtLayerActive": "此功能已激活,会在第{layer}层时调用\"{call}\"。如果重复调用命令,此设置将会被覆盖。",
"DescriptionPauseNextLayerActive": "此功能已激活,将在下一层调用\"{call}\"。",
"Layer": "层",
"NextLayer": "下一层",
@@ -873,7 +870,6 @@
"DbHistoryTotals": "历史统计",
"DbTimelapseSettings": "延时摄影设置",
"DbView": "视图设置",
"DbWebcams": "摄像头",
"EstimateValues": {
"Filament": "耗材用量",
"File": "Gcode文件",
@@ -883,7 +879,7 @@
"FactoryReset": "恢复默认设置",
"General": "通用",
"Language": "界面语言",
"MoonrakerDb": "Moonraker数据库",
"MainsailSettingsMoonrakerDb": "在Moonraker数据库中的Mainsail设置",
"PrinterName": "打印机名称",
"Reset": "重启",
"Restore": "恢复",
@@ -1069,7 +1065,7 @@
"HideSaveConfigButtonForBedMesh": "仅bed_mesh更改时隐藏\"保存配置\"按钮",
"HideSaveConfigButtonForBedMeshDescription": "如果只有bed_mesh更改需要保存到Klipper时,隐藏\"保存配置\"按钮。",
"HideUpdateWarnings": "隐藏更新警告",
"HideUpdateWarningsDescription": "此选项将隐藏更新管理器中的所有更新警告。",
"HideUpdateWarningsDescription": "此选项将在更新管理器中隐藏所有的更新警告。",
"LockSliders": "在触摸屏设备上锁定滑动条",
"LockSlidersDelay": "滑动条锁定延迟时间",
"LockSlidersDelayDescription": "滑动条将在给定延迟时间后锁定。如果设置为0或留空,滑动条将仅在页面更改/重新加载后锁定",
+2 -10
View File
@@ -32,21 +32,13 @@ export const actions: ActionTree<GuiState, RootState> = {
}
// delete currentPath if exists
if (
'view' in payload.value &&
'gcodefiles' in payload.value.view &&
'currentPath' in payload.value.view.gcodefiles
) {
if (payload.value?.view?.gcodefiles?.currentPath) {
window.console.debug('remove currentPath from gui namespace')
await fetch(mainsailUrl + '&key=view.gcodefiles.currentPath', { method: 'DELETE' })
}
// delete currentPath if exists
if (
'view' in payload.value &&
'configfiles' in payload.value.view &&
'currentPath' in payload.value.view.configfiles
) {
if (payload.value?.view?.configfiles?.currentPath) {
window.console.debug('remove currentPath from gui namespace')
await fetch(mainsailUrl + '&key=view.configfiles.currentPath', { method: 'DELETE' })
}
+3
View File
@@ -30,6 +30,7 @@ export const getDefaultState = (): GuiState => {
control: {
style: 'bars',
actionButton: null,
hideDuringPrint: false,
enableXYHoming: false,
feedrateXY: 100,
stepsXY: [100, 10, 1],
@@ -157,6 +158,7 @@ export const getDefaultState = (): GuiState => {
boolWideNavDrawer: false,
boolHideUploadAndPrintButton: false,
navigationStyle: 'iconsAndText',
defaultNavigationStateSetting: 'alwaysOpen',
powerDeviceName: null,
hideSaveConfigForBedMash: false,
disableFanAnimation: false,
@@ -236,6 +238,7 @@ export const getDefaultState = (): GuiState => {
tempchart: {
boolTempchart: true,
hiddenDataset: [],
hideMcuHostSensors: false,
autoscale: false,
datasetSettings: {},
},
+3
View File
@@ -20,6 +20,7 @@ export interface GuiState {
console?: GuiConsoleState
control: {
style: 'bars' | 'circle' | 'cross'
hideDuringPrint: boolean
actionButton: null | 'm84' | 'qgl' | 'ztilt'
enableXYHoming: boolean
feedrateXY: number
@@ -107,6 +108,7 @@ export interface GuiState {
boolWideNavDrawer: boolean
boolHideUploadAndPrintButton: boolean
navigationStyle: 'iconsAndText' | 'iconsOnly'
defaultNavigationStateSetting: 'alwaysOpen' | 'alwaysClosed' | 'lastState'
powerDeviceName: string | null
hideSaveConfigForBedMash: boolean
disableFanAnimation: boolean
@@ -162,6 +164,7 @@ export interface GuiState {
tempchart: {
boolTempchart: boolean
hiddenDataset: string[]
hideMcuHostSensors: boolean
autoscale: boolean
datasetSettings: any
}
+3 -1
View File
@@ -25,6 +25,8 @@ export interface GuiWebcamStateWebcam {
flip_vertical: boolean
rotation: number
aspect_ratio?: string
extra_data?: {}
extra_data?: {
hideFps?: boolean
}
source?: 'config' | 'database'
}
+1
View File
@@ -5,6 +5,7 @@ import { RootState } from './types'
export const mutations: MutationTree<RootState> = {
setNaviDrawer(state, payload) {
Vue.set(state, 'naviDrawer', payload)
localStorage.setItem('naviDrawer', payload)
},
setInstancesDB(state, payload) {
+38 -1
View File
@@ -70,7 +70,29 @@ export const getters: GetterTree<PrinterTempHistoryState, RootState> = {
return getters['getAvg'](name, 'speed')
},
getSelectedLegends: (state, _, rootState) => {
getHostMcuSensors: (state, getters, rootState) => {
const settings = rootState.printer?.configfile?.settings ?? {}
const available_heaters = rootState.printer?.heaters?.available_heaters ?? []
const available_sensors = rootState.printer?.heaters?.available_sensors ?? []
return available_sensors.filter((fullName: string) => {
// stop when the current sensor is a heater
if (available_heaters.includes(fullName)) return false
// stop when the current sensor is a temperature_fan
if (fullName.startsWith('temperature_fan')) return false
// get printer settings object from the current sensor
const settingsObject = settings[fullName.toLowerCase()]
if (!settingsObject) return false
// get the sensor type of the current sensor
const sensor_type = settingsObject.sensor_type ?? ''
return ['temperature_mcu', 'temperature_host'].includes(sensor_type)
})
},
getSelectedLegends: (state, getters, rootState) => {
interface legends {
[key: string]: boolean
}
@@ -108,6 +130,21 @@ export const getters: GetterTree<PrinterTempHistoryState, RootState> = {
selected[serie.name] = !datasetTypesInPercents.includes(datasetType)
})
// hide MCU & Host sensors, if the option is set to true
const hideMcuHostSensors = rootState.gui?.view?.tempchart?.hideMcuHostSensors ?? false
if (hideMcuHostSensors) {
const mcuHostSensors = getters.getHostMcuSensors ?? []
Object.keys(selected)
.filter((seriesName) => {
const datasetName = seriesName.slice(0, seriesName.lastIndexOf('-'))
return mcuHostSensors.includes(datasetName)
})
.forEach((seriesName) => {
selected[seriesName] = false
})
}
return selected
},