Skip to content
Snippets Groups Projects
Commit 4a17d227 authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Add settings groups to state, update ActivityPub, Auth, Captcha tabs

parent c655882e
No related branches found
No related tags found
1 merge request!65Update server configuration
......@@ -4,7 +4,21 @@ import { filterIgnored, parseTuples, valueHasTuples, wrapConfig } from './normal
const settings = {
state: {
description: [],
settings: {},
settings: {
auto_linker: {},
cors_plug: {},
esshd: {},
http_signatures: {},
logger: {},
mime: {},
phoenix: {},
pleroma: {},
prometheus: {},
quack: {},
tesla: {},
ueberauth: {},
web_push_encryption: {}
},
ignoredIfNotEnabled: ['enabled', 'handler', 'password_authenticator', 'port', 'priv_dir'],
loading: true
},
......@@ -20,18 +34,8 @@ const settings = {
},
SET_SETTINGS: (state, data) => {
const newSettings = data.reduce((acc, { group, key, value }) => {
if (group === 'cors_plug') {
acc[':cors_plug'] = { ...acc[':cors_plug'], [key]: value }
} else if (group === 'logger') {
const parsedValue = valueHasTuples(key, value) ? value : parseTuples(value, key)
acc[':logger'] = acc[':logger'] ? { ...acc[':logger'], [key]: parsedValue } : { [key]: parsedValue }
} else if (group === 'quack') {
const parsedValue = valueHasTuples(key, value) ? value : parseTuples(value, key)
acc[':quack'] = acc[':quack'] ? { ...acc[':quack'], [key]: parsedValue } : { [key]: parsedValue }
} else {
const parsedValue = valueHasTuples(key, value) ? { value } : parseTuples(value, key)
acc[key] = { ...acc[key], ...parsedValue }
}
const parsedValue = valueHasTuples(key, value) ? { value } : parseTuples(value, key)
acc[group][key] = { ...acc[group][key], ...parsedValue }
return acc
}, state.settings)
state.settings = newSettings
......
......@@ -29,7 +29,7 @@ export default {
return this.settings.description.find(setting => setting.key === ':activitypub')
},
activitypubData() {
return this.settings.settings[':activitypub']
return this.settings.settings.pleroma[':activitypub']
},
isMobile() {
return this.$store.state.app.device === 'mobile'
......@@ -44,7 +44,7 @@ export default {
return this.settings.description.find(setting => setting.key === ':user')
},
userData() {
return this.settings.settings[':user']
return this.settings.settings.pleroma[':user']
}
},
methods: {
......
......@@ -37,7 +37,7 @@ export default {
return this.settings.description.find(setting => setting.key === ':auth')
},
authData() {
return this.settings.settings[':auth']
return this.settings.settings.pleroma[':auth']
},
isMobile() {
return this.$store.state.app.device === 'mobile'
......@@ -49,7 +49,7 @@ export default {
return this.settings.description.find(setting => setting.key === ':ldap')
},
ldapData() {
return this.settings.settings[':ldap']
return this.settings.settings.pleroma[':ldap']
},
loading() {
return this.settings.loading
......@@ -58,13 +58,13 @@ export default {
return this.settings.description.find(setting => setting.key === ':oauth2')
},
oauth2Data() {
return this.settings.settings[':oauth2']
return this.settings.settings.pleroma[':oauth2']
},
pleromaAuthenticator() {
return this.settings.description.find(setting => setting.description === 'Authenticator')
},
pleromaAuthenticatorData() {
return this.settings.settings['']
return this.settings.settings.pleroma['Pleroma.Web.Auth.Authenticator']
}
},
methods: {
......
......@@ -29,7 +29,7 @@ export default {
return this.settings.description.find(setting => setting.key === 'Pleroma.Captcha')
},
captchaData() {
return this.settings.settings['Pleroma.Captcha']
return this.settings.settings.pleroma['Pleroma.Captcha']
},
isMobile() {
return this.$store.state.app.device === 'mobile'
......@@ -38,7 +38,7 @@ export default {
return this.settings.description.find(setting => setting.key === 'Pleroma.Captcha.Kocaptcha')
},
kocaptchaData() {
return this.settings.settings['Pleroma.Captcha.Kocaptcha']
return this.settings.settings.pleroma['Pleroma.Captcha.Kocaptcha']
},
labelWidth() {
return this.isMobile ? '100px' : '240px'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment