forked from AkkomaGang/admin-fe
Add settings groups to state, update ActivityPub, Auth, Captcha tabs
This commit is contained in:
parent
c655882e6e
commit
4a17d2275a
4 changed files with 25 additions and 21 deletions
|
@ -4,7 +4,21 @@ import { filterIgnored, parseTuples, valueHasTuples, wrapConfig } from './normal
|
||||||
const settings = {
|
const settings = {
|
||||||
state: {
|
state: {
|
||||||
description: [],
|
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'],
|
ignoredIfNotEnabled: ['enabled', 'handler', 'password_authenticator', 'port', 'priv_dir'],
|
||||||
loading: true
|
loading: true
|
||||||
},
|
},
|
||||||
|
@ -20,18 +34,8 @@ const settings = {
|
||||||
},
|
},
|
||||||
SET_SETTINGS: (state, data) => {
|
SET_SETTINGS: (state, data) => {
|
||||||
const newSettings = data.reduce((acc, { group, key, value }) => {
|
const newSettings = data.reduce((acc, { group, key, value }) => {
|
||||||
if (group === 'cors_plug') {
|
const parsedValue = valueHasTuples(key, value) ? { value } : parseTuples(value, key)
|
||||||
acc[':cors_plug'] = { ...acc[':cors_plug'], [key]: value }
|
acc[group][key] = { ...acc[group][key], ...parsedValue }
|
||||||
} 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 }
|
|
||||||
}
|
|
||||||
return acc
|
return acc
|
||||||
}, state.settings)
|
}, state.settings)
|
||||||
state.settings = newSettings
|
state.settings = newSettings
|
||||||
|
|
|
@ -29,7 +29,7 @@ export default {
|
||||||
return this.settings.description.find(setting => setting.key === ':activitypub')
|
return this.settings.description.find(setting => setting.key === ':activitypub')
|
||||||
},
|
},
|
||||||
activitypubData() {
|
activitypubData() {
|
||||||
return this.settings.settings[':activitypub']
|
return this.settings.settings.pleroma[':activitypub']
|
||||||
},
|
},
|
||||||
isMobile() {
|
isMobile() {
|
||||||
return this.$store.state.app.device === 'mobile'
|
return this.$store.state.app.device === 'mobile'
|
||||||
|
@ -44,7 +44,7 @@ export default {
|
||||||
return this.settings.description.find(setting => setting.key === ':user')
|
return this.settings.description.find(setting => setting.key === ':user')
|
||||||
},
|
},
|
||||||
userData() {
|
userData() {
|
||||||
return this.settings.settings[':user']
|
return this.settings.settings.pleroma[':user']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -37,7 +37,7 @@ export default {
|
||||||
return this.settings.description.find(setting => setting.key === ':auth')
|
return this.settings.description.find(setting => setting.key === ':auth')
|
||||||
},
|
},
|
||||||
authData() {
|
authData() {
|
||||||
return this.settings.settings[':auth']
|
return this.settings.settings.pleroma[':auth']
|
||||||
},
|
},
|
||||||
isMobile() {
|
isMobile() {
|
||||||
return this.$store.state.app.device === 'mobile'
|
return this.$store.state.app.device === 'mobile'
|
||||||
|
@ -49,7 +49,7 @@ export default {
|
||||||
return this.settings.description.find(setting => setting.key === ':ldap')
|
return this.settings.description.find(setting => setting.key === ':ldap')
|
||||||
},
|
},
|
||||||
ldapData() {
|
ldapData() {
|
||||||
return this.settings.settings[':ldap']
|
return this.settings.settings.pleroma[':ldap']
|
||||||
},
|
},
|
||||||
loading() {
|
loading() {
|
||||||
return this.settings.loading
|
return this.settings.loading
|
||||||
|
@ -58,13 +58,13 @@ export default {
|
||||||
return this.settings.description.find(setting => setting.key === ':oauth2')
|
return this.settings.description.find(setting => setting.key === ':oauth2')
|
||||||
},
|
},
|
||||||
oauth2Data() {
|
oauth2Data() {
|
||||||
return this.settings.settings[':oauth2']
|
return this.settings.settings.pleroma[':oauth2']
|
||||||
},
|
},
|
||||||
pleromaAuthenticator() {
|
pleromaAuthenticator() {
|
||||||
return this.settings.description.find(setting => setting.description === 'Authenticator')
|
return this.settings.description.find(setting => setting.description === 'Authenticator')
|
||||||
},
|
},
|
||||||
pleromaAuthenticatorData() {
|
pleromaAuthenticatorData() {
|
||||||
return this.settings.settings['']
|
return this.settings.settings.pleroma['Pleroma.Web.Auth.Authenticator']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -29,7 +29,7 @@ export default {
|
||||||
return this.settings.description.find(setting => setting.key === 'Pleroma.Captcha')
|
return this.settings.description.find(setting => setting.key === 'Pleroma.Captcha')
|
||||||
},
|
},
|
||||||
captchaData() {
|
captchaData() {
|
||||||
return this.settings.settings['Pleroma.Captcha']
|
return this.settings.settings.pleroma['Pleroma.Captcha']
|
||||||
},
|
},
|
||||||
isMobile() {
|
isMobile() {
|
||||||
return this.$store.state.app.device === 'mobile'
|
return this.$store.state.app.device === 'mobile'
|
||||||
|
@ -38,7 +38,7 @@ export default {
|
||||||
return this.settings.description.find(setting => setting.key === 'Pleroma.Captcha.Kocaptcha')
|
return this.settings.description.find(setting => setting.key === 'Pleroma.Captcha.Kocaptcha')
|
||||||
},
|
},
|
||||||
kocaptchaData() {
|
kocaptchaData() {
|
||||||
return this.settings.settings['Pleroma.Captcha.Kocaptcha']
|
return this.settings.settings.pleroma['Pleroma.Captcha.Kocaptcha']
|
||||||
},
|
},
|
||||||
labelWidth() {
|
labelWidth() {
|
||||||
return this.isMobile ? '100px' : '240px'
|
return this.isMobile ? '100px' : '240px'
|
||||||
|
|
Loading…
Reference in a new issue