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",
"select":"Select",
"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":{
"check_for_update":"Checking for updates...",

View File

@ -92,7 +92,20 @@ export default {
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 () {
if (!this.$root.config.packages.some(function (x) { return x.default })) {
this.show_nothing_picked_dialog()
return
}
// maintenance + repair
if (this.repair) {
this.$router.push('/install/repair')