diff --git a/src/components/charts/HistoryAllPrintStatusChart.vue b/src/components/charts/HistoryAllPrintStatusChart.vue index d849d7706..0b32dbac4 100644 --- a/src/components/charts/HistoryAllPrintStatusChart.vue +++ b/src/components/charts/HistoryAllPrintStatusChart.vue @@ -60,7 +60,7 @@ export default class HistoryAllPrintStatusChart extends Mixins(BaseMixin, ThemeM } get selectedJobs() { - return this.$store.state.gui.view.history.selectedJobs ?? [] + return this.$store.getters['server/history/getSelectedJobs'] } get allPrintStatusArray() { diff --git a/src/components/charts/HistoryAllPrintStatusTable.vue b/src/components/charts/HistoryAllPrintStatusTable.vue index abd0f8abe..92faaf761 100644 --- a/src/components/charts/HistoryAllPrintStatusTable.vue +++ b/src/components/charts/HistoryAllPrintStatusTable.vue @@ -20,7 +20,7 @@ import { ServerHistoryStateAllPrintStatusEntry } from '@/store/server/history/ty }) export default class HistoryAllPrintStatusTable extends Mixins(BaseMixin) { get selectedJobs() { - return this.$store.state.gui.view.history.selectedJobs ?? [] + return this.$store.getters['server/history/getSelectedJobs'] } get allPrintStatusArray() { diff --git a/src/components/dialogs/HistoryDeleteJobDialog.vue b/src/components/dialogs/HistoryDeleteJobDialog.vue new file mode 100644 index 000000000..e41c5d20d --- /dev/null +++ b/src/components/dialogs/HistoryDeleteJobDialog.vue @@ -0,0 +1,49 @@ + + diff --git a/src/components/dialogs/HistoryDeleteSelectedJobsDialog.vue b/src/components/dialogs/HistoryDeleteSelectedJobsDialog.vue new file mode 100644 index 000000000..1db91ae57 --- /dev/null +++ b/src/components/dialogs/HistoryDeleteSelectedJobsDialog.vue @@ -0,0 +1,58 @@ + + diff --git a/src/components/dialogs/HistoryDetailsDialog.vue b/src/components/dialogs/HistoryDetailsDialog.vue new file mode 100644 index 000000000..dfa3c2c34 --- /dev/null +++ b/src/components/dialogs/HistoryDetailsDialog.vue @@ -0,0 +1,170 @@ + + + diff --git a/src/components/dialogs/HistoryDetailsDialogEntry.vue b/src/components/dialogs/HistoryDetailsDialogEntry.vue new file mode 100644 index 000000000..5bc3cc735 --- /dev/null +++ b/src/components/dialogs/HistoryDetailsDialogEntry.vue @@ -0,0 +1,41 @@ + + diff --git a/src/components/dialogs/HistoryListPanelAddMaintenance.vue b/src/components/dialogs/HistoryListPanelAddMaintenance.vue new file mode 100644 index 000000000..7a45376d8 --- /dev/null +++ b/src/components/dialogs/HistoryListPanelAddMaintenance.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/components/dialogs/HistoryListPanelDeleteSelectedDialog.vue b/src/components/dialogs/HistoryListPanelDeleteSelectedDialog.vue new file mode 100644 index 000000000..163efe922 --- /dev/null +++ b/src/components/dialogs/HistoryListPanelDeleteSelectedDialog.vue @@ -0,0 +1,75 @@ + + + diff --git a/src/components/dialogs/HistoryListPanelDetailMaintenance.vue b/src/components/dialogs/HistoryListPanelDetailMaintenance.vue new file mode 100644 index 000000000..03f078813 --- /dev/null +++ b/src/components/dialogs/HistoryListPanelDetailMaintenance.vue @@ -0,0 +1,130 @@ + + + diff --git a/src/components/dialogs/HistoryListPanelDetailMaintenanceHistoryEntry.vue b/src/components/dialogs/HistoryListPanelDetailMaintenanceHistoryEntry.vue new file mode 100644 index 000000000..bae264a1f --- /dev/null +++ b/src/components/dialogs/HistoryListPanelDetailMaintenanceHistoryEntry.vue @@ -0,0 +1,176 @@ + + + diff --git a/src/components/dialogs/HistoryListPanelDetailsDialog.vue b/src/components/dialogs/HistoryListPanelDetailsDialog.vue new file mode 100644 index 000000000..16f7f33f8 --- /dev/null +++ b/src/components/dialogs/HistoryListPanelDetailsDialog.vue @@ -0,0 +1,126 @@ + + + + + diff --git a/src/components/dialogs/HistoryListPanelEditMaintenance.vue b/src/components/dialogs/HistoryListPanelEditMaintenance.vue new file mode 100644 index 000000000..3de9ba29f --- /dev/null +++ b/src/components/dialogs/HistoryListPanelEditMaintenance.vue @@ -0,0 +1,251 @@ + + + diff --git a/src/components/dialogs/HistoryListPanelNoteDialog.vue b/src/components/dialogs/HistoryListPanelNoteDialog.vue new file mode 100644 index 000000000..d42dbcfaa --- /dev/null +++ b/src/components/dialogs/HistoryListPanelNoteDialog.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/src/components/dialogs/HistoryListPanelPerformMaintenance.vue b/src/components/dialogs/HistoryListPanelPerformMaintenance.vue new file mode 100644 index 000000000..5398ab93e --- /dev/null +++ b/src/components/dialogs/HistoryListPanelPerformMaintenance.vue @@ -0,0 +1,75 @@ + + + diff --git a/src/components/mixins/settingsGeneralDatabase.ts b/src/components/mixins/settingsGeneralDatabase.ts index c746e1c48..f2e6e577b 100644 --- a/src/components/mixins/settingsGeneralDatabase.ts +++ b/src/components/mixins/settingsGeneralDatabase.ts @@ -29,7 +29,7 @@ export default class SettingsGeneralDatabase extends BaseMixin { }, { value: 'navigation', - label: this.$t('Settings.GeneralTab.DBNavigation'), + label: this.$t('Settings.GeneralTab.DbNavigation'), }, { value: 'uiSettings', @@ -115,6 +115,14 @@ export default class SettingsGeneralDatabase extends BaseMixin { backupableNamespaces = backupableNamespaces.sort(this.sortNamespaces) } + // add maintenance if exists + if (availableNamespaces.includes('maintenance')) { + backupableNamespaces.push({ + value: 'maintenance', + label: this.$t('Settings.GeneralTab.DbMaintenance'), + }) + } + // add timelapse if exists if (availableNamespaces.includes('timelapse')) { backupableNamespaces.push({ diff --git a/src/components/notifications/NotificationMenuEntry.vue b/src/components/notifications/NotificationMenuEntry.vue index 55cdc2e6d..397876dba 100644 --- a/src/components/notifications/NotificationMenuEntry.vue +++ b/src/components/notifications/NotificationMenuEntry.vue @@ -1,98 +1,80 @@ @@ -101,6 +83,13 @@ import BaseMixin from '@/components/mixins/base' import { Component, Mixins, Prop, Watch } from 'vue-property-decorator' import { mdiClose, mdiLinkVariant, mdiBellOffOutline } from '@mdi/js' import { GuiNotificationStateEntry } from '@/store/gui/notifications/types' +import { TranslateResult } from 'vue-i18n' +import { GuiMaintenanceStateEntry } from '@/store/gui/maintenance/types' + +interface ReminderOption { + text: string | TranslateResult + clickFunction: Function +} @Component({ components: {}, @@ -110,7 +99,8 @@ export default class NotificationMenuEntry extends Mixins(BaseMixin) { mdiLinkVariant = mdiLinkVariant mdiBellOffOutline = mdiBellOffOutline - private expand = false + expand = false + showMaintenanceDetails = false @Prop({ required: true }) declare readonly entry: GuiNotificationStateEntry @@ -139,6 +129,49 @@ export default class NotificationMenuEntry extends Mixins(BaseMixin) { return this.entry.id.slice(0, posFirstSlash) } + get maintenanceEntry() { + if (this.entryType !== 'maintenance') return null + + const id = this.entry.id.replace('maintenance/', '') + const entries = this.$store.getters['gui/maintenance/getEntries'] + + return entries.find((entry: GuiMaintenanceStateEntry) => entry.id === id) + } + + get reminderTimes() { + let output: ReminderOption[] = [ + { + text: this.$t('App.Notifications.NextReboot'), + clickFunction: () => this.dismiss('reboot', null), + }, + { text: this.$t('App.Notifications.Never'), clickFunction: () => this.close() }, + ] + + if (['announcement', 'maintenance'].includes(this.entryType)) { + output = [] + output.push({ + text: this.$t('App.Notifications.OneHourShort'), + clickFunction: () => this.dismiss('time', 60 * 60), + }) + output.push({ + text: this.$t('App.Notifications.OneDayShort'), + clickFunction: () => this.dismiss('time', 60 * 60 * 24), + }) + output.push({ + text: this.$t('App.Notifications.OneWeekShort'), + clickFunction: () => this.dismiss('time', 60 * 60 * 24 * 7), + }) + } + + return output + } + + xButtonAction() { + if (this.entryType === 'announcement') return this.close() + + this.dismiss('reboot', null) + } + close() { this.$store.dispatch('gui/notifications/close', { id: this.entry.id }) } @@ -157,10 +190,12 @@ export default class NotificationMenuEntry extends Mixins(BaseMixin) { diff --git a/src/components/panels/HistoryStatisticsPanel.vue b/src/components/panels/HistoryStatisticsPanel.vue index a282fe979..628bb12c6 100644 --- a/src/components/panels/HistoryStatisticsPanel.vue +++ b/src/components/panels/HistoryStatisticsPanel.vue @@ -12,19 +12,19 @@