summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/BackendModuleSync.vue
diff options
context:
space:
mode:
authorJannik Schönartz2018-08-04 19:37:59 +0200
committerJannik Schönartz2018-08-04 19:37:59 +0200
commit1b61be89953be7bbfef93f2fe40317b498353404 (patch)
tree48de32655bb0c16b9800f28efb86180cf282154d /webapp/src/components/BackendModuleSync.vue
parent[webapp/router] changed dynamic route namespacing (diff)
downloadbas-1b61be89953be7bbfef93f2fe40317b498353404.tar.gz
bas-1b61be89953be7bbfef93f2fe40317b498353404.tar.xz
bas-1b61be89953be7bbfef93f2fe40317b498353404.zip
[external-backends] Sync types are now defined in the backend classes, so every backend can define their own sync methods.
Diffstat (limited to 'webapp/src/components/BackendModuleSync.vue')
-rw-r--r--webapp/src/components/BackendModuleSync.vue16
1 files changed, 12 insertions, 4 deletions
diff --git a/webapp/src/components/BackendModuleSync.vue b/webapp/src/components/BackendModuleSync.vue
index bf8464d..4d15438 100644
--- a/webapp/src/components/BackendModuleSync.vue
+++ b/webapp/src/components/BackendModuleSync.vue
@@ -25,6 +25,7 @@
</v-card-title>
<v-card-text style="height: 500px; padding: 40px">
<v-select
+ v-model="syncType"
:items="syncTypes"
:label="$t('syncType')"
offset-y
@@ -135,15 +136,17 @@ export default {
searchClients: '',
cbxGroups: null,
cbxClients: null,
- syncTypes: ['Two-Way', 'Upload Only', 'Upload Then Delete', 'Upload Mirror', 'Download Only', 'Download Then Delete', 'Download Mirror']
+ syncTypes: null,
+ syncType: null
}
},
methods: {
save (event) {
- this.$http.post('/api/backends/saveObjectTypes', {
+ this.$http.post('/api/backends/saveSyncSettings', {
id: this.backendId,
groups: this.cbxGroups,
- clients: this.cbxClients
+ clients: this.cbxClients,
+ sync: this.syncType
}).then(response => {
// TODO: Add saved successfull msg.
this.$store.commit('backends/setSync', false)
@@ -176,14 +179,19 @@ export default {
watch: {
sync: function (value) {
if (value) {
+ // Load the sync types from the backend.
+ this.$http('/api/backends/getSyncTypes?id=' + this.backendId).then(response => {
+ this.syncTypes = response.data
+ })
// Load the object types from the backend.
this.$http('/api/backends/getObjectTypes?id=' + this.backendId).then(response => {
this.objectTypes = response.data
})
- this.$http('/api/backends/getObjectTypesById?id=' + this.backendId).then(response => {
+ this.$http('/api/backends/getSyncSettings?id=' + this.backendId).then(response => {
this.cbxGroups = response.data.groups
this.cbxClients = response.data.clients
+ this.syncType = response.data.sync
})
}
}