parent
3fe3a478b7
commit
07243e09a2
2 changed files with 30 additions and 8 deletions
|
@ -1,10 +1,13 @@
|
||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
b-modal(:title="$t('Settings')" hide-footer @hidden='$router.replace("/")' :visible='true')
|
b-modal(:title="$t('Settings')" hide-footer @hidden='$router.replace("/")' :visible='true')
|
||||||
el-form(inline)
|
h5 {{user.name}}
|
||||||
el-input(v-model="mastodon_instance" type='success')
|
el-input(v-model="mastodon_instance" @enter.native='associate')
|
||||||
span(slot='prepend') Mastodon instance
|
span(slot='prepend') {{$t('Mastodon instance')}}
|
||||||
el-button(slot='append' @click='associate' type='success') Associate
|
el-button(v-if='!user.mastodon_auth' slot='append' @click='associate' type='success') {{$t('Associate')}}
|
||||||
|
el-button(v-else slot='append' @click='deassociate' variant='success') {{$t('De-associate')}}
|
||||||
|
el-input.mt-2(v-model='password' type='password')
|
||||||
|
span(slot='prepend') {{$t('Change password')}}
|
||||||
|
el-button(slot='append' @click='change' type='success') {{$t('Change')}}
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapActions } from 'vuex'
|
import { mapState, mapActions } from 'vuex'
|
||||||
|
@ -14,10 +17,11 @@ export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
mastodon_instance: '',
|
mastodon_instance: '',
|
||||||
|
password: '',
|
||||||
user: {}
|
user: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: mapState(['oauth']),
|
computed: mapState(['oauth', 'user']),
|
||||||
async mounted () {
|
async mounted () {
|
||||||
const code = this.$route.query.code
|
const code = this.$route.query.code
|
||||||
if (code) {
|
if (code) {
|
||||||
|
@ -26,9 +30,25 @@ export default {
|
||||||
|
|
||||||
const user = await api.getUser()
|
const user = await api.getUser()
|
||||||
this.user = user
|
this.user = user
|
||||||
this.mastodon_instance = user.mastodon_instance
|
this.mastodon_instance = user.mastodon_auth.instance
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async change () {
|
||||||
|
if (!this.password) return
|
||||||
|
const user = this.user
|
||||||
|
user.password = this.password
|
||||||
|
try {
|
||||||
|
await api.updateUser(user)
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async deassociate () {
|
||||||
|
const user = this.user
|
||||||
|
user.mastodon_auth = ''
|
||||||
|
this.mastodon_instance = ''
|
||||||
|
await api.updateUser(user)
|
||||||
|
},
|
||||||
async associate () {
|
async associate () {
|
||||||
if (!this.mastodon_instance) return
|
if (!this.mastodon_instance) return
|
||||||
const url = await api.getAuthURL({instance: this.mastodon_instance})
|
const url = await api.getAuthURL({instance: this.mastodon_instance})
|
||||||
|
|
|
@ -31,9 +31,11 @@ const it = {
|
||||||
export_email_explanation: `Puoi ricevere via mail gli eventi che ti interessano [WIP]`,
|
export_email_explanation: `Puoi ricevere via mail gli eventi che ti interessano [WIP]`,
|
||||||
export_list_explanation: `Se hai un sito web e vuoi mostrare una lista di eventi, puoi usare il seguente codice [WIP]`,
|
export_list_explanation: `Se hai un sito web e vuoi mostrare una lista di eventi, puoi usare il seguente codice [WIP]`,
|
||||||
export_calendar_explanation: `Se hai un sito web e vuoi mostrare un calendario di eventi, puoi usare il seguente codice [WIP]`,
|
export_calendar_explanation: `Se hai un sito web e vuoi mostrare un calendario di eventi, puoi usare il seguente codice [WIP]`,
|
||||||
export_ical_explanation: `I computer e gli smartphone sono comunemente attrezzati con un'applicazione per gestire un calendario. A questi programmi solitamente è possibile far importare un calendario remoto.`,
|
export_ical_explanation: `I computer e gli smartphone sono comunemente attre zzati con un'applicazione per gestire un calendario. A questi programmi solitamente è possibile far importare un calendario remoto.`,
|
||||||
Poster: 'Locandina',
|
Poster: 'Locandina',
|
||||||
Settings: 'Impostazioni',
|
Settings: 'Impostazioni',
|
||||||
|
'Change password': 'Cambia password',
|
||||||
|
Change: 'Cambia',
|
||||||
Search: 'Cerca',
|
Search: 'Cerca',
|
||||||
Send: 'Invia',
|
Send: 'Invia',
|
||||||
Register: 'Registrati',
|
Register: 'Registrati',
|
||||||
|
|
Loading…
Reference in a new issue