Commit 20dc56cb authored by les's avatar les
Browse files

[feat] new enable_comments disable_gamification

parent 19ca6e8f
<template lang="pug">
div
el-divider {{$t('admin.federation')}}
el-form(inline label-width='400px')
el-form-item(:label="$t('admin.enable_federation')")
el-switch(v-model='enable_federation')
el-switch(v-model='enable_federation')
el-form-item(:label="$t('admin.enable_comments')")
el-switch(v-model='enable_comments')
el-form-item(:label="$t('admin.disable_gamification')")
el-switch(v-model='disable_gamification')
</template>
<script>
import { mapState, mapActions } from 'vuex'
......@@ -17,6 +20,14 @@ export default {
get () { return this.settings.enable_federation },
set (value) { this.setSetting({ key: 'enable_federation', value }) }
},
enable_comments: {
get () { return this.settings.enable_comments },
set (value) { this.setSetting({ key: 'enable_comments', value }) }
},
disable_gamification: {
get () { return this.settings.disable_gamification },
set (value) { this.setSetting({ key: 'disable_gamification', value }) }
},
}
}
</script>
\ No newline at end of file
......@@ -15,6 +15,7 @@ const debug = require('debug')('federation')
* ref: https://www.w3.org/TR/activitypub/#Overview
*/
router.use(cors())
router.use((req, res, next) => {
if(settingsController.settings.enable_federation) return next()
debug('Federation disabled!')
......@@ -22,7 +23,6 @@ router.use((req, res, next) => {
next(false)
})
router.use(cors())
router.use(express.json({ type: ['application/json', 'application/activity+json', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'] }))
router.get('/m/:event_id', async (req, res) => {
......
......@@ -14,7 +14,9 @@ export const state = () => ({
allow_anon_event: true,
allow_recurrent_event: true,
recurrent_event_visible: false,
enable_federation: false
enable_federation: false,
enable_comments: false,
disable_gamification: true
},
in_past: false,
filters: {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment