2018-04-01 05:00:58 +02:00
|
|
|
<template>
|
2018-04-18 01:18:50 +02:00
|
|
|
<div id="general" v-loading="loading">
|
2018-08-10 17:40:06 +02:00
|
|
|
<h2>{{ $t('preferences.general.title') }}</h2>
|
2018-09-21 01:39:27 +02:00
|
|
|
<div class="sounds section">
|
|
|
|
<h3>{{ $t('preferences.general.sounds.title') }}</h3>
|
|
|
|
<p class="description">{{ $t('preferences.general.sounds.description') }}</p>
|
|
|
|
<div class="selection">
|
|
|
|
<span class="value">
|
|
|
|
<el-switch
|
|
|
|
v-model="sound_fav_rb"
|
|
|
|
active-color="#13ce66">
|
|
|
|
</el-switch>
|
|
|
|
</span>
|
|
|
|
<span class="title">{{ $t('preferences.general.sounds.fav_rb') }}</span>
|
|
|
|
</div>
|
|
|
|
<div class="selection">
|
|
|
|
<span class="value">
|
|
|
|
<el-switch
|
|
|
|
v-model="sound_toot"
|
|
|
|
active-color="#13ce66">
|
|
|
|
</el-switch>
|
|
|
|
</span>
|
|
|
|
<span class="title">{{ $t('preferences.general.sounds.toot') }}</span>
|
|
|
|
</div>
|
2018-04-07 15:40:57 +02:00
|
|
|
</div>
|
2018-04-01 05:00:58 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-04-07 15:40:57 +02:00
|
|
|
import { mapState } from 'vuex'
|
|
|
|
|
2018-04-01 05:00:58 +02:00
|
|
|
export default {
|
2018-04-07 15:40:57 +02:00
|
|
|
name: 'general',
|
|
|
|
computed: {
|
|
|
|
...mapState({
|
2018-09-20 17:16:10 +02:00
|
|
|
loading: state => state.Preferences.General.loading
|
2018-04-07 15:40:57 +02:00
|
|
|
}),
|
|
|
|
sound_fav_rb: {
|
|
|
|
get () {
|
|
|
|
return this.$store.state.Preferences.General.general.sound.fav_rb
|
|
|
|
},
|
|
|
|
set (value) {
|
|
|
|
this.$store.dispatch('Preferences/General/updateSound', {
|
|
|
|
fav_rb: value
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
sound_toot: {
|
|
|
|
get () {
|
|
|
|
return this.$store.state.Preferences.General.general.sound.toot
|
|
|
|
},
|
|
|
|
set (value) {
|
|
|
|
this.$store.dispatch('Preferences/General/updateSound', {
|
|
|
|
toot: value
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
created () {
|
|
|
|
this.$store.dispatch('Preferences/General/loadGeneral')
|
|
|
|
.catch(() => {
|
|
|
|
this.$message({
|
2018-08-13 08:27:53 +02:00
|
|
|
message: this.$t('message.preferences_load_error'),
|
2018-04-07 15:40:57 +02:00
|
|
|
type: 'error'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
2018-04-01 05:00:58 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2018-04-14 09:24:56 +02:00
|
|
|
#general {
|
2018-09-21 01:39:27 +02:00
|
|
|
.description {
|
|
|
|
margin: 24px 0 20px;
|
2018-08-01 16:09:36 +02:00
|
|
|
}
|
2018-04-18 16:35:35 +02:00
|
|
|
|
2018-09-21 01:39:27 +02:00
|
|
|
.section {
|
|
|
|
margin-bottom: 48px;
|
2018-08-01 16:09:36 +02:00
|
|
|
}
|
2018-04-18 16:35:35 +02:00
|
|
|
|
2018-09-21 01:39:27 +02:00
|
|
|
.selection {
|
|
|
|
margin: 12px 0;
|
2018-04-07 15:40:57 +02:00
|
|
|
|
2018-09-21 01:39:27 +02:00
|
|
|
.title {
|
|
|
|
margin-left: 12px;
|
|
|
|
font-weight: 800;
|
|
|
|
}
|
2018-04-07 15:40:57 +02:00
|
|
|
}
|
|
|
|
}
|
2018-04-01 05:00:58 +02:00
|
|
|
</style>
|