From c2c64dafe7f2a4fc2accd7ee5f87d382886bbedb Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Fri, 15 Mar 2019 04:49:30 +0000 Subject: [external-backeds] Big idoit rework, to match the updated api --- webapp/src/components/BackendModule.vue | 34 ++++++++++++++--------------- webapp/src/components/BackendModuleEdit.vue | 1 + 2 files changed, 18 insertions(+), 17 deletions(-) (limited to 'webapp') diff --git a/webapp/src/components/BackendModule.vue b/webapp/src/components/BackendModule.vue index 43f07a2..6945d82 100644 --- a/webapp/src/components/BackendModule.vue +++ b/webapp/src/components/BackendModule.vue @@ -165,26 +165,26 @@ export default { } }, methods: { - checkConnection (item) { + async checkConnection (item) { // Set to start the loading animation. item.loading = true // Test the credential connection. - this.$http.post('/api/backends/' + item.id + '/connection', { - headers: { - 'Cache-Control': 'no-cache' - } - }).then(response => { - if (response.data.success) { - // Set the button color to green if success. - item.connection = 'success' - } else { - // Set the button color to red if error. - item.connection = 'error' - this.$snackbar({ color: 'error', text: response.data.error }) - } - // Set item.loading = false to end the loading animation. - item.loading = false - }) + try { + const response = await this.$http.post('/api/backends/' + item.id + '/connection', { + headers: { + 'Cache-Control': 'no-cache' + } + }) + // Set the button color to green if success. + if (response) item.connection = 'success' + } catch (error) { + // Set the button color to red if error. + item.connection = 'error' + this.$snackbar({ color: 'error', text: error.response.data.message }) + } + + // Set item.loading = false to end the loading animation. + item.loading = false }, checkConnections (items) { const tmp = this diff --git a/webapp/src/components/BackendModuleEdit.vue b/webapp/src/components/BackendModuleEdit.vue index 95f4d37..c5c1c31 100644 --- a/webapp/src/components/BackendModuleEdit.vue +++ b/webapp/src/components/BackendModuleEdit.vue @@ -106,6 +106,7 @@ cached
{{ $t('Status') }}: {{ statusLabel }}
+
{{ $t('Status') }}: TODO: REMOVE
-- cgit v1.2.3-55-g7522