[enh] App install better errors management

This commit is contained in:
ljf 2021-08-31 16:15:32 +02:00
parent ad04197287
commit 76fa9b64ec
4 changed files with 3580 additions and 3415 deletions

6979
app/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -18,13 +18,13 @@
"firacode": "^5.2.0",
"fontsource-firago": "^3.1.5",
"fork-awesome": "^1.1.7",
"simple-evaluate": "^1.4.3",
"vue": "^2.6.12",
"vue-i18n": "^8.24.1",
"vue-router": "^3.5.1",
"vuelidate": "^0.7.6",
"vuex": "^3.6.2",
"simple-evaluate": "^1.4.3",
"vue-showdown": "^2.4.1"
"vue-showdown": "^2.4.1",
"vuex": "^3.6.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.13",

View file

@ -71,6 +71,7 @@ export default {
form: undefined,
fields: undefined,
validations: null,
errors: undefined,
serverError: ''
}
},
@ -90,7 +91,7 @@ export default {
manifest.multi_instance = this.$i18n.t(manifest.multi_instance ? 'yes' : 'no')
this.infos = Object.fromEntries(infosKeys.map(key => [key, manifest[key]]))
const { form, fields, validations } = formatYunoHostArguments(
const { form, fields, validations, errors } = formatYunoHostArguments(
manifest.arguments.install,
manifest.name
)
@ -98,6 +99,7 @@ export default {
this.fields = fields
this.form = form
this.validations = { form: validations }
this.errors = errors
},
async performInstall () {
@ -115,7 +117,9 @@ export default {
this.$router.push({ name: 'app-list' })
}).catch(err => {
if (err.name !== 'APIBadRequestError') throw err
this.serverError = err.message
if (err.data.field) {
this.errors[err.data.field].message = err.message
} else this.serverError = err.message
})
}
}

View file

@ -60,7 +60,7 @@ module.exports = {
'^/yunohost': {
target: `http://${process.env.VUE_APP_IP}`,
ws: true,
logLevel: 'debug'
logLevel: 'info'
}
},
watchOptions: {