Support new menu if BE does not return tabs
This commit is contained in:
parent
d3929fc008
commit
4d7a07815a
3 changed files with 35 additions and 3 deletions
|
@ -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)
|
||||
|
|
22
src/utils/tabs.js
Normal file
22
src/utils/tabs.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
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' }
|
||||
]
|
Loading…
Reference in a new issue