ui: show error if no package is selected

This commit is contained in:
liushuyu 2020-11-06 18:46:37 -07:00
parent bdda585f12
commit a9de893cca
No known key found for this signature in database
GPG Key ID: 23D1CE4534419437
2 changed files with 16 additions and 1 deletions

View File

@ -23,7 +23,9 @@
"location_placeholder":"Enter a install path here", "location_placeholder":"Enter a install path here",
"select":"Select", "select":"Select",
"overwriting": "Overwriting", "overwriting": "Overwriting",
"overwriting_warning": "Directory {path} already exists.<br>Are you sure you want to <b>overwrite</b> the contents inside?" "overwriting_warning": "Directory {path} already exists.<br>Are you sure you want to <b>overwrite</b> the contents inside?",
"nothing_picked": "Nothing selected",
"nothing_picked_warning": "Please select at least one package to install!"
}, },
"install_packages":{ "install_packages":{
"check_for_update":"Checking for updates...", "check_for_update":"Checking for updates...",

View File

@ -92,7 +92,20 @@ export default {
onConfirm: confirmCallback onConfirm: confirmCallback
}) })
}, },
show_nothing_picked_dialog: function () {
this.$buefy.dialog.alert({
title: this.$t('select_packages.nothing_picked'),
message: this.$t('select_packages.nothing_picked_warning', { path: this.$root.$data.install_location }),
confirmText: this.$t('cancel'),
type: 'is-danger',
hasIcon: true
})
},
install: function () { install: function () {
if (!this.$root.config.packages.some(function (x) { return x.default })) {
this.show_nothing_picked_dialog()
return
}
// maintenance + repair // maintenance + repair
if (this.repair) { if (this.repair) {
this.$router.push('/install/repair') this.$router.push('/install/repair')