Update parsing values for Logger and JobQueue tabs

This commit is contained in:
Angelina Filippova 2019-11-20 12:01:19 +09:00
parent c9d609e3db
commit 01dfa80bc9
3 changed files with 14 additions and 20 deletions

View file

@ -62,7 +62,7 @@
@input="updateSetting($event, settingGroup.key, setting.key)"/>
<el-input
v-if="setting.type === 'atom'"
:value="data[setting.key] ? data[setting.key].substr(1) : null"
:value="inputValue ? inputValue.substr(1) : null"
:placeholder="setting.suggestions[0]"
@input="updateSetting($event, settingGroup.key, setting.key)">
<template slot="prepend">:</template>
@ -225,9 +225,13 @@ export default {
}
},
inputValue() {
return ([':esshd', ':cors_plug'].includes(this.settingGroup.group) && this.data[this.setting.key])
? this.data[this.setting.key].value
: this.data[this.setting.key]
if ([':esshd', ':cors_plug', ':quack'].includes(this.settingGroup.group) && this.data[this.setting.key]) {
return this.data[this.setting.key].value
} else if (this.settingGroup.group === ':logger' && this.setting.key === ':backends') {
return this.data.value
} else {
return this.data[this.setting.key]
}
},
labelWidth() {
return this.isMobile ? '100px' : '240px'

View file

@ -37,19 +37,16 @@ export default {
return this.settings.description.find(setting => setting.key === 'Oban')
},
obanQueuesData() {
return this.settings.settings['Oban']
return this.settings.settings.pleroma['Oban']
},
workers() {
return this.settings.description.find(setting => setting.key === ':workers')
},
workersData() {
return this.settings.settings[':workers']
return this.settings.settings.pleroma[':workers']
}
},
methods: {
updateSetting(value, tab, input) {
this.$store.dispatch('UpdateSettings', { tab, data: { [input]: value }})
},
async onSubmit() {
try {
await this.$store.dispatch('SubmitChanges')

View file

@ -38,17 +38,14 @@ export default {
return this.settings.description.find(setting => setting.key === ':console')
},
consoleData() {
return this.settings.settings[':logger'][':console']
return this.settings.settings.logger[':console']
},
exsyslogger() {
return this.settings.description.find(setting => setting.key === ':ex_syslogger')
},
exsysloggerData() {
return this.settings.settings[':logger'][':ex_syslogger']
return this.settings.settings.logger[':ex_syslogger']
},
// loggerBackendsValue() {
// return this.loggerBackends.value ? this.loggerBackends.value.map(el => JSON.stringify(el)) : []
// },
isMobile() {
return this.$store.state.app.device === 'mobile'
},
@ -62,20 +59,16 @@ export default {
return this.settings.description.find(setting => setting.group === ':logger')
},
loggerData() {
return this.settings.settings[':logger']
return this.settings.settings.logger[':backends']
},
quack() {
return this.settings.description.find(setting => setting.group === ':quack')
},
quackData() {
return this.settings.settings[':quack']
return this.settings.settings.quack
}
},
methods: {
// updateloggerBackends(value, tab, input) {
// const parseValue = value.map(el => JSON.parse(el))
// this.$store.dispatch('UpdateSettings', { tab, data: { [input]: parseValue }})
// },
async onSubmit() {
try {
await this.$store.dispatch('SubmitChanges')