enable federation at user level
This commit is contained in:
@@ -25,7 +25,7 @@ html, body {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
.el-card {
|
.el-card {
|
||||||
max-width: 630px;
|
max-width: 660px;
|
||||||
margin: 30px auto;
|
margin: 30px auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,27 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
el-card
|
el-card
|
||||||
nuxt-link.float-right(to='/')
|
nuxt-link.float-right(to='/')
|
||||||
v-icon(name='times' color='red')
|
el-button(circle icon='el-icon-close' type='danger' size='small' plain)
|
||||||
h5 {{$t('common.settings')}}
|
h5 {{$t('common.settings')}}
|
||||||
|
hr
|
||||||
|
|
||||||
el-form(action='/api/user' method='PUT' @submit.native.prevent='change_password')
|
el-form(action='/api/user' method='PUT' @submit.native.prevent='change_password' inline label-width='200px')
|
||||||
el-form-item {{$t('settings.change_password')}}
|
|
||||||
|
el-form-item(:label="$t('settings.change_password')")
|
||||||
el-input(v-model='password' type='password')
|
el-input(v-model='password' type='password')
|
||||||
el-button(type='success' native-type='submit') {{$t('common.send')}}
|
el-button(slot='append' type='success' native-type='submit') {{$t('common.send')}}
|
||||||
|
|
||||||
|
//- allow federation
|
||||||
|
div(v-if='settings.enable_federation')
|
||||||
|
el-form-item(:label="$t('admin.enable_federation')")
|
||||||
|
el-switch(name='reg' v-model='enable_federation')
|
||||||
|
|
||||||
|
el-form-item(v-if='enable_federation' :label="$t('common.username')")
|
||||||
|
el-input(type='text' name='username' v-model='user.username' :suffix='"antani"' :readonly='user.username.length>0')
|
||||||
|
template(slot='suffix') @{{baseurl}}
|
||||||
|
//- el-button(slot='append') {{$t('common.save')}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
el-divider {{$t('settings.danger_section')}}
|
el-divider {{$t('settings.danger_section')}}
|
||||||
p {{$t('settings.remove_account')}}
|
p {{$t('settings.remove_account')}}
|
||||||
@@ -20,11 +34,11 @@ import { Message, MessageBox } from 'element-ui'
|
|||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
enable_federation: false,
|
||||||
password: '',
|
password: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
name: 'Settings',
|
name: 'Settings',
|
||||||
computed: mapState(['settings']),
|
|
||||||
head () {
|
head () {
|
||||||
return {
|
return {
|
||||||
title: `${this.settings.title} - ${this.$t('common.settings')}`
|
title: `${this.settings.title} - ${this.$t('common.settings')}`
|
||||||
@@ -35,6 +49,12 @@ export default {
|
|||||||
user.mastodon_auth = ''
|
user.mastodon_auth = ''
|
||||||
return { user }
|
return { user }
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(['settings']),
|
||||||
|
baseurl () {
|
||||||
|
return new URL(this.settings.baseurl).host
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async change_password () {
|
async change_password () {
|
||||||
if (!this.password) return
|
if (!this.password) return
|
||||||
@@ -54,6 +74,8 @@ export default {
|
|||||||
type: 'error'
|
type: 'error'
|
||||||
}).then( () => {
|
}).then( () => {
|
||||||
this.$axios.$delete('/user')
|
this.$axios.$delete('/user')
|
||||||
|
this.$auth.logout()
|
||||||
|
this.$router.replace('/')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user