-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathSettingsLiveView.vue
More file actions
38 lines (35 loc) · 1.19 KB
/
SettingsLiveView.vue
File metadata and controls
38 lines (35 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!--
SPDX-FileCopyrightText: 2023 Nextcloud Gmbh and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
-->
<template>
<div>
<NcNoteCard v-if="!settingsStore.enabled" type="info">
{{ t('logreader', 'Polling is disabled because server is not configured to log to file') }}
</NcNoteCard>
<NcCheckboxRadioSwitch v-model="liveLog" :disabled="!settingsStore.enabled">
{{
t('logreader', 'Polling (live view)')
}}
</NcCheckboxRadioSwitch>
</div>
</template>
<script setup lang="ts">
import { showError } from '@nextcloud/dialogs'
import { translate as t } from '@nextcloud/l10n'
import { computed } from 'vue'
import NcCheckboxRadioSwitch from '@nextcloud/vue/components/NcCheckboxRadioSwitch'
import NcNoteCard from '@nextcloud/vue/components/NcNoteCard'
import { useSettingsStore } from '../../store/settings'
import { logger } from '../../utils/logger'
const settingsStore = useSettingsStore()
const liveLog = computed({
get: () => settingsStore.enabled ? settingsStore.liveLog : false,
set: (v: boolean) => settingsStore
.setSetting('liveLog', v)
.catch((e) => {
logger.debug(e)
showError(t('logreader', 'Could not change live view setting.'))
}),
})
</script>