summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJannik Schönartz2019-03-15 05:49:30 +0100
committerJannik Schönartz2019-03-15 05:49:30 +0100
commitc2c64dafe7f2a4fc2accd7ee5f87d382886bbedb (patch)
tree08ac85332cdff8af7e682add94223dcc2bc29e60 /webapp
parentmerge (diff)
downloadbas-c2c64dafe7f2a4fc2accd7ee5f87d382886bbedb.tar.gz
bas-c2c64dafe7f2a4fc2accd7ee5f87d382886bbedb.tar.xz
bas-c2c64dafe7f2a4fc2accd7ee5f87d382886bbedb.zip
[external-backeds] Big idoit rework, to match the updated api
Diffstat (limited to 'webapp')
-rw-r--r--webapp/src/components/BackendModule.vue34
-rw-r--r--webapp/src/components/BackendModuleEdit.vue1
2 files changed, 18 insertions, 17 deletions
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 @@
<v-icon x-large color="primary">cached</v-icon>
</v-btn>
<div class="display-1">{{ $t('Status') }}: <strong :class="statusColor">{{ statusLabel }}</strong></div>
+ <div class="display-1">{{ $t('Status') }}: <strong :class="statusColor">TODO: REMOVE</strong></div>
</v-layout>
</v-container>
</v-stepper-content>