diff --git a/CHANGELOG.md b/CHANGELOG.md index 276a22368de78883729b4244c68922af62c66c11..1e672e1fb4bbcc3f1a7b9463647fbc8cacbf0c1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [Unreleased] +## [1.1.0] - 2019-09-15 ### Added - add ability to configure new settings (UploadS3 bucket namespace, Rate limit for Activity pub routes, Email notifications settings, MRF Vocabulary, user bio and name length and others) +- add ability to disable certain features (settings/reports) - add sign in via PleromaFE ### Changed diff --git a/README.md b/README.md index be1dc34a0922d38eeac6a30f03a56f930325e73d..1511d32b7a100d6943854b69abf9ec2da657afa4 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,20 @@ Admin UI for pleroma instance owners +## Usage + +### Development + +To run AdminFE locally execute `yarn dev` + +### Build + +To compile everything for production run `yarn build:prod`. + +#### Disabling features + +You can disable certain AdminFE features, like reports or settings by modifying `config/prod.env.js` env variable `DISABLED_FEATURES`, e.g. if you want to compile AdminFE without "Setting" you'll need to set it to: `DISABLED_FEATURES: '["settings"]'`. + ## Changelog Detailed changes for each release are documented in the [CHANGELOG](./CHANGELOG.md). diff --git a/config/dev.env.js b/config/dev.env.js index 6704d2985798d6d5a0518a2c229143affd24abcb..a9a3edd746fe8743a2fb56478a8aeca7e7f17e45 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -1,5 +1,6 @@ module.exports = { NODE_ENV: '"development"', ENV_CONFIG: '"dev"', + DISABLED_FEATURES: '[""]', ASSETS_PUBLIC_PATH: '/' } diff --git a/config/prod.env.js b/config/prod.env.js index e8a2016f188302566af9febeb434539eed981277..7acb93a2c9a33a888bf46a47cc3cf67ee8e31401 100644 --- a/config/prod.env.js +++ b/config/prod.env.js @@ -2,5 +2,6 @@ module.exports = { NODE_ENV: '"production"', ENV_CONFIG: '"prod"', BASE_API: '"https://api-prod"', + DISABLED_FEATURES: '[""]', ASSETS_PUBLIC_PATH: '/pleroma/admin/' } diff --git a/src/router/index.js b/src/router/index.js index 7ffbb61c2fa5b92ed0191c1070d1dfe2c9562414..90db3fd3e2c76d0aa05508dfe5aaf7cfc77cd918 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -6,6 +6,35 @@ Vue.use(Router) /* Layout */ import Layout from '@/views/layout/Layout' +const disabledFeatures = process.env.DISABLED_FEATURES || [] +const settingsDisabled = disabledFeatures.includes('settings') +const settings = { + path: '/settings', + component: Layout, + children: [ + { + path: 'index', + component: () => import('@/views/settings/index'), + name: 'Settings', + meta: { title: 'settings', icon: 'settings', noCache: true } + } + ] +} + +const reportsDisabled = disabledFeatures.includes('reports') +const reports = { + path: '/reports', + component: Layout, + children: [ + { + path: 'index', + component: () => import('@/views/reports/index'), + name: 'Reports', + meta: { title: 'reports', icon: 'documentation', noCache: true } + } + ] +} + export const constantRouterMap = [ { path: '/redirect', @@ -69,30 +98,8 @@ export const asyncRouterMap = [ } ] }, - { - path: '/reports', - component: Layout, - children: [ - { - path: 'index', - component: () => import('@/views/reports/index'), - name: 'Reports', - meta: { title: 'reports', icon: 'documentation', noCache: true } - } - ] - }, - { - path: '/settings', - component: Layout, - children: [ - { - path: 'index', - component: () => import('@/views/settings/index'), - name: 'Settings', - meta: { title: 'settings', icon: 'settings', noCache: true } - } - ] - }, + ...(settingsDisabled ? [] : [settings]), + ...(reportsDisabled ? [] : [reports]), { path: '/users/:id', component: Layout,