feat: backup/restore/default moonraker db (#476)

* refactor: reset dbCheckboxes

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: rework moonraker db reset

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* feat: add function to create a mainsail db backup

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: fix type of dbCheckboxes

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: first restore test

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* feat: restore db from json file

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: rework gui store

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* fix: rework gui store issues

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* fix: rework gui store issues with extruder panel

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: rename gui/macrogroups to gui/macros and move back to mainsail namespace

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* fix: ignore simple hide macros settings in expert macro mode

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* fix: init load bug

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: rename gui/consolefilter to gui/console and move back to mainsail namespace and update gui/macros

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: remove old function in gui/macros

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: rework gui/presets

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: rework gui/gcodehistory

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: add all gui restart actions in gui restart action

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: rework gui/remoteprinters

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* fix: control store gets

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: rework reset moonraker db in interface settings

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: rework backup moonraker DB

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: rework restore moonraker db

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* bugfix: backup/restore moonraker db locale

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* bugfix: backup/restore moonraker db locale, add tempchart

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* fix: change tempchart settings wrong store path

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* fix: add view locale to db backup/restore and delete old locale

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* feat: use /config/.theme/default.json when reset moonraker db to fill in default values after reset

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* feat: use /config/.theme/default.json when mainsail will be loaded the first time

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* refactor: add description to backup dialog

Signed-off-by: Stefan Dej <meteyou@gmail.com>

* fix: save macrogroup update

Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Stefan Dej authored and GitHub committed 2021-12-19 17:06:43 +01:00
1 parent c4181443e6
commit 7f6e6e5bdf
74 files changed
+1301 -867

No files matched your search

+2 -2
View File
@@ -103,7 +103,7 @@ export default class TheSidebarAlt extends Mixins(BaseMixin) {
}
get navigationStyle() {
return this.$store.state.gui.dashboard.navigationStyle
return this.$store.state.gui.uiSettings.navigationStyle
}
get sidebarBackground(): string {
@@ -119,7 +119,7 @@ export default class TheSidebarAlt extends Mixins(BaseMixin) {
}
get boolNaviWebcam(): boolean {
return this.$store.state.gui.webcamSettings.boolNavi
return this.$store.state.gui.uiSettings.boolWebcamNavi
}
get moonrakerComponents(): string[] {
+1 -1
View File
@@ -167,7 +167,7 @@ export default class TheTopCornerMenu extends Mixins(BaseMixin) {
this.dialogPowerDeviceChange.device = device.device
this.dialogPowerDeviceChange.value = value
const confirmOnPowerDeviceChange = this.$store.state.gui.general.confirmOnPowerDeviceChange
const confirmOnPowerDeviceChange = this.$store.state.gui.uiSettings.confirmOnPowerDeviceChange
if (confirmOnPowerDeviceChange) {
this.dialogPowerDeviceChange.show = true
}
+3 -3
View File
@@ -198,7 +198,7 @@ export default class TheTopbar extends Mixins(BaseMixin) {
}
get boolWideNavDrawer() {
return this.$store.state.gui.dashboard.boolWideNavDrawer ?? false
return this.$store.state.gui.uiSettings.boolWideNavDrawer ?? false
}
get countPrinters() {
@@ -214,11 +214,11 @@ export default class TheTopbar extends Mixins(BaseMixin) {
}
get logoColor(): string {
return this.$store.state.gui.theme.logo
return this.$store.state.gui.uiSettings.logo
}
btnEmergencyStop() {
const confirmOnEmergencyStop = this.$store.state.gui.general.confirmOnEmergencyStop
const confirmOnEmergencyStop = this.$store.state.gui.uiSettings.confirmOnEmergencyStop
if (confirmOnEmergencyStop) {
this.showEmergencyStopDialog = true
}
+1 -1
View File
@@ -210,7 +210,7 @@ export default class TempChart extends Mixins(BaseMixin) {
}
get autoscale() {
return this.$store.state.gui.tempchart.autoscale ?? true
return this.$store.state.gui.view.tempchart.autoscale ?? true
}
get maxTemp() {
+2 -2
View File
@@ -68,7 +68,7 @@
import Component from 'vue-class-component'
import {Mixins, Prop, Watch} from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import {GuiMacrogroupsStateMacrogroupMacro} from '@/store/gui/macrogroups/types'
import {GuiMacrosStateMacrogroupMacro} from '@/store/gui/macros/types'
interface param {
type: 'int' | 'double' | 'string' | null,
@@ -85,7 +85,7 @@ export default class MacroButton extends Mixins(BaseMixin) {
private paramArray: string[] = []
private params: params = {}
@Prop({ required: true }) readonly macro!: GuiMacrogroupsStateMacrogroupMacro
@Prop({ required: true }) readonly macro!: GuiMacrosStateMacrogroupMacro
@Prop({ default: 'primary' }) readonly color!: string
get klipperMacro() {
@@ -106,11 +106,11 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
}
get lockSliders() {
return this.$store.state.gui.general.lockSlidersOnTouchDevices
return this.$store.state.gui.uiSettings.lockSlidersOnTouchDevices
}
get lockSlidersDelay() {
return this.$store.state.gui.general.lockSlidersDelay
return this.$store.state.gui.uiSettings.lockSlidersDelay
}
@Debounce(500)
+2 -2
View File
@@ -119,11 +119,11 @@ export default class ToolSlider extends Mixins(BaseMixin) {
}
get lockSliders() {
return this.$store.state.gui.general.lockSlidersOnTouchDevices
return this.$store.state.gui.uiSettings.lockSlidersOnTouchDevices
}
get lockSlidersDelay() {
return this.$store.state.gui.general.lockSlidersDelay
return this.$store.state.gui.uiSettings.lockSlidersDelay
}
get colorBar() {
+2 -2
View File
@@ -13,11 +13,11 @@ export default class ControlMixin extends Vue {
}
get feedrateXY() {
return this.$store.state.gui.dashboard?.control?.feedrateXY ?? 100
return this.$store.state.gui.control?.feedrateXY ?? 100
}
get feedrateZ() {
return this.$store.state.gui.dashboard?.control?.feedrateZ ?? 10
return this.$store.state.gui.control?.feedrateZ ?? 10
}
get existsQGL() {
+6 -6
View File
@@ -2,17 +2,17 @@ import Component from 'vue-class-component'
import BaseMixin from '@/components/mixins/base'
import {allDashboardPanels} from '@/store/variables'
import {capitalize} from '@/plugins/helpers'
import {GuiMacrogroupsStateMacrogroup} from '@/store/gui/macrogroups/types'
import {GuiMacrosStateMacrogroup} from '@/store/gui/macros/types'
@Component
export default class DashboardMixin extends BaseMixin {
get macroMode() {
return this.$store.state.gui.dashboard.macroManagement ?? 'simple'
return this.$store.state.gui.macros.mode ?? 'simple'
}
get macrogroups() {
return this.$store.getters['gui/macrogroups/getAllMacrogroups'] ?? []
return this.$store.getters['gui/macros/getAllMacrogroups'] ?? []
}
get missingPanelsMobile() {
@@ -56,7 +56,7 @@ export default class DashboardMixin extends BaseMixin {
const missingPanels: any[] = []
if (this.macroMode === 'expert') {
this.macrogroups.forEach((group: GuiMacrogroupsStateMacrogroup) => {
this.macrogroups.forEach((group: GuiMacrosStateMacrogroup) => {
allPanels.push('macrogroup_'+group.id)
})
@@ -67,7 +67,7 @@ export default class DashboardMixin extends BaseMixin {
if (!panels.find((panel) => panel.name === panelname))
missingPanels.push({
name: panelname,
visable: true
visible: true
})
})
@@ -77,7 +77,7 @@ export default class DashboardMixin extends BaseMixin {
getPanelName(name: string) {
if (name.startsWith('macrogroup_')) {
const groupId = name.split('_')[1] ?? ''
const group = this.macrogroups.find((group: GuiMacrogroupsStateMacrogroup) => group.id === groupId)
const group = this.macrogroups.find((group: GuiMacrosStateMacrogroup) => group.id === groupId)
return (group) ? group.name : 'Macrogroup'
}
+1 -1
View File
@@ -52,7 +52,7 @@ import Panel from '@/components/ui/Panel.vue'
})
export default class ControlPanel extends Mixins(BaseMixin) {
get controlStyle() {
return this.$store.state.gui.dashboard.control.style ?? 'bars'
return this.$store.state.gui.control.style ?? 'bars'
}
get existsExtruder() {
@@ -55,19 +55,19 @@ import ControlMixin from '@/components/mixins/control'
@Component
export default class ControlPanelBarsControl extends Mixins(BaseMixin, ControlMixin) {
get stepsXYsorted() {
return [...this.$store.state.gui.dashboard.control.stepsXY].sort(function(a, b) { return b-a })
return [...this.$store.state.gui.control.stepsXY].sort(function(a, b) { return b-a })
}
get stepsXYsortedReverse() {
return [...this.$store.state.gui.dashboard.control.stepsXY].sort(function(a, b) { return a-b })
return [...this.$store.state.gui.control.stepsXY].sort(function(a, b) { return a-b })
}
get stepsZsorted() {
return [...this.$store.state.gui.dashboard.control.stepsZ].sort(function(a, b) { return b-a })
return [...this.$store.state.gui.control.stepsZ].sort(function(a, b) { return b-a })
}
get stepsZsortedReverse() {
return [...this.$store.state.gui.dashboard.control.stepsZ].sort(function(a, b) { return a-b })
return [...this.$store.state.gui.control.stepsZ].sort(function(a, b) { return a-b })
}
}
</script>
@@ -344,19 +344,19 @@ import ControlMixin from '@/components/mixins/control'
@Component
export default class ControlPanelCrossControl extends Mixins(BaseMixin, ControlMixin) {
get reverseX() {
return this.$store.state.gui.dashboard.control.reverseX
return this.$store.state.gui.control.reverseX
}
get reverseY() {
return this.$store.state.gui.dashboard.control.reverseY
return this.$store.state.gui.control.reverseY
}
get reverseZ() {
return this.$store.state.gui.dashboard.control.reverseZ
return this.$store.state.gui.control.reverseZ
}
get stepsXY() {
const steps = this.$store.state.gui.dashboard?.control?.stepsCircleXY ?? []
const steps = this.$store.state.gui.control?.stepsCircleXY ?? []
return Array.from(new Set([
...(steps ?? []),
@@ -364,7 +364,7 @@ export default class ControlPanelCrossControl extends Mixins(BaseMixin, ControlM
}
get stepsZ() {
const steps = this.$store.state.gui.dashboard?.control?.stepsCircleZ ?? []
const steps = this.$store.state.gui.control?.stepsCircleZ ?? []
return Array.from(new Set([
...(steps ?? []),
@@ -177,27 +177,27 @@ export default class ControlPanelCrossControl extends Mixins(BaseMixin, ControlM
private homeCols = 6
get selectedCrossStep() {
return this.$store.state.gui.dashboard.control.selectedCrossStep
return this.$store.state.gui.control.selectedCrossStep
}
set selectedCrossStep(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.control.selectedCrossStep', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'control.selectedCrossStep', value: newVal })
}
get reverseX() {
return this.$store.state.gui.dashboard.control.reverseX
return this.$store.state.gui.control.reverseX
}
get reverseY() {
return this.$store.state.gui.dashboard.control.reverseY
return this.$store.state.gui.control.reverseY
}
get reverseZ() {
return this.$store.state.gui.dashboard.control.reverseZ
return this.$store.state.gui.control.reverseZ
}
get stepsAll() {
return this.$store.state.gui.dashboard?.control?.stepsAll ?? []
return this.$store.state.gui.control?.stepsAll ?? []
}
get stepsReversed() {
@@ -85,11 +85,11 @@ export default class ControlPanelExtruder extends Mixins(BaseMixin) {
}
get feedamounts() {
return this.$store.state.gui.dashboard?.extruder?.feedamounts ?? []
return this.$store.state.gui.control.extruder?.feedamounts ?? []
}
get feedrates() {
return this.$store.state.gui.dashboard?.extruder?.feedrates ?? []
return this.$store.state.gui.control.extruder?.feedrates ?? []
}
get feedamountsSorted() {
@@ -101,19 +101,19 @@ export default class ControlPanelExtruder extends Mixins(BaseMixin) {
}
get currentFeedAmount() {
return parseFloat(this.$store.state.gui.dashboard.extruder.feedamount)
return parseFloat(this.$store.state.gui.control.extruder.feedamount)
}
set currentFeedAmount(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.extruder.feedamount', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'control.extruder.feedamount', value: newVal })
}
get currentFeedRate() {
return parseFloat(this.$store.state.gui.dashboard.extruder.feedrate)
return parseFloat(this.$store.state.gui.control.extruder.feedrate)
}
set currentFeedRate(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.extruder.feedrate', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'control.extruder.feedrate', value: newVal })
}
get boolExtrudePossible() {
+12 -12
View File
@@ -628,55 +628,55 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
}
get hideMetadataColums() {
return this.$store.state.gui.gcodefiles.hideMetadataColums
return this.$store.state.gui.view.gcodefiles.hideMetadataColums
}
set hideMetadataColums(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'gcodefiles.hideMetadataColums', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.gcodefiles.hideMetadataColums', value: newVal })
}
get showHiddenFiles() {
return this.$store.state.gui.gcodefiles.showHiddenFiles
return this.$store.state.gui.view.gcodefiles.showHiddenFiles
}
set showHiddenFiles(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'gcodefiles.showHiddenFiles', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.gcodefiles.showHiddenFiles', value: newVal })
}
get showPrintedFiles() {
return this.$store.state.gui.gcodefiles.showPrintedFiles
return this.$store.state.gui.view.gcodefiles.showPrintedFiles
}
set showPrintedFiles(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'gcodefiles.showPrintedFiles', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.gcodefiles.showPrintedFiles', value: newVal })
}
get sortBy() {
return this.$store.state.gui.gcodefiles.sortBy
return this.$store.state.gui.view.gcodefiles.sortBy
}
set sortBy(newVal) {
if (newVal === undefined) newVal = 'modified'
this.$store.dispatch('gui/saveSetting', { name: 'gcodefiles.sortBy', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.gcodefiles.sortBy', value: newVal })
}
get sortDesc() {
return this.$store.state.gui.gcodefiles.sortDesc
return this.$store.state.gui.view.gcodefiles.sortDesc
}
set sortDesc(newVal) {
if (newVal === undefined) newVal = false
this.$store.dispatch('gui/saveSetting', { name: 'gcodefiles.sortDesc', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.gcodefiles.sortDesc', value: newVal })
}
get countPerPage() {
return this.$store.state.gui.gcodefiles.countPerPage
return this.$store.state.gui.view.gcodefiles.countPerPage
}
set countPerPage(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'gcodefiles.countPerPage', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.gcodefiles.countPerPage', value: newVal })
}
get timelapseEnabled() {
+4 -4
View File
@@ -473,19 +473,19 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
}
get countPerPage() {
return this.$store.state.gui.history.countPerPage
return this.$store.state.gui.view.historycountPerPage
}
set countPerPage(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'history.countPerPage', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.history.countPerPage', value: newVal })
}
get hideColums() {
return this.$store.state.gui.history.hideColums
return this.$store.state.gui.view.history.hideColums
}
set hideColums(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'history.hideColums', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.history.hideColums', value: newVal })
}
refreshHistory() {
@@ -89,11 +89,11 @@ export default class HistoryStatisticsPanel extends Mixins(BaseMixin) {
}
get toggleChart () {
return this.$store.state.gui.history.toggleChartCol3
return this.$store.state.gui.view.history.toggleChartCol3
}
set toggleChart(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'history.toggleChartCol3', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.history.toggleChartCol3', value: newVal })
}
formatPrintTime(totalSeconds: number) {
+2 -2
View File
@@ -137,11 +137,11 @@ export default class JobqueuePanel extends Mixins(BaseMixin) {
}
get countPerPage() {
return this.$store.state.gui.jobqueue.countPerPage
return this.$store.state.gui.view.jobqueue.countPerPage
}
set countPerPage(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'jobqueue.countPerPage', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.jobqueue.countPerPage', value: newVal })
}
refreshHistory() {
@@ -532,47 +532,47 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
}
get countPerPage() {
return this.$store.state.gui.settings.configfiles.countPerPage
return this.$store.state.gui.view.configfiles.countPerPage
}
set countPerPage(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'settings.configfiles.countPerPage', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.configfiles.countPerPage', value: newVal })
}
get showHiddenFiles() {
return this.$store.state.gui.settings.configfiles.showHiddenFiles
return this.$store.state.gui.view.configfiles.showHiddenFiles
}
set showHiddenFiles(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'settings.configfiles.showHiddenFiles', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.configfiles.showHiddenFiles', value: newVal })
}
get hideBackupFiles() {
return this.$store.state.gui.settings.configfiles.hideBackupFiles
return this.$store.state.gui.view.configfiles.hideBackupFiles
}
set hideBackupFiles(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'settings.configfiles.hideBackupFiles', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.configfiles.hideBackupFiles', value: newVal })
}
get sortBy() {
return this.$store.state.gui.settings.configfiles.sortBy
return this.$store.state.gui.view.configfiles.sortBy
}
set sortBy(newVal) {
if (newVal === undefined) newVal = 'filename'
this.$store.dispatch('gui/saveSetting', { name: 'settings.configfiles.sortBy', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.configfiles.sortBy', value: newVal })
}
get sortDesc() {
return this.$store.state.gui.settings.configfiles.sortDesc
return this.$store.state.gui.view.configfiles.sortDesc
}
set sortDesc(newVal) {
if (newVal === undefined) newVal = false
this.$store.dispatch('gui/saveSetting', { name: 'settings.configfiles.sortDesc', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.configfiles.sortDesc', value: newVal })
}
get registeredDirectories() {
+6 -6
View File
@@ -31,7 +31,7 @@ import BaseMixin from '../mixins/base'
import Panel from '@/components/ui/Panel.vue'
import MacroButton from '@/components/inputs/MacroButton.vue'
import {PrinterStateMacro} from '@/store/printer/types'
import {GuiMacrogroupsStateMacrogroupMacro} from '@/store/gui/macrogroups/types'
import {GuiMacrosStateMacrogroupMacro} from '@/store/gui/macros/types'
@Component({
components: {MacroButton, Panel}
})
@@ -40,17 +40,17 @@ export default class MacrogroupPanel extends Mixins(BaseMixin) {
@Prop({ required: true }) panelId!: string
get macrogroup() {
return this.$store.getters['gui/macrogroups/getMacrogroup'](this.panelId)
return this.$store.getters['gui/macros/getMacrogroup'](this.panelId)
}
get allMacros() {
return this.$store.getters['printer/getMacros'] ?? []
return this.$store.getters['printer/getAllMacros'] ?? []
}
get macros() {
let macros = this.macrogroup?.macros ?? []
macros = macros.filter((macro: GuiMacrogroupsStateMacrogroupMacro) => {
macros = macros.filter((macro: GuiMacrosStateMacrogroupMacro) => {
if (!this.allMacros.find((existMacro: PrinterStateMacro) => existMacro.name.toLowerCase() === macro.name.toLowerCase())) return false
return (
@@ -60,7 +60,7 @@ export default class MacrogroupPanel extends Mixins(BaseMixin) {
)
})
return macros.sort((a: GuiMacrogroupsStateMacrogroupMacro, b: GuiMacrogroupsStateMacrogroupMacro) => a.pos - b.pos)
return macros.sort((a: GuiMacrosStateMacrogroupMacro, b: GuiMacrosStateMacrogroupMacro) => a.pos - b.pos)
}
get macrogroupStatus() {
@@ -71,7 +71,7 @@ export default class MacrogroupPanel extends Mixins(BaseMixin) {
)
}
getColor(macro: GuiMacrogroupsStateMacrogroupMacro) {
getColor(macro: GuiMacrosStateMacrogroupMacro) {
if (macro.color === 'group') {
if (this.macrogroup.color === 'custom') return this.macrogroup.colorCustom
else return this.macrogroup.color
+1 -1
View File
@@ -162,7 +162,7 @@ export default class MiniconsolePanel extends Mixins(BaseMixin) {
}
get lastCommands(): string[] {
return this.$store.state.gui.gcodehistory.history ?? []
return this.$store.state.gui.gcodehistory.entries ?? []
}
commandClick(msg: string): void {
+2 -2
View File
@@ -388,7 +388,7 @@ export default class StatusPanel extends Mixins(BaseMixin) {
color: 'error',
icon: 'mdi-stop',
loadingName: 'statusPrintCancel',
status: this.$store.state.gui.general.displayCancelPrint ? ['paused', 'printing'] : ['paused'],
status: this.$store.state.gui.uiSettings.displayCancelPrint ? ['paused', 'printing'] : ['paused'],
click: this.btnCancelJob
}, {
text: this.$t('Panels.StatusPanel.ClearPrintStats'),
@@ -573,7 +573,7 @@ export default class StatusPanel extends Mixins(BaseMixin) {
}
get boolBigThumbnail() {
const setting = this.$store.state.gui.dashboard.boolBigThumbnail ?? true
const setting = this.$store.state.gui.uiSettings.boolBigThumbnail ?? true
return this.current_filename && setting && this.thumbnailBig
}
@@ -370,31 +370,31 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
}
get sortBy() {
return this.$store.state.gui.timelapse.sortBy ?? 'modified'
return this.$store.state.gui.view.gcodefiles.sortBy ?? 'modified'
}
set sortBy(newVal) {
if (newVal === undefined) newVal = 'modified'
this.$store.dispatch('gui/saveSetting', { name: 'timelapse.sortBy', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.timelapse.sortBy', value: newVal })
}
get sortDesc() {
return this.$store.state.gui.timelapse.sortDesc ?? true
return this.$store.state.gui.view.gcodefiles.sortDesc ?? true
}
set sortDesc(newVal) {
if (newVal === undefined) newVal = false
this.$store.dispatch('gui/saveSetting', { name: 'timelapse.sortDesc', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.timelapse.sortDesc', value: newVal })
}
get countPerPage() {
return this.$store.state.gui.timelapse?.countPerPage ?? 10
return this.$store.state.gui.view.gcodefiles?.countPerPage ?? 10
}
set countPerPage(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'timelapse.countPerPage', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.timelapse.countPerPage', value: newVal })
}
get displayFiles() {
+7 -7
View File
@@ -303,19 +303,19 @@ export default class ToolsPanel extends Mixins(BaseMixin) {
}
get boolTempchart(): boolean {
return this.$store.state.gui.dashboard?.boolTempchart ?? false
return this.$store.state.gui.view.tempchart.boolTempchart ?? false
}
set boolTempchart(newVal: boolean) {
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.boolTempchart', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.tempchart.boolTempchart', value: newVal })
}
get autoscaleTempchart(): boolean {
return this.$store.state.gui.tempchart.autoscale ?? false
return this.$store.state.gui.view.tempchart.autoscale ?? false
}
set autoscaleTempchart(newVal: boolean) {
this.$store.dispatch('gui/saveSetting', { name: 'tempchart.autoscale', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'view.tempchart.autoscale', value: newVal })
}
get heaters(): PrinterStateHeater[] {
@@ -377,12 +377,12 @@ export default class ToolsPanel extends Mixins(BaseMixin) {
const serieName = 'bool'+type.charAt(0).toUpperCase() + type.slice(1)
const value = this.editHeater[serieName]
const name = 'tempchart.datasetSettings.'+this.editHeater.name+'.'+type
const name = 'view.tempchart.datasetSettings.'+this.editHeater.name+'.'+type
this.$store.dispatch('gui/saveSetting', { name, value })
}
setVisibleAdditionalSensor(sensor: string): void {
const name = 'tempchart.datasetSettings.'+this.editHeater.name+'.additionalSensors.'+sensor
const name = 'view.tempchart.datasetSettings.'+this.editHeater.name+'.additionalSensors.'+sensor
this.$store.dispatch('gui/saveSetting', { name, value: this.editHeater.additionSensors[sensor].bool })
}
@@ -391,7 +391,7 @@ export default class ToolsPanel extends Mixins(BaseMixin) {
if (typeof value === 'object' && 'hex' in value) value = value.hex
this.$store.commit('printer/tempHistory/setColor', { name: this.editHeater.name, value: value })
const name = 'tempchart.datasetSettings.'+this.editHeater.name+'.color'
const name = 'view.tempchart.datasetSettings.'+this.editHeater.name+'.color'
this.$store.dispatch('gui/saveSetting', { name, value })
}
+1 -1
View File
@@ -104,7 +104,7 @@ export default class ZoffsetPanel extends Mixins(BaseMixin) {
}
get displayZOffsetStandby() {
return this.$store.state.gui.general.displayZOffsetStandby ?? false
return this.$store.state.gui.uiSettings.displayZOffsetStandby ?? false
}
get homing_origin() {
+11 -11
View File
@@ -120,7 +120,7 @@ export default class SettingsConsoleTab extends Mixins(BaseMixin) {
}
get consoleFilters() {
return this.$store.getters['gui/consolefilters/getConsolefilters'] ?? []
return this.$store.getters['gui/console/getConsolefilters'] ?? []
}
get availableDirections() {
@@ -140,7 +140,7 @@ export default class SettingsConsoleTab extends Mixins(BaseMixin) {
}
set consoleDirection(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'console.direction', value: newVal })
this.$store.dispatch('gui/console/saveSetting', { name: 'direction', value: newVal })
}
get availableEntryStyles() {
@@ -160,7 +160,7 @@ export default class SettingsConsoleTab extends Mixins(BaseMixin) {
}
set entryStyle(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'console.entryStyle', value: newVal })
this.$store.dispatch('gui/console/saveSetting', { name: 'entryStyle', value: newVal })
}
get consoleHeight() {
@@ -168,7 +168,7 @@ export default class SettingsConsoleTab extends Mixins(BaseMixin) {
}
set consoleHeight(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'console.height', value: newVal })
this.$store.dispatch('gui/console/saveSetting', { name: 'height', value: newVal })
}
@Watch('consoleHeight')
@@ -186,15 +186,15 @@ export default class SettingsConsoleTab extends Mixins(BaseMixin) {
}
set hideWaitTemperatures(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'console.hideWaitTemperatures', value: newVal })
this.$store.dispatch('gui/console/saveSetting', { name: 'hideWaitTemperatures', value: newVal })
}
get hideTimelapse() {
return this.$store.state.gui.console.hideTimelapse
return this.$store.state.gui.console.hideTlCommands
}
set hideTimelapse(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'console.hideTimelapse', value: newVal })
this.$store.dispatch('gui/console/saveSetting', { name: 'hideTlCommands', value: newVal })
}
existsPresetName(name: string) {
@@ -215,7 +215,7 @@ export default class SettingsConsoleTab extends Mixins(BaseMixin) {
regex: filter.regex
}
this.$store.dispatch('gui/consolefilters/update', { id: filter.id, values })
this.$store.dispatch('gui/console/filterUpdate', { id: filter.id, values })
}
createFilter() {
@@ -240,16 +240,16 @@ export default class SettingsConsoleTab extends Mixins(BaseMixin) {
}
if (this.form.id)
this.$store.dispatch('gui/consolefilters/update', { id: this.form.id, values: filter })
this.$store.dispatch('gui/console/filterUpdate', { id: this.form.id, values: filter })
else
this.$store.dispatch('gui/consolefilters/store', { values: filter })
this.$store.dispatch('gui/console/filterStore', { values: filter })
this.clearForm()
}
}
deleteFilter(id: string) {
this.$store.dispatch('gui/consolefilters/delete', id)
this.$store.dispatch('gui/console/filterDelete', id)
}
}
</script>
+26 -26
View File
@@ -236,55 +236,55 @@ export default class SettingsControlTab extends Mixins(BaseMixin) {
}
get controlStyle() {
return this.$store.state.gui.dashboard.control.style ?? 'bar'
return this.$store.state.gui.control.style ?? 'bar'
}
set controlStyle(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.control.style', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'control.style', value: newVal })
}
get reverseX() {
return this.$store.state.gui.dashboard.control.reverseX
return this.$store.state.gui.control.reverseX
}
set reverseX(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.control.reverseX', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'control.reverseX', value: newVal })
}
get reverseY() {
return this.$store.state.gui.dashboard.control.reverseY
return this.$store.state.gui.control.reverseY
}
set reverseY(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.control.reverseY', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'control.reverseY', value: newVal })
}
get reverseZ() {
return this.$store.state.gui.dashboard.control.reverseZ
return this.$store.state.gui.control.reverseZ
}
set reverseZ(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.control.reverseZ', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'control.reverseZ', value: newVal })
}
get feedrateXY() {
return this.$store.state.gui.dashboard.control.feedrateXY
return this.$store.state.gui.control.feedrateXY
}
set feedrateXY(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.control.feedrateXY', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'control.feedrateXY', value: newVal })
}
get feedrateZ() {
return this.$store.state.gui.dashboard.control.feedrateZ
return this.$store.state.gui.control.feedrateZ
}
set feedrateZ(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.control.feedrateZ', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'control.feedrateZ', value: newVal })
}
get stepsAll() {
const steps = this.$store.state.gui.dashboard.control.stepsAll
const steps = this.$store.state.gui.control.stepsAll
return (steps ?? []).sort(function (a: number,b: number) { return b-a })
}
@@ -292,11 +292,11 @@ export default class SettingsControlTab extends Mixins(BaseMixin) {
const absSteps = []
for(const value of newVal) absSteps.push(Math.abs(value))
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.control.stepsAll', value: absSteps })
this.$store.dispatch('gui/saveSetting', { name: 'control.stepsAll', value: absSteps })
}
get stepsXY() {
const steps = this.$store.state.gui.dashboard.control.stepsXY
const steps = this.$store.state.gui.control.stepsXY
return steps.sort(function (a: number,b: number) { return b-a })
}
@@ -304,11 +304,11 @@ export default class SettingsControlTab extends Mixins(BaseMixin) {
const absSteps = []
for(const value of steps) absSteps.push(Math.abs(value))
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.control.stepsXY', value: absSteps })
this.$store.dispatch('gui/saveSetting', { name: 'control.stepsXY', value: absSteps })
}
get stepsZ() {
const steps = this.$store.state.gui.dashboard.control.stepsZ
const steps = this.$store.state.gui.control.stepsZ
return steps.sort(function (a: number,b: number) { return b-a })
}
@@ -316,11 +316,11 @@ export default class SettingsControlTab extends Mixins(BaseMixin) {
const absSteps = []
for(const value of steps) absSteps.push(Math.abs(value))
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.control.stepsZ', value: absSteps })
this.$store.dispatch('gui/saveSetting', { name: 'control.stepsZ', value: absSteps })
}
get stepsCircleXY() {
const steps = this.$store.state.gui.dashboard.control.stepsCircleXY
const steps = this.$store.state.gui.control.stepsCircleXY
return steps.sort(function (a: number,b: number) { return b-a })
}
@@ -328,11 +328,11 @@ export default class SettingsControlTab extends Mixins(BaseMixin) {
const absSteps = []
for(const value of steps) absSteps.push(Math.abs(value))
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.control.stepsCircleXY', value: absSteps })
this.$store.dispatch('gui/saveSetting', { name: 'control.stepsCircleXY', value: absSteps })
}
get stepsCircleZ() {
const steps = this.$store.state.gui.dashboard.control.stepsCircleZ
const steps = this.$store.state.gui.control.stepsCircleZ
return steps.sort(function (a: number,b: number) { return b-a })
}
@@ -340,11 +340,11 @@ export default class SettingsControlTab extends Mixins(BaseMixin) {
const absSteps = []
for(const value of steps) absSteps.push(Math.abs(value))
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.control.stepsCircleZ', value: absSteps })
this.$store.dispatch('gui/saveSetting', { name: 'control.stepsCircleZ', value: absSteps })
}
get feedamountsE() {
const steps = this.$store.state.gui.dashboard.extruder.feedamounts
const steps = this.$store.state.gui.control.extruder.feedamounts
return steps.sort(function (a: number,b: number) { return b-a })
}
@@ -352,11 +352,11 @@ export default class SettingsControlTab extends Mixins(BaseMixin) {
const absAmounts = []
for(const value of amounts) absAmounts.push(Math.abs(value))
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.extruder.feedamounts', value: absAmounts })
this.$store.dispatch('gui/saveSetting', { name: 'control.extruder.feedamounts', value: absAmounts })
}
get feedratesE() {
const steps = this.$store.state.gui.dashboard.extruder.feedrates
const steps = this.$store.state.gui.control.extruder.feedrates
return steps.sort(function (a: number,b: number) { return b-a })
}
@@ -364,7 +364,7 @@ export default class SettingsControlTab extends Mixins(BaseMixin) {
const absRates = []
for(const value of rates) absRates.push(Math.abs(value))
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.extruder.feedrates', value: absRates })
this.$store.dispatch('gui/saveSetting', { name: 'control.extruder.feedrates', value: absRates })
}
blurFeedrateXY() {
@@ -37,7 +37,7 @@
{{ getPanelName(element.name) }}
</v-col>
<v-col class="col-auto pl-0">
<v-icon v-if="!element.visable" color="grey lighten-1" @click.stop="changeState1(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-if="!element.visible" color="grey lighten-1" @click.stop="changeState1(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-else color="primary" @click.stop="changeState1(element.name,false)">mdi-checkbox-marked</v-icon>
</v-col>
</v-row>
@@ -62,7 +62,7 @@
{{ getPanelName(element.name) }}
</v-col>
<v-col class="col-auto pl-0">
<v-icon v-if="!element.visable" color="grey lighten-1" @click.stop="changeState2(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-if="!element.visible" color="grey lighten-1" @click.stop="changeState2(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-else color="primary" @click.stop="changeState2(element.name,false)">mdi-checkbox-marked</v-icon>
</v-col>
</v-row>
@@ -124,7 +124,7 @@ export default class SettingsDashboardTabDesktop extends Mixins(DashboardMixin)
changeState1(name: string, newVal: boolean) {
const index = this.desktopLayout1.findIndex((element: any) => element.name === name)
if (index !== -1) {
this.desktopLayout1[index].visable = newVal
this.desktopLayout1[index].visible = newVal
this.$store.dispatch('gui/saveSetting', {name: 'dashboard.desktopLayout1', value: this.desktopLayout1 })
}
}
@@ -132,7 +132,7 @@ export default class SettingsDashboardTabDesktop extends Mixins(DashboardMixin)
changeState2(name: string, newVal: boolean) {
const index = this.desktopLayout2.findIndex((element: any) => element.name === name)
if (index !== -1) {
this.desktopLayout2[index].visable = newVal
this.desktopLayout2[index].visible = newVal
this.$store.dispatch('gui/saveSetting', {name: 'dashboard.desktopLayout2', value: this.desktopLayout2 })
}
}
@@ -37,7 +37,7 @@
{{ getPanelName(element.name) }}
</v-col>
<v-col class="col-auto pl-0">
<v-icon v-if="!element.visable" color="grey lighten-1" @click.stop="changeState(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-if="!element.visible" color="grey lighten-1" @click.stop="changeState(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-else color="primary" @click.stop="changeState(element.name,false)">mdi-checkbox-marked</v-icon>
</v-col>
</v-row>
@@ -89,7 +89,7 @@ export default class SettingsDashboardTabMobile extends Mixins(DashboardMixin) {
changeState(name: string, newVal: boolean) {
const index = this.mobileLayout.findIndex((element: any) => element.name === name)
if (index !== -1) {
this.mobileLayout[index].visable = newVal
this.mobileLayout[index].visible = newVal
this.$store.dispatch('gui/saveSetting', {name: 'dashboard.mobileLayout', value: this.mobileLayout })
}
}
@@ -37,7 +37,7 @@
{{ getPanelName(element.name) }}
</v-col>
<v-col class="col-auto pl-0">
<v-icon v-if="!element.visable" color="grey lighten-1" @click.stop="changeState1(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-if="!element.visible" color="grey lighten-1" @click.stop="changeState1(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-else color="primary" @click.stop="changeState1(element.name,false)">mdi-checkbox-marked</v-icon>
</v-col>
</v-row>
@@ -62,7 +62,7 @@
{{ getPanelName(element.name) }}
</v-col>
<v-col class="col-auto pl-0">
<v-icon v-if="!element.visable" color="grey lighten-1" @click.stop="changeState2(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-if="!element.visible" color="grey lighten-1" @click.stop="changeState2(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-else color="primary" @click.stop="changeState2(element.name,false)">mdi-checkbox-marked</v-icon>
</v-col>
</v-row>
@@ -124,7 +124,7 @@ export default class SettingsDashboardTabTablet extends Mixins(DashboardMixin) {
changeState1(name: string, newVal: boolean) {
const index = this.tabletLayout1.findIndex((element: any) => element.name === name)
if (index !== -1) {
this.tabletLayout1[index].visable = newVal
this.tabletLayout1[index].visible = newVal
this.$store.dispatch('gui/saveSetting', {name: 'dashboard.tabletLayout1', value: this.tabletLayout1 })
}
}
@@ -132,7 +132,7 @@ export default class SettingsDashboardTabTablet extends Mixins(DashboardMixin) {
changeState2(name: string, newVal: boolean) {
const index = this.tabletLayout2.findIndex((element: any) => element.name === name)
if (index !== -1) {
this.tabletLayout2[index].visable = newVal
this.tabletLayout2[index].visible = newVal
this.$store.dispatch('gui/saveSetting', {name: 'dashboard.tabletLayout2', value: this.tabletLayout2 })
}
}
@@ -37,7 +37,7 @@
{{ getPanelName(element.name) }}
</v-col>
<v-col class="col-auto pl-0">
<v-icon v-if="!element.visable" color="grey lighten-1" @click.stop="changeState1(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-if="!element.visible" color="grey lighten-1" @click.stop="changeState1(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-else color="primary" @click.stop="changeState1(element.name,false)">mdi-checkbox-marked</v-icon>
</v-col>
</v-row>
@@ -62,7 +62,7 @@
{{ getPanelName(element.name) }}
</v-col>
<v-col class="col-auto pl-0">
<v-icon v-if="!element.visable" color="grey lighten-1" @click.stop="changeState2(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-if="!element.visible" color="grey lighten-1" @click.stop="changeState2(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-else color="primary" @click.stop="changeState2(element.name,false)">mdi-checkbox-marked</v-icon>
</v-col>
</v-row>
@@ -87,7 +87,7 @@
{{ getPanelName(element.name) }}
</v-col>
<v-col class="col-auto pl-0">
<v-icon v-if="!element.visable" color="grey lighten-1" @click.stop="changeState3(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-if="!element.visible" color="grey lighten-1" @click.stop="changeState3(element.name,true)">mdi-checkbox-blank-outline</v-icon>
<v-icon v-else color="primary" @click.stop="changeState3(element.name,false)">mdi-checkbox-marked</v-icon>
</v-col>
</v-row>
@@ -159,7 +159,7 @@ export default class SettingsDashboardTabWidescreen extends Mixins(DashboardMixi
changeState1(name: string, newVal: boolean) {
const index = this.widescreenLayout1.findIndex((element: any) => element.name === name)
if (index !== -1) {
this.widescreenLayout1[index].visable = newVal
this.widescreenLayout1[index].visible = newVal
this.$store.dispatch('gui/saveSetting', {name: 'dashboard.widescreenLayout1', value: this.widescreenLayout1 })
}
}
@@ -167,7 +167,7 @@ export default class SettingsDashboardTabWidescreen extends Mixins(DashboardMixi
changeState2(name: string, newVal: boolean) {
const index = this.widescreenLayout2.findIndex((element: any) => element.name === name)
if (index !== -1) {
this.widescreenLayout2[index].visable = newVal
this.widescreenLayout2[index].visible = newVal
this.$store.dispatch('gui/saveSetting', {name: 'dashboard.widescreenLayout2', value: this.widescreenLayout2 })
}
}
@@ -175,7 +175,7 @@ export default class SettingsDashboardTabWidescreen extends Mixins(DashboardMixi
changeState3(name: string, newVal: boolean) {
const index = this.widescreenLayout3.findIndex((element: any) => element.name === name)
if (index !== -1) {
this.widescreenLayout3[index].visable = newVal
this.widescreenLayout3[index].visible = newVal
this.$store.dispatch('gui/saveSetting', {name: 'dashboard.widescreenLayout3', value: this.widescreenLayout3 })
}
}
+322 -63
View File
@@ -18,13 +18,71 @@
<v-select v-model="calcEtaTime" :items="calcEtaTimeItems" multiple hide-details dense outlined attach></v-select>
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.GeneralTab.MoonrakerDb')" :dynamicSlotWidth="true">
<input type="file" :accept="['.json']" ref="uploadBackupFile" class="d-none" @change="uploadRestore" />
<v-btn @click="backupDb" :loading="loadings.includes('backupDbButton')" small>{{ $t('Settings.GeneralTab.Backup') }}</v-btn>
<v-btn @click="restoreDb" small :loading="loadings.includes('restoreUploadButton')" class="ml-3">{{ $t('Settings.GeneralTab.Restore') }}</v-btn>
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.GeneralTab.FactoryReset')" :dynamicSlotWidth="true">
<v-btn @click="dialogResetMainsail=true" color="error" small>{{ $t('Settings.GeneralTab.FactoryReset') }}</v-btn>
<v-btn @click="resetMainsail" color="error" small>{{ $t('Settings.GeneralTab.FactoryReset') }}</v-btn>
</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="mdi-help-circle">
<template v-slot:buttons>
<v-btn icon tile @click="dialogBackupMainsail = false"><v-icon>mdi-close-thick</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
:label="db.label"
hide-details
class="mt-0"
:key="db.name"
@change="changeNamespace(db.name)"
></v-checkbox>
</template>
<v-checkbox
:label="$t('Settings.GeneralTab.DbTimelapseSettings')"
v-if="availableNamespaces.includes('timelapse')"
hide-details
class="mt-0"
@change="changeNamespace('timelapse')"
></v-checkbox>
<v-checkbox
:label="$t('Settings.GeneralTab.DbWebcams')"
v-if="availableNamespaces.includes('webcams')"
hide-details
class="mt-0"
@change="changeNamespace('webcams')"
></v-checkbox>
</v-col>
</v-row>
<v-row>
<v-col class="text-center">
<v-btn
color="red"
@click="backupMainsail"
:loading="loadings.includes('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="ractory-reset-dialog" :margin-bottom="false" icon="mdi-help-circle">
<panel :title="$t('Settings.GeneralTab.FactoryReset')" card-class="factory-reset-dialog" :margin-bottom="false" icon="mdi-help-circle">
<template v-slot:buttons>
<v-btn icon tile @click="dialogResetMainsail = false"><v-icon>mdi-close-thick</v-icon></v-btn>
</template>
@@ -36,68 +94,42 @@
</v-row>
<v-row>
<v-col class="pl-6">
<template v-for="db in mainsailKeys">
<v-checkbox
:label="db.label"
hide-details
class="mt-0"
:key="db.name"
@change="changeNamespace(db.name)"
></v-checkbox>
</template>
<v-checkbox
v-model="dbCheckboxes.mainsail"
:label="$t('Settings.GeneralTab.DbGeneral')"
v-if="moonrakerDbNamespaces.includes('mainsail')"
hide-details
class="mt-0"
></v-checkbox>
<v-checkbox
v-model="dbCheckboxes.mainsail_presets"
:label="$t('Settings.GeneralTab.DbPresets')"
v-if="moonrakerDbNamespaces.includes('mainsail_presets')"
hide-details
class="mt-0"
></v-checkbox>
<v-checkbox
v-model="dbCheckboxes.mainsail_gcodehistory"
:label="$t('Settings.GeneralTab.DbGcodehistry')"
v-if="moonrakerDbNamespaces.includes('mainsail_gcodehistory')"
hide-details
class="mt-0"
></v-checkbox>
<v-checkbox
v-model="dbCheckboxes.mainsail_macrogroups"
:label="$t('Settings.GeneralTab.DbMacrogroups')"
v-if="moonrakerDbNamespaces.includes('mainsail_macrogroups')"
hide-details
class="mt-0"
></v-checkbox>
<v-checkbox
v-model="dbCheckboxes.mainsail_remoteprinters"
:label="$t('Settings.GeneralTab.DbRemoteprinters')"
v-if="moonrakerDbNamespaces.includes('mainsail_remoteprinters')"
hide-details
class="mt-0"
></v-checkbox>
<v-checkbox
v-model="dbCheckboxes.webcams"
:label="$t('Settings.GeneralTab.DbWebcams')"
v-if="moonrakerDbNamespaces.includes('webcams')"
hide-details
class="mt-0"
></v-checkbox>
<v-checkbox
v-model="dbCheckboxes.timelapse"
:label="$t('Settings.GeneralTab.DbTimelapseSettings')"
v-if="moonrakerDbNamespaces.includes('timelapse')"
v-if="availableNamespaces.includes('timelapse')"
hide-details
class="mt-0"
@change="changeNamespace('timelapse')"
></v-checkbox>
<v-checkbox
:label="$t('Settings.GeneralTab.DbWebcams')"
v-if="availableNamespaces.includes('webcams')"
hide-details
class="mt-0"
@change="changeNamespace('webcams')"
></v-checkbox>
<v-checkbox
v-model="dbCheckboxes.history_jobs"
:label="$t('Settings.GeneralTab.DbHistoryJobs')"
v-if="moonrakerComponents.includes('history')"
hide-details
class="mt-0"
@change="changeNamespace('history_jobs')"
></v-checkbox>
<v-checkbox
v-model="dbCheckboxes.history_totals"
:label="$t('Settings.GeneralTab.DbHistoryTotals')"
v-if="moonrakerComponents.includes('history')"
hide-details
class="mt-0"
@change="changeNamespace('history_totals')"
></v-checkbox>
</v-col>
</v-row>
@@ -105,8 +137,8 @@
<v-col class="text-center">
<v-btn
color="red"
@click="resetMainsail"
:loading="dialogResetMainsailLoading"
@click="resetMainsailAction"
:loading="loadings.includes('resetMainsail')"
>
{{ $t('Settings.GeneralTab.Reset') }}
</v-btn>
@@ -115,6 +147,44 @@
</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="mdi-help-circle">
<template v-slot:buttons>
<v-btn icon tile @click="dialogRestoreMainsail = false"><v-icon>mdi-close-thick</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
:label="db.label"
hide-details
class="mt-0"
:key="db.name"
@change="changeNamespace(db.name)"
></v-checkbox>
</template>
</v-col>
</v-row>
<v-row>
<v-col class="text-center">
<v-btn
color="red"
@click="restoreDbAction"
:loading="loadings.includes('restoreMainsail')"
>
{{ $t('Settings.GeneralTab.Restore') }}
</v-btn>
</v-col>
</v-row>
</v-card-text>
</panel>
</v-dialog>
</div>
</template>
@@ -125,21 +195,74 @@ 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'
@Component({
components: {Panel, SettingsRow}
})
export default class SettingsGeneralTab extends Mixins(BaseMixin) {
private dialogBackupMainsail = false
private dialogResetMainsail = false
private dialogResetMainsailLoading = false
private dbCheckboxes = {
mainsail: false,
mainsail_presets: false,
mainsail_gcodehistory: false,
mainsail_macrogroups: false,
mainsail_remoteprinters: false,
timelapse: false,
history_jobs: false,
history_totals: 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[] = []
$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: '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')+''
}, {
name: 'webcams',
label: this.$t('Settings.WebcamsTab.Webcams')+''
}
]
}
get printerName() {
@@ -214,9 +337,145 @@ export default class SettingsGeneralTab extends Mixins(BaseMixin) {
return this.$store.state.server.components ?? []
}
resetMainsail() {
this.$store.dispatch('gui/resetMoonrakerDB', this.dbCheckboxes)
this.dialogResetMainsailLoading = true
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() {
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() {
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>
@@ -4,11 +4,11 @@
<v-card-text v-if="showGeneral">
<h3 class="text-h5 mb-3">{{ $t('Settings.MacrosTab.General') }}</h3>
<settings-row :title="$t('Settings.MacrosTab.Management')">
<v-select v-model="macroManagement" :items="macroManagements" outlined dense hide-details attach></v-select>
<v-select v-model="mode" :items="modes" outlined dense hide-details attach></v-select>
</settings-row>
<v-divider class="my-2"></v-divider>
</v-card-text>
<template v-if="macroManagement === 'expert'">
<template v-if="mode === 'expert'">
<settings-macros-tab-expert @update:showGeneral="updateShowGeneral" @scrollToTop="scrollToTop"></settings-macros-tab-expert>
</template>
<template v-else>
@@ -30,7 +30,7 @@ import SettingsMacrosTabExpert from '@/components/settings/SettingsMacrosTabExpe
export default class SettingsMacrosTab extends Mixins(BaseMixin) {
private showGeneral = true
get macroManagements() {
get modes() {
return [
{
text: this.$t('Settings.MacrosTab.Simple'),
@@ -43,12 +43,12 @@ export default class SettingsMacrosTab extends Mixins(BaseMixin) {
]
}
get macroManagement() {
return this.$store.state.gui?.dashboard?.macroManagement ?? 'simple'
get mode() {
return this.$store.state.gui?.macros?.mode ?? 'simple'
}
set macroManagement(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.macroManagement', value: newVal })
set mode(newVal) {
this.$store.dispatch('gui/macros/saveSetting', { name: 'mode', value: newVal })
}
updateShowGeneral(newVal: boolean) {
@@ -192,7 +192,7 @@ import draggable from 'vuedraggable'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import {Debounce} from 'vue-debounce-decorator'
import {PrinterStateMacro} from '@/store/printer/types'
import {GuiMacrogroupsStateMacrogroup, GuiMacrogroupsStateMacrogroupMacro} from '@/store/gui/macrogroups/types'
import {GuiMacrosStateMacrogroup, GuiMacrosStateMacrogroupMacro} from '@/store/gui/macros/types'
@Component({
components: {SettingsRow, draggable}
@@ -253,24 +253,24 @@ export default class SettingsMacrosTabExpert extends Mixins(BaseMixin) {
}
get availableMacros() {
return this.allMacros.filter((m: GuiMacrogroupsStateMacrogroupMacro) => !this.editGroupUsedMacros.includes(m.name))
return this.allMacros.filter((m: GuiMacrosStateMacrogroupMacro) => !this.editGroupUsedMacros.includes(m.name))
}
get groups() {
return this.$store.getters['gui/macrogroups/getAllMacrogroups'] ?? []
return this.$store.getters['gui/macros/getAllMacrogroups'] ?? []
}
get editGroupUsedMacros() {
return this.editGroup?.macros?.map((m: GuiMacrogroupsStateMacrogroupMacro) => m.name) ?? []
return this.editGroup?.macros?.map((m: GuiMacrosStateMacrogroupMacro) => m.name) ?? []
}
get editGroup(): GuiMacrogroupsStateMacrogroup | null {
return this.$store.getters['gui/macrogroups/getMacrogroup'](this.editGroupId)
get editGroup(): GuiMacrosStateMacrogroup | null {
return this.$store.getters['gui/macros/getMacrogroup'](this.editGroupId)
}
get editGroupMacros() {
const macros = this.editGroup?.macros ?? []
macros.sort((a: GuiMacrogroupsStateMacrogroupMacro, b: GuiMacrogroupsStateMacrogroupMacro) => a.pos - b.pos)
macros.sort((a: GuiMacrosStateMacrogroupMacro, b: GuiMacrosStateMacrogroupMacro) => a.pos - b.pos)
return macros
}
@@ -280,7 +280,7 @@ export default class SettingsMacrosTabExpert extends Mixins(BaseMixin) {
}
existsGroupName(name: string) {
return (this.groups.findIndex((group: GuiMacrogroupsStateMacrogroup) => group.name === name && group.id != this.editGroupId) >= 0)
return (this.groups.findIndex((group: GuiMacrosStateMacrogroup) => group.name === name && group.id != this.editGroupId) >= 0)
}
clearColorObject(color: any): string {
@@ -304,29 +304,29 @@ export default class SettingsMacrosTabExpert extends Mixins(BaseMixin) {
showInPause: true,
showInPrinting: true,
}
this.editGroupId = await this.$store.dispatch('gui/macrogroups/store', { values })
this.editGroupId = await this.$store.dispatch('gui/macros/groupStore', { values })
this.boolFormEdit = true
}
editMacrogroup(group: GuiMacrogroupsStateMacrogroup) {
editMacrogroup(group: GuiMacrosStateMacrogroup) {
this.boolFormEdit = true
this.editGroupId = group.id
}
deleteMacrogroup(id: string) {
this.$store.dispatch('gui/macrogroups/delete', id)
this.$store.dispatch('gui/macros/groupDelete', id)
}
addMacroToGroup(macro: PrinterStateMacro) {
this.$store.dispatch('gui/macrogroups/addMacroToMacrogroup', {
this.$store.dispatch('gui/macros/addMacroToMacrogroup', {
id: this.editGroupId,
macro: macro.name
})
}
updateMacroFromGroup(macro: GuiMacrogroupsStateMacrogroupMacro, option: string, value: boolean | string | number) {
this.$store.dispatch('gui/macrogroups/updateMacroFromMacrogroup', {
updateMacroFromGroup(macro: GuiMacrosStateMacrogroupMacro, option: string, value: boolean | string | number) {
this.$store.dispatch('gui/macros/updateMacroFromMacrogroup', {
id: this.editGroupId,
macro: macro.name,
option: option,
@@ -344,7 +344,7 @@ export default class SettingsMacrosTabExpert extends Mixins(BaseMixin) {
this.updateMacroFromGroup(this.editGroupMacros[newIndex], 'pos', oldPos)
}
changeColorMacroFromGroup(macro: GuiMacrogroupsStateMacrogroupMacro) {
changeColorMacroFromGroup(macro: GuiMacrosStateMacrogroupMacro) {
let index = this.macroColors.findIndex((color) => color.value === macro.color) + 1
const maxIndex = this.macroColors.length - 1
@@ -354,8 +354,8 @@ export default class SettingsMacrosTabExpert extends Mixins(BaseMixin) {
this.updateMacroFromGroup(macro, 'color', newColor)
}
removeMacroFromGroup(macro: GuiMacrogroupsStateMacrogroupMacro) {
this.$store.dispatch('gui/macrogroups/removeMacroFromMacrogroup', {
removeMacroFromGroup(macro: GuiMacrosStateMacrogroupMacro) {
this.$store.dispatch('gui/macros/removeMacroFromMacrogroup', {
id: this.editGroupId,
macro: macro.name
})
@@ -376,7 +376,7 @@ export default class SettingsMacrosTabExpert extends Mixins(BaseMixin) {
const values:any = {}
values[option] = newVal
this.$store.dispatch('gui/macrogroups/update', {
this.$store.dispatch('gui/macros/groupUpdate', {
id: this.editGroupId,
values
})
@@ -34,7 +34,7 @@ export default class SettingsMacrosTabSimple extends Mixins(BaseMixin) {
}
get hiddenMacros() {
return this.$store.state.gui.dashboard.hiddenMacros ?? []
return this.$store.state.gui.macros.hiddenMacros ?? []
}
getMacroStatus(name: string) {
@@ -49,7 +49,7 @@ export default class SettingsMacrosTabSimple extends Mixins(BaseMixin) {
else
hiddenMacros.push(name.toUpperCase())
this.$store.dispatch('gui/saveSetting', { name: 'dashboard.hiddenMacros', value: hiddenMacros })
this.$store.dispatch('gui/macros/saveSetting', { name: 'hiddenMacros', value: hiddenMacros })
}
}
</script>
@@ -306,7 +306,7 @@ export default class SettingsPresetsTab extends Mixins(BaseMixin) {
saveCooldown() {
if (this.cooldownForm.valid) {
this.$store.dispatch('gui/presets/updateCooldownGcode', this.cooldownForm.gcode)
this.$store.dispatch('gui/presets/saveSetting', { name: 'cooldownGcode', value: this.cooldownForm.gcode })
this.cooldownForm.bool = false
}
}
@@ -115,95 +115,95 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin) {
private defaultPrimaryColor = defaultPrimaryColor
get logoColor() {
return this.$store.state.gui.theme.logo
return this.$store.state.gui.uiSettings.logo
}
set logoColor(newVal) {
this.$store.dispatch('gui/saveSetting', {name: 'theme.logo', value: newVal})
this.$store.dispatch('gui/saveSetting', {name: 'uiSettings.logo', value: newVal})
}
get primaryColor() {
return this.$store.state.gui.theme.primary
return this.$store.state.gui.uiSettings.primary
}
set primaryColor(newVal) {
this.$store.dispatch('gui/saveSetting', {name: 'theme.primary', value: newVal})
this.$store.dispatch('gui/saveSetting', {name: 'uiSettings.primary', value: newVal})
}
get boolBigThumbnail() {
return this.$store.state.gui.dashboard.boolBigThumbnail
return this.$store.state.gui.uiSettings.boolBigThumbnail
}
set boolBigThumbnail(newVal) {
this.$store.dispatch('gui/saveSetting', {name: 'dashboard.boolBigThumbnail', value: newVal })
this.$store.dispatch('gui/saveSetting', {name: 'uiSettings.boolBigThumbnail', value: newVal })
}
get boolWebcamInNavigation() {
return this.$store.state.gui.webcamSettings.boolNavi ?? false
return this.$store.state.gui.uiSettings.boolWebcamNavi ?? false
}
set boolWebcamInNavigation(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'webcamSettings.boolNavi', value: newVal })
this.$store.dispatch('gui/saveSetting', { name: 'uiSettings.boolWebcamNavi', value: newVal })
}
get displayCancelPrint() {
return this.$store.state.gui.general.displayCancelPrint
return this.$store.state.gui.uiSettings.displayCancelPrint
}
set displayCancelPrint(newVal) {
this.$store.dispatch('gui/saveSetting', {name: 'general.displayCancelPrint', value: newVal })
this.$store.dispatch('gui/saveSetting', {name: 'uiSettings.displayCancelPrint', value: newVal })
}
get displayZOffsetStandby() {
return this.$store.state.gui.general.displayZOffsetStandby
return this.$store.state.gui.uiSettings.displayZOffsetStandby
}
set displayZOffsetStandby(newVal) {
this.$store.dispatch('gui/saveSetting', {name: 'general.displayZOffsetStandby', value: newVal })
this.$store.dispatch('gui/saveSetting', {name: 'uiSettings.displayZOffsetStandby', value: newVal })
}
get confirmOnEmergencyStop() {
return this.$store.state.gui.general.confirmOnEmergencyStop
return this.$store.state.gui.uiSettings.confirmOnEmergencyStop
}
set confirmOnEmergencyStop(newVal) {
this.$store.dispatch('gui/saveSetting', {name: 'general.confirmOnEmergencyStop', value: newVal })
this.$store.dispatch('gui/saveSetting', {name: 'uiSettings.confirmOnEmergencyStop', value: newVal })
}
get confirmOnPowerDeviceChange() {
return this.$store.state.gui.general.confirmOnPowerDeviceChange
return this.$store.state.gui.uiSettings.confirmOnPowerDeviceChange
}
set confirmOnPowerDeviceChange(newVal) {
this.$store.dispatch('gui/saveSetting', {name: 'general.confirmOnPowerDeviceChange', value: newVal })
this.$store.dispatch('gui/saveSetting', {name: 'uiSettings.confirmOnPowerDeviceChange', value: newVal })
}
get lockSliders() {
return this.$store.state.gui.general.lockSlidersOnTouchDevices
return this.$store.state.gui.uiSettings.lockSlidersOnTouchDevices
}
set lockSliders(newVal) {
this.$store.dispatch('gui/saveSetting', {name: 'general.lockSlidersOnTouchDevices', value: newVal})
this.$store.dispatch('gui/saveSetting', {name: 'uiSettings.lockSlidersOnTouchDevices', value: newVal})
}
get lockSlidersDelay() {
return this.$store.state.gui.general.lockSlidersDelay
return this.$store.state.gui.uiSettings.lockSlidersDelay
}
set lockSlidersDelay(newVal) {
(newVal >= 0) ? this.$store.dispatch('gui/saveSetting', {name: 'general.lockSlidersDelay', value: newVal}) : {}
(newVal >= 0) ? this.$store.dispatch('gui/saveSetting', {name: 'uiSettings.lockSlidersDelay', value: newVal}) : {}
}
get boolWideNavDrawer() {
return this.$store.state.gui.dashboard.boolWideNavDrawer ?? false
return this.$store.state.gui.uiSettings.boolWideNavDrawer ?? false
}
get navigationStyleSetting() {
return this.$store.state.gui.dashboard.navigationStyle
return this.$store.state.gui.uiSettings.navigationStyle
}
set navigationStyleSetting(newVal) {
this.$store.dispatch('gui/saveSetting', {name: 'dashboard.navigationStyle', value: newVal })
this.$store.dispatch('gui/saveSetting', {name: 'uiSettings.navigationStyle', value: newVal })
}
get navigationStyles() {
@@ -220,7 +220,7 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin) {
}
get boolHideUploadAndPrintButton() {
return this.$store.state.gui.dashboard.boolHideUploadAndPrintButton ?? false
return this.$store.state.gui.uiSettings.boolHideUploadAndPrintButton ?? false
}
set boolHideUploadAndPrintButton(newVal) {