summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/BackendModuleTable.vue
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/src/components/BackendModuleTable.vue')
-rw-r--r--webapp/src/components/BackendModuleTable.vue67
1 files changed, 40 insertions, 27 deletions
diff --git a/webapp/src/components/BackendModuleTable.vue b/webapp/src/components/BackendModuleTable.vue
index 2ca15b3..9635fe9 100644
--- a/webapp/src/components/BackendModuleTable.vue
+++ b/webapp/src/components/BackendModuleTable.vue
@@ -1,20 +1,26 @@
<i18n>
{
"en": {
- "add-backend-btn": "Add Backend",
- "backend-id": "id",
- "backend-name": "name",
- "backend-type": "type",
- "delete-backend": "Delete {0} backend | Delete {0} backends",
- "check-connection": "Check {0} connection | Check {0} connections"
+ "addBackendBtn": "Add Backend",
+ "backendId": "id",
+ "backendName": "name",
+ "backendType": "type",
+ "removeBackend": "Remove one backend | Remove {0} backends",
+ "checkConnection": "Check one connection | Check {0} connections",
+ "name": "Name",
+ "type": "Type",
+ "id": "ID"
},
"de": {
- "add-backend-btn": "Backend hinzufügen",
- "backend-id": "id",
- "backend-name": "name",
- "backend-type": "typ",
- "delete-backend": "Lösche {0} Backend | Lösche {0} Backends",
- "check-connection": "Überprüfe {0} Verbindung | Überprüfe {0} Verbindungen"
+ "addBackendBtn": "Backend hinzufügen",
+ "backendId": "id",
+ "backendName": "name",
+ "backendType": "typ",
+ "removeBackend": "Entferne ein Backend | Entferne {0} Backends",
+ "checkConnection": "Überprüfe eine Verbindung | Überprüfe {0} Verbindungen",
+ "name": "Name",
+ "type": "Type",
+ "id": "ID"
}
}
</i18n>
@@ -57,6 +63,9 @@
>
<v-icon>cached</v-icon>
</v-btn>
+ <v-btn flat icon color="primary" @click.stop="$store.commit('backends/editSync', props.item.id)">
+ <v-icon>settings_ethernet</v-icon>
+ </v-btn>
<v-btn flat icon color="primary" @click.stop="$store.commit('backends/editBackend', props.item.id)">
<v-icon>edit</v-icon>
</v-btn>
@@ -67,14 +76,14 @@
</v-data-table>
</v-card>
<div class="text-xs-right">
- <v-btn color="primary" flat @click="checkConnections(selected)">
- <v-icon left>cached</v-icon>{{ $tc('check-connection', selected.length, [selected.length]) }}
+ <v-btn color="primary" flat @click="checkConnections(selected)" :disabled="selected.length === 0">
+ <v-icon left>cached</v-icon>{{ $tc('checkConnection', selected.length, [selected.length]) }}
</v-btn>
- <v-btn color="error" flat @click="$store.commit('backends/setDialog', { show: true, del: true } )"><!-- @click="deleteBackends(selected)"-->
- <v-icon left>remove_circle_outline</v-icon>{{ $tc('delete-backend', selected.length, [selected.length]) }}
+ <v-btn color="error" flat @click="$store.commit('backends/setDialog', { show: true, del: true } )" :disabled="selected.length === 0">
+ <v-icon left>remove_circle_outline</v-icon>{{ $tc('removeBackend', selected.length, [selected.length]) }}
</v-btn>
<v-btn color="success" flat @click="$store.commit('backends/editBackend', 0)">
- <v-icon left>add_circle_outline</v-icon>{{ $t('add-backend-btn') }}
+ <v-icon left>add_circle_outline</v-icon>{{ $t('addBackendBtn') }}
</v-btn>
</div>
</div>
@@ -91,12 +100,7 @@ export default {
backendId: '',
backendType: '',
test: false,
- headers: [
- { text: 'ID', value: 'id' },
- { text: 'Name', value: 'name', width: '10000px' },
- { text: 'Type', value: 'type' },
- { sortable: false }
- ]
+ edit: false
}
},
methods: {
@@ -104,15 +108,16 @@ export default {
// Set to start the loading animation.
item.loading = true
// Test the credential connection.
- this.$http('/api/backends/checkConnection?id=' + this.backendId, {
+ this.$http.post('/api/backends/checkConnection', {
+ id: item.id,
headers: {
'Cache-Control': 'no-cache'
}
}).then(response => {
- if (response.data.status === 'success') {
+ if (response.data.success) {
// Set the button color to green if success.
item.connection = 'success'
- } else if (response.data.status === 'error') {
+ } else {
// Set the button color to red if error.
item.connection = 'error'
this.$store.commit('newSnackbar', response.data.msg)
@@ -131,7 +136,15 @@ export default {
watch: {
},
computed: {
- ...mapState('backends', ['selected', 'backends'])
+ ...mapState('backends', ['selected', 'backends']),
+ headers () {
+ return [
+ { text: this.$t('id'), value: 'id' },
+ { text: this.$t('name'), value: 'name', width: '10000px' },
+ { text: this.$t('type'), value: 'type' },
+ { sortable: false }
+ ]
+ }
},
created () {
this.$store.dispatch('backends/loadData')