mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
commit
6809fd5e31
7 changed files with 18 additions and 3 deletions
|
@ -68,6 +68,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"no-console": "warn",
|
||||||
"template-curly-spacing": "off",
|
"template-curly-spacing": "off",
|
||||||
"camelcase": "warn",
|
"camelcase": "warn",
|
||||||
"indent": "off",
|
"indent": "off",
|
||||||
|
|
|
@ -19,6 +19,7 @@ class APIError extends Error {
|
||||||
}
|
}
|
||||||
|
|
||||||
log () {
|
log () {
|
||||||
|
/* eslint-disable-next-line */
|
||||||
console.error(`${this.name} (${this.code}): ${this.uri}\n${this.message}`)
|
console.error(`${this.name} (${this.code}): ${this.uri}\n${this.message}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,7 @@ export default {
|
||||||
'DISPATCH_MESSAGE' ({ commit }, { request, messages }) {
|
'DISPATCH_MESSAGE' ({ commit }, { request, messages }) {
|
||||||
for (const type in messages) {
|
for (const type in messages) {
|
||||||
const message = {
|
const message = {
|
||||||
text: messages[type],
|
text: messages[type].replace('\n', '<br>'),
|
||||||
color: type === 'error' ? 'danger' : type
|
color: type === 'error' ? 'danger' : type
|
||||||
}
|
}
|
||||||
let progressBar = message.text.match(/^\[#*\+*\.*\] > /)
|
let progressBar = message.text.match(/^\[#*\+*\.*\] > /)
|
||||||
|
|
|
@ -118,7 +118,11 @@ export default {
|
||||||
|
|
||||||
performPostInstall (force = false) {
|
performPostInstall (force = false) {
|
||||||
// FIXME does the api will throw an error for bad passwords ?
|
// FIXME does the api will throw an error for bad passwords ?
|
||||||
api.post('postinstall' + (force ? '?force_diskspace' : ''), { domain: this.domain, password: this.password }).then(data => {
|
api.post(
|
||||||
|
'postinstall' + (force ? '?force_diskspace' : ''),
|
||||||
|
{ domain: this.domain, password: this.password },
|
||||||
|
{ key: 'postinstall' }
|
||||||
|
).then(() => {
|
||||||
// Display success message and allow the user to login
|
// Display success message and allow the user to login
|
||||||
this.goToStep('login')
|
this.goToStep('login')
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|
|
@ -105,6 +105,8 @@ export default {
|
||||||
api.put(
|
api.put(
|
||||||
`apps/${this.id}/config`, { args }, { key: 'apps.update_config', name: this.id }
|
`apps/${this.id}/config`, { args }, { key: 'apps.update_config', name: this.id }
|
||||||
).then(response => {
|
).then(response => {
|
||||||
|
// FIXME what should be done ?
|
||||||
|
/* eslint-disable-next-line */
|
||||||
console.log('SUCCESS', response)
|
console.log('SUCCESS', response)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
if (err.name !== 'APIBadRequestError') throw err
|
if (err.name !== 'APIBadRequestError') throw err
|
||||||
|
|
|
@ -138,6 +138,7 @@ export default {
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
if (response.ok) return response.json()
|
if (response.ok) return response.json()
|
||||||
// FIXME flash error
|
// FIXME flash error
|
||||||
|
/* eslint-disable-next-line */
|
||||||
else console.log('error', response)
|
else console.log('error', response)
|
||||||
}).then(({ key }) => {
|
}).then(({ key }) => {
|
||||||
window.open('https://paste.yunohost.org/' + key, '_blank')
|
window.open('https://paste.yunohost.org/' + key, '_blank')
|
||||||
|
|
|
@ -97,7 +97,13 @@ export default {
|
||||||
|
|
||||||
const uri = id !== null ? `apps/${id}/upgrade` : 'upgrade/' + type
|
const uri = id !== null ? `apps/${id}/upgrade` : 'upgrade/' + type
|
||||||
api.put(uri, {}, { key: 'upgrade.' + (id ? 'app' : type), app: id }).then(() => {
|
api.put(uri, {}, { key: 'upgrade.' + (id ? 'app' : type), app: id }).then(() => {
|
||||||
this.$router.push({ name: 'tool-logs' })
|
if (id !== null) {
|
||||||
|
this.apps = this.apps.filter(app => id !== app.id)
|
||||||
|
} else if (type === 'apps') {
|
||||||
|
this.apps = null
|
||||||
|
} else {
|
||||||
|
this.system = null
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue