From d655e679d9859f242b8177c5727831ef597970dc Mon Sep 17 00:00:00 2001 From: axolotle Date: Sat, 1 May 2021 12:50:15 +0200 Subject: [PATCH 1/4] replace websocket messages's \n with
--- app/src/store/info.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/store/info.js b/app/src/store/info.js index de7f4647..468a4ec2 100644 --- a/app/src/store/info.js +++ b/app/src/store/info.js @@ -169,7 +169,7 @@ export default { 'DISPATCH_MESSAGE' ({ commit }, { request, messages }) { for (const type in messages) { const message = { - text: messages[type], + text: messages[type].replace('\n', '
'), color: type === 'error' ? 'danger' : type } let progressBar = message.text.match(/^\[#*\+*\.*\] > /) From a8d8272edfe1157ddb9ffdcf94dfb39b9496c10b Mon Sep 17 00:00:00 2001 From: axolotle Date: Sat, 1 May 2021 13:00:00 +0200 Subject: [PATCH 2/4] display post-install human readable route name --- app/src/views/PostInstall.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/views/PostInstall.vue b/app/src/views/PostInstall.vue index 4a55c906..17bfa878 100644 --- a/app/src/views/PostInstall.vue +++ b/app/src/views/PostInstall.vue @@ -118,7 +118,11 @@ export default { performPostInstall (force = false) { // 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 this.goToStep('login') }).catch(err => { From a1ff39c9cb31f448b399fc04cecaa752bfed8bc9 Mon Sep 17 00:00:00 2001 From: axolotle Date: Sat, 1 May 2021 13:01:14 +0200 Subject: [PATCH 3/4] do not redirect after upgrade, update the view instead --- app/src/views/update/SystemUpdate.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/views/update/SystemUpdate.vue b/app/src/views/update/SystemUpdate.vue index f7a0f156..7deeb8e6 100644 --- a/app/src/views/update/SystemUpdate.vue +++ b/app/src/views/update/SystemUpdate.vue @@ -97,7 +97,13 @@ export default { const uri = id !== null ? `apps/${id}/upgrade` : 'upgrade/' + type 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 + } }) } } From 1ab7a3ef93655a4ec85b6560d23a244a2a30dfe1 Mon Sep 17 00:00:00 2001 From: axolotle Date: Sat, 1 May 2021 13:04:06 +0200 Subject: [PATCH 4/4] es-lint warn console.log() --- app/package.json | 1 + app/src/api/errors.js | 1 + app/src/views/app/AppConfigPanel.vue | 2 ++ app/src/views/service/ServiceInfo.vue | 1 + 4 files changed, 5 insertions(+) diff --git a/app/package.json b/app/package.json index 8424141e..df6c478e 100644 --- a/app/package.json +++ b/app/package.json @@ -68,6 +68,7 @@ } } ], + "no-console": "warn", "template-curly-spacing": "off", "camelcase": "warn", "indent": "off", diff --git a/app/src/api/errors.js b/app/src/api/errors.js index e8648d3a..047499b6 100644 --- a/app/src/api/errors.js +++ b/app/src/api/errors.js @@ -19,6 +19,7 @@ class APIError extends Error { } log () { + /* eslint-disable-next-line */ console.error(`${this.name} (${this.code}): ${this.uri}\n${this.message}`) } } diff --git a/app/src/views/app/AppConfigPanel.vue b/app/src/views/app/AppConfigPanel.vue index 3d4e43be..103aa4db 100644 --- a/app/src/views/app/AppConfigPanel.vue +++ b/app/src/views/app/AppConfigPanel.vue @@ -105,6 +105,8 @@ export default { api.put( `apps/${this.id}/config`, { args }, { key: 'apps.update_config', name: this.id } ).then(response => { + // FIXME what should be done ? + /* eslint-disable-next-line */ console.log('SUCCESS', response) }).catch(err => { if (err.name !== 'APIBadRequestError') throw err diff --git a/app/src/views/service/ServiceInfo.vue b/app/src/views/service/ServiceInfo.vue index 8af84ab8..299abb3e 100644 --- a/app/src/views/service/ServiceInfo.vue +++ b/app/src/views/service/ServiceInfo.vue @@ -138,6 +138,7 @@ export default { }).then(response => { if (response.ok) return response.json() // FIXME flash error + /* eslint-disable-next-line */ else console.log('error', response) }).then(({ key }) => { window.open('https://paste.yunohost.org/' + key, '_blank')