WIP
This commit is contained in:
parent
5bdf341560
commit
35a3d59235
12 changed files with 80 additions and 65 deletions
|
|
@ -172,6 +172,7 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
|
|||
})
|
||||
}
|
||||
}
|
||||
console.log(config)
|
||||
|
||||
const copyInstancePrefOption = (path) => {
|
||||
if (get(config, path) !== undefined) {
|
||||
|
|
@ -277,14 +278,26 @@ const getNodeInfo = async ({ store }) => {
|
|||
const data = await res.json()
|
||||
const metadata = data.metadata
|
||||
const features = metadata.features
|
||||
|
||||
useInstanceStore().set({
|
||||
path: 'name',
|
||||
path: 'localBubbleInstances',
|
||||
value: metadata.localBubbleInstances ?? [],
|
||||
})
|
||||
|
||||
useInstanceStore().set({
|
||||
path: 'instanceIdentity.name',
|
||||
value: metadata.nodeName,
|
||||
})
|
||||
|
||||
useInstanceStore().set({
|
||||
path: 'registrationOpen',
|
||||
value: data.openRegistrations,
|
||||
})
|
||||
useInstanceStore().set({
|
||||
path: 'restrictedNicknames',
|
||||
value: metadata.restrictedNicknames,
|
||||
})
|
||||
|
||||
useInstanceStore().set({
|
||||
path: 'featureSet.mediaProxyAvailable',
|
||||
value: features.includes('media_proxy'),
|
||||
|
|
@ -323,10 +336,6 @@ const getNodeInfo = async ({ store }) => {
|
|||
path: 'featureSet.editingAvailable',
|
||||
value: features.includes('editing'),
|
||||
})
|
||||
useInstanceStore().set({
|
||||
path: 'pollLimits',
|
||||
value: metadata.pollLimits,
|
||||
})
|
||||
useInstanceStore().set({
|
||||
path: 'featureSet.mailerEnabled',
|
||||
value: metadata.mailerEnabled,
|
||||
|
|
@ -344,35 +353,34 @@ const getNodeInfo = async ({ store }) => {
|
|||
value: features.includes('pleroma:block_expiration'),
|
||||
})
|
||||
useInstanceStore().set({
|
||||
path: 'featureSet.localBubbleInstances',
|
||||
value: metadata.localBubbleInstances ?? [],
|
||||
path: 'featureSet.localBubble',
|
||||
value: Array.isArray(metadata.localBubbleInstances),
|
||||
})
|
||||
|
||||
const uploadLimits = metadata.uploadLimits
|
||||
useInstanceStore().set({
|
||||
path: 'uploadlimit',
|
||||
path: 'limits.uploadlimit',
|
||||
value: parseInt(uploadLimits.general),
|
||||
})
|
||||
useInstanceStore().set({
|
||||
path: 'avatarlimit',
|
||||
path: 'limits.avatarlimit',
|
||||
value: parseInt(uploadLimits.avatar),
|
||||
})
|
||||
useInstanceStore().set({
|
||||
path: 'backgroundlimit',
|
||||
path: 'limits.backgroundlimit',
|
||||
value: parseInt(uploadLimits.background),
|
||||
})
|
||||
useInstanceStore().set({
|
||||
path: 'bannerlimit',
|
||||
path: 'limits.bannerlimit',
|
||||
value: parseInt(uploadLimits.banner),
|
||||
})
|
||||
useInstanceStore().set({
|
||||
path: 'fieldsLimits',
|
||||
path: 'limits.fieldsLimits',
|
||||
value: metadata.fieldsLimits,
|
||||
})
|
||||
|
||||
useInstanceStore().set({
|
||||
path: 'restrictedNicknames',
|
||||
value: metadata.restrictedNicknames,
|
||||
path: 'limits.pollLimits',
|
||||
value: metadata.pollLimits,
|
||||
})
|
||||
useInstanceStore().set({
|
||||
path: 'featureSet.postFormats',
|
||||
|
|
@ -389,6 +397,8 @@ const getNodeInfo = async ({ store }) => {
|
|||
value: suggestions.web,
|
||||
})
|
||||
|
||||
//
|
||||
|
||||
const software = data.software
|
||||
useInstanceStore().set({
|
||||
path: 'backendVersion',
|
||||
|
|
@ -399,8 +409,7 @@ const getNodeInfo = async ({ store }) => {
|
|||
value: software.repository,
|
||||
})
|
||||
|
||||
const priv = metadata.private
|
||||
useInstanceStore().set({ path: 'private', value: priv })
|
||||
useInstanceStore().set({ path: 'private', value: metadata.private })
|
||||
|
||||
const frontendVersion = window.___pleromafe_commit_hash
|
||||
useInstanceStore().set({
|
||||
|
|
@ -422,6 +431,7 @@ const getNodeInfo = async ({ store }) => {
|
|||
path: 'federationPolicy',
|
||||
value: federation,
|
||||
})
|
||||
|
||||
useInstanceStore().set({
|
||||
path: 'federating',
|
||||
value:
|
||||
|
|
@ -542,7 +552,6 @@ const afterStoreSetup = async ({ pinia, store, storageError, i18n }) => {
|
|||
? overrides.target
|
||||
: window.location.origin
|
||||
useInstanceStore().set({ path: 'server', value: server })
|
||||
console.log('AFTER', useInstanceStore().server, server)
|
||||
|
||||
await setConfig({ store })
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue