Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix missing reset options for print history data #1534

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/components/settings/General/GeneralReset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class SettingsGeneralTabResetDatabase extends Mixins(BaseMixin, S
resetCheckboxes: string[] = []

async mounted() {
this.resetableNamespaces = await this.loadBackupableNamespaces()
await this.loadResetableNamespaces()
}

onSelectResetCheckboxes(resetCheckboxes: string[]) {
Expand All @@ -78,10 +78,26 @@ export default class SettingsGeneralTabResetDatabase extends Mixins(BaseMixin, S
}

async openDialog() {
this.resetableNamespaces = await this.loadBackupableNamespaces()
await this.loadResetableNamespaces()
this.showDialog = true
}

async loadResetableNamespaces() {
this.resetableNamespaces = await this.loadBackupableNamespaces()

if (this.moonrakerComponents.includes('history')) {
this.resetableNamespaces.push({
value: 'history_jobs',
label: this.$t('Settings.GeneralTab.DbHistoryJobs'),
})

this.resetableNamespaces.push({
value: 'history_totals',
label: this.$t('Settings.GeneralTab.DbHistoryTotals'),
})
}
}

closeDialog() {
this.showDialog = false
}
Expand Down
4 changes: 0 additions & 4 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,6 @@
"KlipperUpdateQuestionConfig": "This update may also contain changes to config parameters that would need to be modified in the printer.cfg file, see the change log for details.",
"MoonrakerUpdateQuestion": "This will update the Moonraker API. Changes to the moonraker.conf file may be required to continue using the machine.",
"MoreCommitsInfo": "A maximum of 30 commits can be displayed here. To see all commits, please click on the following link:",
"Notification": {
"Detached": "Detached state is not an error nor is it a problem. It only means that additional commits exist in the local repository that do not exist in the remote repository.",
"Dirty": "The local repository has been modified and cannot be updated in this state. Please recover this repository."
},
"OSPackages": "OS-Packages",
"SoftRecovery": "Soft Recovery",
"StartUpdate": "Start Update",
Expand Down