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

Support new menu if BE does not return tabs

parent d3929fc0
No related branches found
No related tags found
1 merge request!195Move Settings tab navigation to the main sidebar menu
Pipeline #35610 passed
This commit is part of merge request !195. Comments created here will be created in the context of that merge request.
......@@ -12,6 +12,15 @@ export async function deleteInstanceDocument(name, authHost, token) {
}
export async function fetchDescription(authHost, token) {
return await request({
baseURL: baseName(authHost),
url: `/api/v1/pleroma/admin/config/descriptions`,
method: 'get',
headers: authHeaders(token)
})
}
export async function fetchDescription2(authHost, token) {
return await request({
baseURL: baseName(authHost),
url: `/api/v2/pleroma/admin/config/descriptions`,
......
......@@ -7,6 +7,7 @@ import {
updateInstanceDocument,
updateSettings } from '@/api/settings'
import { formSearchObject, parseNonTuples, parseTuples, valueHasTuples, wrapUpdatedSettings } from './normalizers'
import { tabs } from '../../utils/tabs'
import _ from 'lodash'
const settings = {
......@@ -105,10 +106,10 @@ const settings = {
commit('SET_SETTINGS', settings.data.configs)
const { data } = await fetchDescription(getters.authHost, getters.token)
commit('SET_DESCRIPTION', data.descriptions)
const searchObject = formSearchObject(data.descriptions)
commit('SET_DESCRIPTION', data)
const searchObject = formSearchObject(data)
commit('SET_SEARCH', searchObject)
commit('SET_TABS', data.tabs)
commit('SET_TABS', tabs)
} catch (_e) {
commit('TOGGLE_TABS', true)
commit('SET_LOADING', false)
......
export const tabs = [
{ label: 'ActivityPub', path: 'activity-pub', tab: ':activity_pub' },
{ label: 'Authentication', path: 'authentication', tab: ':authentication' },
{ label: 'Captcha', path: 'captcha', tab: ':captcha' },
{ label: 'BBS / SSH access', path: 'esshd', tab: ':esshd' },
{ label: 'Emoji', path: 'emoji', tab: ':emoji' },
{ label: 'Frontend', path: 'frontend', tab: ':frontend' },
{ label: 'Gopher', path: 'gopher', tab: ':gopher' },
{ label: 'HTTP', path: 'http', tab: ':http' },
{ label: 'Instance', path: 'instance', tab: ':instance' },
{ label: 'Job queue', path: 'job-queue', tab: ':job_queue' },
{ label: 'Link Formatter', path: 'link-formatter', tab: ':link_formatter' },
{ label: 'Logger', path: 'logger', tab: ':logger' },
{ label: 'Mailer', path: 'mailer', tab: ':mailer' },
{ label: 'Media Proxy', path: 'media-proxy', tab: ':media_proxy' },
{ label: 'Metadata', path: 'metadata', tab: ':metadata' },
{ label: 'MRF', path: 'mrf', tab: ':mrf' },
{ label: 'Rate limiters', path: 'rate-limiters', tab: ':rate_limiters' },
{ label: 'Web push encryption', path: 'web-push', tab: ':web_push' },
{ label: 'Upload', path: 'upload', tab: ':upload' },
{ label: 'Other', path: 'other', tab: ':other' }
]
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