From 2103a8ec15bc24463a1d17560ae6e7fb7f872a7f Mon Sep 17 00:00:00 2001 From: liushuyu Date: Tue, 29 Mar 2022 22:22:20 -0600 Subject: [PATCH] ui: warn about file deletion before a repair --- ui/src/locales/en.json | 1 + ui/src/views/ModifyView.vue | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/src/locales/en.json b/ui/src/locales/en.json index aa7e13b..774f182 100644 --- a/ui/src/locales/en.json +++ b/ui/src/locales/en.json @@ -57,6 +57,7 @@ "repair": "Repair", "uninstall":"Uninstall", "view_local_files": "View local files", + "prompt_repair": "WARNING: All the files under {path} will be deleted as part of the repair process! Do you wish to proceed?", "prompt_recover": "Installer data for {name} is corrupted.
A repair is required to restore the installation.", "prompt":"Are you sure you want to uninstall {name}?", "prompt_confirm":"Uninstall {name}" diff --git a/ui/src/views/ModifyView.vue b/ui/src/views/ModifyView.vue index 40947a9..f394fc6 100644 --- a/ui/src/views/ModifyView.vue +++ b/ui/src/views/ModifyView.vue @@ -61,7 +61,14 @@ export default { this.$router.push('/packages') }, 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 () { this.$buefy.dialog.confirm({