summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/BackendModuleEdit.vue
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/src/components/BackendModuleEdit.vue')
-rw-r--r--webapp/src/components/BackendModuleEdit.vue33
1 files changed, 16 insertions, 17 deletions
diff --git a/webapp/src/components/BackendModuleEdit.vue b/webapp/src/components/BackendModuleEdit.vue
index 9d27fbc..95f4d37 100644
--- a/webapp/src/components/BackendModuleEdit.vue
+++ b/webapp/src/components/BackendModuleEdit.vue
@@ -3,7 +3,7 @@
"en": {
"inputCredentials": "Login credentials",
"backendCreated": "Backend was successfully created.",
- "backendName": "Backend name",
+ "backendName": "Backend Name",
"backendEmptyError": "This field can not be empty.",
"backendType": "Backend type",
"backendtypeEmptyError": "Please choose a backend type.",
@@ -178,21 +178,19 @@ export default {
})
}
},
- loadBackend (backendId) {
- this.$http('/api/backends/' + this.backendId).then(response => {
- this.backendName = response.data.name
- this.loadData = true
- this.backendType = response.data.type
- const credentialValues = JSON.parse(response.data.credentials)
- this.$http('/api/backendtypes/' + this.backendType).then(res => {
- var credentials = res.data
+ async loadBackend (backendId) {
+ const response = await this.$http('/api/backends/' + this.backendId)
+ this.backendName = response.data.name
+ this.loadData = true
+ this.backendType = response.data.type
+ const credentialValues = response.data.credentials
+ const res = await this.$http('/api/backendtypes/' + this.backendType)
+ var credentials = res.data
- // Make an array merge to combine the credentials with the values.
- // var mergedCredentials = credentials.map(x => Object.assign(x, credentialValues.find(y => y.id === x.id)))
- var mergedCredentials = mergeObjects(credentials, credentialValues)
- this.elements = mergedCredentials
- })
- })
+ // Make an array merge to combine the credentials with the values.
+ // var mergedCredentials = credentials.map(x => Object.assign(x, credentialValues.find(y => y.id === x.id)))
+ var mergedCredentials = mergeObjects(credentials, credentialValues)
+ this.elements = mergedCredentials
},
completeStepOne () {
// Error handling
@@ -236,7 +234,7 @@ export default {
this.statusLabel = this.$t('error')
this.$snackbar({ color: 'error', text: response.data.error })
}
- // Set item.loading = false to end the loading animation.
+ // End the loading animation.
this.loading = false
})
}
@@ -276,7 +274,8 @@ export default {
function filterData (obj) {
var result = []
- obj.forEach(function (element) {
+ obj.forEach(element => {
+ if (element.disabled) return
const e = { id: element.id, value: element.value }
if (element.elements) {
e.elements = filterData(element.elements)