ui: warn about file deletion before a repair

This commit is contained in:
liushuyu 2022-03-29 22:22:20 -06:00
parent a86bd209a8
commit 2103a8ec15
No known key found for this signature in database
GPG Key ID: 23D1CE4534419437
2 changed files with 9 additions and 1 deletions

View File

@ -57,6 +57,7 @@
"repair": "Repair", "repair": "Repair",
"uninstall":"Uninstall", "uninstall":"Uninstall",
"view_local_files": "View local files", "view_local_files": "View local files",
"prompt_repair": "<b>WARNING:</b> All the files under {path} will be <b>deleted</b> as part of the repair process! Do you wish to proceed?",
"prompt_recover": "Installer data for {name} is corrupted.<br>A repair is required to restore the installation.", "prompt_recover": "Installer data for {name} is corrupted.<br>A repair is required to restore the installation.",
"prompt":"Are you sure you want to uninstall {name}?", "prompt":"Are you sure you want to uninstall {name}?",
"prompt_confirm":"Uninstall {name}" "prompt_confirm":"Uninstall {name}"

View File

@ -61,7 +61,14 @@ export default {
this.$router.push('/packages') this.$router.push('/packages')
}, },
repair_packages: function () { repair_packages: function () {
this.$router.push({ name: 'packages', params: { repair: true } }) this.$buefy.dialog.alert({
title: this.$t('modify.repair'),
message: this.$t('modify.prompt_recover', { name: this.$root.$data.attrs.name }),
confirmText: this.$t('continue'),
type: 'is-danger',
hasIcon: true,
onConfirm: () => { this.$router.push({ name: 'packages', params: { repair: true } }) }
})
}, },
prepare_uninstall: function () { prepare_uninstall: function () {
this.$buefy.dialog.confirm({ this.$buefy.dialog.confirm({