diff --git a/src/api/settings.js b/src/api/settings.js index c37c0931..87bbd9cf 100644 --- a/src/api/settings.js +++ b/src/api/settings.js @@ -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`, diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 8f3c423c..df7b0e88 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -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) diff --git a/src/utils/tabs.js b/src/utils/tabs.js new file mode 100644 index 00000000..35b24b76 --- /dev/null +++ b/src/utils/tabs.js @@ -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' } +]