feat: possibility to deactivate logs and saving this choice to localStorage
This commit is contained in:
@@ -24,7 +24,7 @@ import { computed } from '@vue/composition-api'
|
||||
export default {
|
||||
name: 'Logs',
|
||||
setup() {
|
||||
const messages = useLogs()
|
||||
const { messages } = useLogs()
|
||||
const logMessages = computed(() => messages.value.slice(0, 50).reverse())
|
||||
|
||||
return {
|
||||
|
||||
@@ -52,6 +52,7 @@ import { formatSingleTrack, formatAlbums, formatArtist, formatPlaylist } from '@
|
||||
import { standardizeData } from '@/data/standardize'
|
||||
import { useMainSearch } from '@/use/main-search'
|
||||
import { useSearch } from '@/use/search'
|
||||
import { useLogs } from '@/use/logs'
|
||||
|
||||
const resetObj = { data: [], next: 0, total: 0, hasLoaded: false }
|
||||
|
||||
|
||||
@@ -98,6 +98,20 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<BaseAccordion class="settings-group">
|
||||
<template #title>
|
||||
<h3 class="settings-group__header">
|
||||
<i class="material-icons">description</i>
|
||||
{{ $t('settings.logs.title') }}
|
||||
</h3>
|
||||
</template>
|
||||
|
||||
<label class="with-checkbox">
|
||||
<input v-model="areLogsActive" type="checkbox" />
|
||||
<span class="checkbox-text">{{ $t('settings.logs.areLogsActive') }}</span>
|
||||
</label>
|
||||
</BaseAccordion>
|
||||
|
||||
<BaseAccordion class="settings-group">
|
||||
<template #title>
|
||||
<h3 class="settings-group__header">
|
||||
@@ -807,12 +821,18 @@ import BaseAccordion from '@/components/globals/BaseAccordion.vue'
|
||||
import TemplateVariablesList from '@components/settings/TemplateVariablesList.vue'
|
||||
import { fetchData, postToServer } from '@/utils/api'
|
||||
import { getFormItem } from '@/utils/forms'
|
||||
import { useLogs } from '@/use/logs'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BaseAccordion,
|
||||
TemplateVariablesList
|
||||
},
|
||||
setup() {
|
||||
const { areLogsActive, saveLogsSettings } = useLogs()
|
||||
|
||||
return { areLogsActive, saveLogsSettings }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
flags,
|
||||
@@ -951,6 +971,8 @@ export default {
|
||||
localStorage.setItem('locale', newLocale)
|
||||
},
|
||||
saveSettings() {
|
||||
this.saveLogsSettings()
|
||||
|
||||
this.lastSettings = JSON.parse(JSON.stringify(this.settings))
|
||||
this.lastCredentials = JSON.parse(JSON.stringify(this.spotifyFeatures))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user