From e6d1489a9a28ca38ba4859be84bb306152baed4a Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Sat, 30 Jan 2021 02:36:59 +0300 Subject: [PATCH] Rename paths to settings tabs --- src/router/index.js | 6 +-- src/store/modules/settings.js | 42 +++++++++---------- src/views/layout/components/Sidebar/index.vue | 6 +-- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index bead7d81..5becbc9e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -10,10 +10,10 @@ const disabledFeatures = process.env.DISABLED_FEATURES || [] const settingsDisabled = disabledFeatures.includes('settings') const settingsChildren = () => { return localStorage.getItem('settingsTabs') - ? JSON.parse(localStorage.getItem('settingsTabs')).map(({ label, value }) => { + ? JSON.parse(localStorage.getItem('settingsTabs')).map(({ label, path }) => { return { - path: value, - component: () => import(`@/views/settings/components/${label}`), + path, + component: () => import(`@/views/settings`), name: label, meta: { title: label } } diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 8b2e8872..148e5c71 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -104,27 +104,27 @@ const settings = { const response = await fetchSettings(getters.authHost, getters.token) const realResponse = { ...response, tabs: [ - { label: 'ActivityPub', value: 'activityPub' }, - { label: 'Authentication', value: 'auth' }, - { label: 'Captcha', value: 'captcha' }, - { label: 'BBS / SSH access', value: 'esshd' }, - { label: 'Emoji', value: 'emoji' }, - { label: 'Frontend', value: 'frontend' }, - { label: 'Gopher', value: 'gopher' }, - { label: 'HTTP', value: 'http' }, - { label: 'Instance', value: 'instance' }, - { label: 'Job queue', value: 'jobQueue' }, - { label: 'Link Formatter', value: 'linkFormatter' }, - { label: 'Logger', value: 'logger' }, - { label: 'Mailer', value: 'mailer' }, - { label: 'Media Proxy', value: 'mediaProxy' }, - { label: 'Metadata', value: 'metadata' }, - { label: 'MRF', value: 'mrf' }, - { label: 'Rate limiters', value: 'rateLimiters' }, - { label: 'Relays', value: 'relays' }, - { label: 'Web push encryption', value: 'webPush' }, - { label: 'Upload', value: 'upload' }, - { label: 'Other', value: 'other' } + { label: 'ActivityPub', path: 'activity-pub' }, + { label: 'Authentication', path: 'authentication' }, + { label: 'Captcha', path: 'captcha' }, + { label: 'BBS / SSH access', path: 'esshd' }, + { label: 'Emoji', path: 'emoji' }, + { label: 'Frontend', path: 'frontend' }, + { label: 'Gopher', path: 'gopher' }, + { label: 'HTTP', path: 'http' }, + { label: 'Instance', path: 'instance' }, + { label: 'Job queue', path: 'job-queue' }, + { label: 'Link Formatter', path: 'link-formatter' }, + { label: 'Logger', path: 'logger' }, + { label: 'Mailer', path: 'mailer' }, + { label: 'Media Proxy', path: 'media-proxy' }, + { label: 'Metadata', path: 'metadata' }, + { label: 'MRF', path: 'mrf' }, + { label: 'Rate limiters', path: 'rate-limiters' }, + { label: 'Relays', path: 'relays' }, + { label: 'Web push encryption', path: 'web-push' }, + { label: 'Upload', path: 'upload' }, + { label: 'Other', path: 'other' } ] } const description = await fetchDescription(getters.authHost, getters.token) diff --git a/src/views/layout/components/Sidebar/index.vue b/src/views/layout/components/Sidebar/index.vue index c0e140dd..85ec993a 100644 --- a/src/views/layout/components/Sidebar/index.vue +++ b/src/views/layout/components/Sidebar/index.vue @@ -60,10 +60,10 @@ export default { const menuItems = this.tabs localStorage.setItem('settingsTabs', JSON.stringify(menuItems)) - menuItems.forEach(({ label, value }) => { + menuItems.forEach(({ label, path }) => { router.addRoute('Settings', { - path: value, - component: () => import(`@/views/settings/components/${label}`), + path, + component: () => import(`@/views/settings`), name: label, meta: { title: label } })