nextcloud/dist/files-settings-admin.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

2 lines
21 KiB
JavaScript
Raw Normal View History

(()=>{"use strict";var t,e,n,i={31764:(t,e,n)=>{n.d(e,{A:()=>r});var i=n(71354),s=n.n(i),a=n(76314),o=n.n(a)()(s());o.push([t.id,"\n.hint[data-v-502103e2] {\n\tcolor: var(--color-text-maxcontrast);\n\tmargin-inline-start: var(--border-radius-element);\n\tmargin-block-end: 1em;\n}\n","",{version:3,sources:["webpack://./apps/files/src/views/SettingsAdmin.vue"],names:[],mappings:";AAwEA;CACA,oCAAA;CACA,iDAAA;CACA,qBAAA;AACA",sourcesContent:["\x3c!--\n - SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n--\x3e\n\n<script setup lang=\"ts\">\nimport axios from '@nextcloud/axios'\nimport { showError } from '@nextcloud/dialogs'\nimport { loadState } from '@nextcloud/initial-state'\nimport { t } from '@nextcloud/l10n'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport NcCheckboxRadioSwitch from '@nextcloud/vue/components/NcCheckboxRadioSwitch'\nimport NcSettingsSection from '@nextcloud/vue/components/NcSettingsSection'\nimport SettingsSanitizeFilenames from '../components/Settings/SettingsSanitizeFilenames.vue'\nimport { ref } from 'vue'\nimport logger from '../logger'\n\nconst {\n\tdocUrl,\n\tisRunningSanitization,\n\twindowsSupport,\n} = loadState<{ docUrl: string, isRunningSanitization: boolean, windowsSupport: boolean }>('files', 'filesCompatibilitySettings')\n\nconst description = t('files', 'Allow to restrict filenames to ensure files can be synced with all clients. By default all filenames valid on POSIX (e.g. Linux or macOS) are allowed.')\n\t+ '\\n' + t('files', 'After enabling the Windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner.')\n\nconst loading = ref(false)\nconst hasWindowsSupport = ref(windowsSupport)\n\n/**\n * Toggle the Windows filename support on the backend.\n *\n * @param enabled - The new state to be set\n */\nasync function toggleWindowsFilenameSupport(enabled: boolean) {\n\tif (loading.value) {\n\t\treturn\n\t}\n\n\ttry {\n\t\tloading.value = true\n\t\tawait axios.post(generateOcsUrl('apps/files/api/v1/filenames/windows-compatibility'), { enabled })\n\t\thasWindowsSupport.value = enabled\n\t} catch (error) {\n\t\tshowError(t('files', 'Failed to toggle Windows filename support'))\n\t\tlogger.error('Failed to toggle Windows filename support', { error })\n\t} finally {\n\t\tloading.value = false\n\t}\n}\n<\/script>\n\n<template>\n\t<NcSettingsSection :doc-url=\"docUrl\"\n\t\t:name=\"t('files', 'Files compatibility')\"\n\t\t:description=\"description\">\n\t\t<NcCheckboxRadioSwitch :model-value=\"hasWindowsSupport\"\n\t\t\t:disabled=\"isRunningSanitization\"\n\t\t\t:loading=\"loading\"\n\t\t\ttype=\"switch\"\n\t\t\t@update:model-value=\"toggleWindowsFilenameSupport\">\n\t\t\t{{ t('files', 'Enforce Windows compatibility') }}\n\t\t</NcCheckboxRadioSwitch>\n\t\t<p class=\"hint\">\n\t\t\t{{ t('files', 'This will block filenames not valid on Windows systems, like using reserved names or special characters. But this will not enforce compatibility of case sensitivity.') }}\n\t\t</p>\n\n\t\t<SettingsSanitizeFilenames v-if=\"hasWindowsSupport\" />\n\t</NcSettingsSection>\n</template>\n\n<style scoped>\n.hint {\n\tcolor: var(--color-text-maxcontrast);\n\tmargin-inline-start: var(--border-radius-element);\n\tmargin-block-end: 1em;\n}\n</style>\n"],sourceRoot:""}]);const r=o},35238:(t,e,n)=>{var i,s=n(21777),a=n(53334),o=n(85471),r=n(65043),l=n(85168),c=n(81222),d=n(63814),u=n(32073),f=n(88837),p=n(21376),m=n(16879),g=n(2645),v=n(3226),h=n(95101);!function(t){t[t.Unknown=0]="Unknown",t[t.Scheduled=1]="Scheduled",t[t.Running=2]="Running",t[t.Done=3]="Done",t[t.Error=4]="Error"}(i||(i={}));const b=(0,n(35947).YK)().setApp("files").detectUser().build(),A=(0,o.pM)({__name:"SettingsSanitizeFilenames",setup(t){const{status:e}=(0,c.C)("files","filesCompatibilitySettings"),n=(0,o.KR)(!1),s=(0,o.KR)(10),u=(0,o.KR)(e.status),f=(0,o.KR)(e.processed),A=(0,o.KR)(e.total),S=(0,o.IJ)(e.errors||{}),y=(0,o.EW)(()=>f.value>0?Math.round(100*f.value/A.value):0),w=(0,o.EW)(()=>u.value===i
//# sourceMappingURL=files-settings-admin.js.map?v=ea08c8cc6c8d475c5cef