aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/views/Settings.vue
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/src/views/Settings.vue')
-rw-r--r--apps/files/src/views/Settings.vue85
1 files changed, 79 insertions, 6 deletions
diff --git a/apps/files/src/views/Settings.vue b/apps/files/src/views/Settings.vue
index 5d2aff2f49a..e1c7d8b42bf 100644
--- a/apps/files/src/views/Settings.vue
+++ b/apps/files/src/views/Settings.vue
@@ -20,26 +20,99 @@
-
-->
<template>
- <div id="files-app-extra-settings">
- <template v-for="setting in settings">
- <Setting :key="setting.name" :el="setting.el" />
- </template>
- </div>
+ <NcAppSettingsDialog :open="open"
+ :show-navigation="true"
+ :title="t('files', 'Files settings')"
+ @update:open="onClose">
+ <!-- Settings API-->
+ <NcAppSettingsSection id="settings" :title="t('files', 'Files settings')">
+ <NcCheckboxRadioSwitch :checked.sync="show_hidden"
+ @update:checked="setConfig('show_hidden', $event)">
+ {{ t('files', 'Show hidden files') }}
+ </NcCheckboxRadioSwitch>
+ <NcCheckboxRadioSwitch :checked.sync="crop_image_previews"
+ @update:checked="setConfig('crop_image_previews', $event)">
+ {{ t('files', 'Crop image previews') }}
+ </NcCheckboxRadioSwitch>
+ </NcAppSettingsSection>
+
+ <!-- Settings API-->
+ <NcAppSettingsSection id="more-settings" :title="t('files', 'Additional settings')">
+ <template v-for="setting in settings">
+ <Setting :key="setting.name" :el="setting.el" />
+ </template>
+ </NcAppSettingsSection>
+
+ <!-- Webdav URL-->
+ <NcAppSettingsSection id="webdav" :title="t('files', 'Webdav')">
+ <NcInputField type="text" readonly="readonly" :value="webdavUrl" />
+ <em>
+ <a :href="webdavDocs" target="_blank" rel="noreferrer noopener">
+ {{ t('files', 'Use this address to access your Files via WebDAV') }} ↗
+ </a>
+ </em>
+ </NcAppSettingsSection>
+ </NcAppSettingsDialog>
</template>
<script>
-import Setting from '../components/Setting'
+import NcAppSettingsDialog from '@nextcloud/vue/dist/Components/NcAppSettingsDialog.js'
+import NcAppSettingsSection from '@nextcloud/vue/dist/Components/NcAppSettingsSection.js'
+import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
+import NcInputField from '@nextcloud/vue/dist/Components/NcInputField'
+import Setting from '../components/Setting.vue'
+
+import { generateRemoteUrl, generateUrl } from '@nextcloud/router'
+import { getCurrentUser } from '@nextcloud/auth'
+import { loadState } from '@nextcloud/initial-state'
+import { emit } from '@nextcloud/event-bus'
+import axios from '@nextcloud/axios'
+
+const userConfig = loadState('files', 'config')
export default {
name: 'Settings',
components: {
+ NcAppSettingsDialog,
+ NcAppSettingsSection,
+ NcCheckboxRadioSwitch,
+ NcInputField,
Setting,
},
+
+ props: {
+ open: {
+ type: Boolean,
+ default: false,
+ },
+ },
+
data() {
return {
+
+ ...userConfig,
+
+ // Settings API
settings: OCA.Files.Settings.settings,
+
+ // Webdav infos
+ webdavUrl: generateRemoteUrl('dav/files/' + getCurrentUser()?.uid),
+ webdavDocs: 'https://docs.nextcloud.com/server/stable/go.php?to=user-webdav',
}
},
+
+ methods: {
+ onClose() {
+ this.$emit('close')
+ },
+
+ setConfig(key, value) {
+ emit('files:config:updated', { key, value })
+ axios.post(generateUrl('/apps/files/api/v1/config/' + key), {
+ value,
+ })
+ },
+ },
}
</script>