From 0bc5cf9f6b585be2a9d2115005bb2a24a3ce92c9 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Sat, 11 Jul 2020 21:53:23 +0300 Subject: [PATCH] Add new settings to the search --- src/views/settings/components/tabs.js | 163 +++++++++++++------------- src/views/settings/index.vue | 2 +- 2 files changed, 84 insertions(+), 81 deletions(-) diff --git a/src/views/settings/components/tabs.js b/src/views/settings/components/tabs.js index 7190dddd..68b01093 100644 --- a/src/views/settings/components/tabs.js +++ b/src/views/settings/components/tabs.js @@ -1,82 +1,85 @@ -export const tabs = { - 'activity-pub': { - label: 'settings.activityPub', - settings: [':activitypub', ':user'] - }, - 'authentication': { - label: 'settings.auth', - settings: [':auth', ':ldap', ':oauth2', 'Pleroma.Web.Auth.Authenticator'] - }, - 'auto-linker': { - label: 'settings.autoLinker', - settings: [':opts'] - }, - 'esshd': { - label: 'settings.esshd', - settings: [':esshd'] - }, - 'captcha': { - label: 'settings.captcha', - settings: ['Pleroma.Captcha', 'Pleroma.Captcha.Kocaptcha'] - }, - 'frontend': { - label: 'settings.frontend', - settings: [':assets', ':chat', ':emoji', ':frontend_configurations', ':markup', ':static_fe'] - }, - 'gopher': { - label: 'settings.gopher', - settings: [':gopher'] - }, - 'http': { - label: 'settings.http', - settings: [':cors_plug', ':http', ':http_security', ':web_cache_ttl'] - }, - 'instance': { - label: 'settings.instance', - settings: [':admin_token', ':instance', ':manifest', 'Pleroma.User', 'Pleroma.ScheduledActivity', ':uri_schemes', ':feed', ':streamer'] - }, - 'job-queue': { - label: 'settings.jobQueue', - settings: ['Pleroma.ActivityExpiration', 'Oban', ':workers'] - }, - 'logger': { - label: 'settings.logger', - settings: [':console', ':ex_syslogger', ':quack', ':logger'] - }, - 'mailer': { - label: 'settings.mailer', - settings: [':email_notifications', 'Pleroma.Emails.Mailer', 'Pleroma.Emails.UserEmail', ':swoosh', 'Pleroma.Emails.NewUsersDigestEmail'] - }, - 'media-proxy': { - label: 'settings.mediaProxy', - settings: [':media_proxy'] - }, - 'metadata': { - label: 'settings.metadata', - settings: ['Pleroma.Web.Metadata', ':rich_media'] - }, - 'mrf': { - label: 'settings.mrf', - settings: [':mrf_simple', ':mrf_rejectnonpublic', ':mrf_hellthread', ':mrf_keyword', ':mrf_subchain', ':mrf_mention', ':mrf_normalize_markup', ':mrf_vocabulary', ':mrf_object_age', ':modules'] - }, - 'rate-limiters': { - label: 'settings.rateLimiters', - settings: [':rate_limit'] - }, - 'relays': { - label: 'settings.relays', - settings: ['relays'] - }, - 'web-push': { - label: 'settings.webPush', - settings: [':vapid_details'] - }, - 'upload': { - label: 'settings.upload', - settings: ['Pleroma.Upload.Filter.AnonymizeFilename', 'Pleroma.Upload.Filter.Mogrify', 'Pleroma.Uploaders.S3', 'Pleroma.Uploaders.Local', 'Pleroma.Upload'] - }, - 'other': { - label: 'settings.other', - settings: [':mime', 'Pleroma.Plugs.RemoteIp'] + +export const tabs = description => { + return { + 'activity-pub': { + label: 'settings.activityPub', + settings: [':activitypub', ':user'] + }, + 'authentication': { + label: 'settings.auth', + settings: [':auth', ':ldap', ':oauth2', 'Pleroma.Web.Auth.Authenticator'] + }, + 'auto-linker': { + label: 'settings.autoLinker', + settings: [':opts'] + }, + 'esshd': { + label: 'settings.esshd', + settings: [':esshd'] + }, + 'captcha': { + label: 'settings.captcha', + settings: ['Pleroma.Captcha', 'Pleroma.Captcha.Kocaptcha'] + }, + 'frontend': { + label: 'settings.frontend', + settings: [':assets', ':chat', ':emoji', ':frontend_configurations', ':markup', ':static_fe'] + }, + 'gopher': { + label: 'settings.gopher', + settings: [':gopher'] + }, + 'http': { + label: 'settings.http', + settings: [':cors_plug', ':http', ':http_security', ':web_cache_ttl'] + }, + 'instance': { + label: 'settings.instance', + settings: [':admin_token', ':instance', ':manifest', 'Pleroma.User', 'Pleroma.ScheduledActivity', ':uri_schemes', ':feed', ':streamer'] + }, + 'job-queue': { + label: 'settings.jobQueue', + settings: ['Pleroma.ActivityExpiration', 'Oban', ':workers'] + }, + 'logger': { + label: 'settings.logger', + settings: [':console', ':ex_syslogger', ':quack', ':logger'] + }, + 'mailer': { + label: 'settings.mailer', + settings: [':email_notifications', 'Pleroma.Emails.Mailer', 'Pleroma.Emails.UserEmail', ':swoosh', 'Pleroma.Emails.NewUsersDigestEmail'] + }, + 'media-proxy': { + label: 'settings.mediaProxy', + settings: [':media_proxy', 'Pleroma.Web.MediaProxy.Invalidation.Http', 'Pleroma.Web.MediaProxy.Invalidation.Script'] + }, + 'metadata': { + label: 'settings.metadata', + settings: ['Pleroma.Web.Metadata', ':rich_media'] + }, + 'mrf': { + label: 'settings.mrf', + settings: description.filter(el => el.tab === 'mrf').map(setting => setting.key) + }, + 'rate-limiters': { + label: 'settings.rateLimiters', + settings: [':rate_limit'] + }, + 'relays': { + label: 'settings.relays', + settings: ['relays'] + }, + 'web-push': { + label: 'settings.webPush', + settings: [':vapid_details'] + }, + 'upload': { + label: 'settings.upload', + settings: ['Pleroma.Upload.Filter.AnonymizeFilename', 'Pleroma.Upload.Filter.Mogrify', 'Pleroma.Uploaders.S3', 'Pleroma.Uploaders.Local', 'Pleroma.Upload', ':s3'] + }, + 'other': { + label: 'settings.other', + settings: [':mime', 'Pleroma.Plugs.RemoteIp'] + } } } diff --git a/src/views/settings/index.vue b/src/views/settings/index.vue index 6f02a451..7d47c67b 100644 --- a/src/views/settings/index.vue +++ b/src/views/settings/index.vue @@ -200,7 +200,7 @@ export default { return this.$store.state.settings.searchData }, tabs() { - return tabs + return tabs(this.$store.state.settings.description) } }, mounted: function() {