nextcloud/dist/encryption-settings_admin.mjs.map

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

1 line
15 KiB
Text
Raw Normal View History

{"version":3,"file":"encryption-settings_admin.mjs","sources":["../build/frontend/apps/encryption/src/components/SettingsAdminHomeStorage.vue","../build/frontend/apps/encryption/src/components/SettingsAdminRecoveryKey.vue","../build/frontend/apps/encryption/src/components/SettingsAdminRecoveryKeyChange.vue","../build/frontend/apps/encryption/src/views/SettingsAdmin.vue","../build/frontend/apps/encryption/src/settings-admin.ts"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n -->\n\n<script setup lang=\"ts\">\nimport axios from '@nextcloud/axios'\nimport { t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { watchDebounced } from '@vueuse/core'\nimport { ref, watch } from 'vue'\nimport NcCheckboxRadioSwitch from '@nextcloud/vue/components/NcCheckboxRadioSwitch'\n\nconst encryptHomeStorage = defineModel<boolean>({ required: true })\nconst isSavingHomeStorageEncryption = ref(false)\n\nwatch(encryptHomeStorage, () => {\n\tisSavingHomeStorageEncryption.value = true\n})\nwatchDebounced(encryptHomeStorage, async (encryptHomeStorage, oldValue) => {\n\tif (encryptHomeStorage === oldValue) {\n\t\t// user changed their mind (likely quickly toggled), do nothing\n\t\tisSavingHomeStorageEncryption.value = false\n\t\treturn\n\t}\n\n\ttry {\n\t\tawait axios.post(\n\t\t\tgenerateUrl('/apps/encryption/ajax/setEncryptHomeStorage'),\n\t\t\t{ encryptHomeStorage },\n\t\t)\n\t} finally {\n\t\tisSavingHomeStorageEncryption.value = false\n\t}\n}, { debounce: 800 })\n</script>\n\n<template>\n\t<NcCheckboxRadioSwitch\n\t\tv-model=\"encryptHomeStorage\"\n\t\t:loading=\"isSavingHomeStorageEncryption\"\n\t\t:description=\"t('encryption', 'Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted')\"\n\t\ttype=\"switch\">\n\t\t{{ t('encryption', 'Encrypt the home storage') }}\n\t</NcCheckboxRadioSwitch>\n</template>\n","<!--\n - SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n -->\n\n<script setup lang=\"ts\">\nimport axios from '@nextcloud/axios'\nimport { showSuccess } from '@nextcloud/dialogs'\nimport { t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { computed, ref, useTemplateRef } from 'vue'\nimport NcButton from '@nextcloud/vue/components/NcButton'\nimport NcFormGroup from '@nextcloud/vue/components/NcFormGroup'\nimport NcNoteCard from '@nextcloud/vue/components/NcNoteCard'\nimport NcPasswordField from '@nextcloud/vue/components/NcPasswordField'\nimport { logger } from '../utils/logger.ts'\n\nconst recoveryEnabled = defineModel<boolean>({ required: true })\nconst formElement = useTemplateRef('form')\n\nconst isLoading = ref(false)\nconst hasError = ref(false)\n\nconst password = ref('')\nconst confirmPassword = ref('')\nconst passwordMatch = computed(() => password.value === confirmPassword.value)\n\n/**\n * Handle the form submission to enable or disable the admin recovery key\n */\nasync function onSubmit() {\n\tif (isLoading.value) {\n\t\treturn\n\t}\n\n\tif (!passwordMatch.value) {\n\t\treturn\n\t}\n\n\thasError.value = false\n\tisLoading.value = true\n\ttry {\n\t\tconst { data } = await axios.post(\n\t\t\tgenerateUrl('/apps/encryption/ajax/adminRecovery'),\n\t\t\t{\n\t\t\t\tadminEnableRecovery: !recoveryEnabled.value,\n\t\t\t\trecoveryPassword: password.value,\n\t\t\t\tconfirmPassword: confirmPassword.value,\n\t\t\t},\n\t\t)\n\t\trecoveryEnabled.value = !recoveryEnabled.value\n\t\tpassword.value = confirmPassword.value = ''\n\t\tformElement.value?.reset()\n\t\tif (data.data.message) {\n\t\t\tshowSuccess(data.data.message)\n\t\t}\n\t} catch (error) {\n\t\thasError.value = true\n\t\tlogger.error('Failed to update recovery key settings', { error })\n\t} finally {\n\t\tisLoading.value = false\n\t}\n}\n</script>\n\n<template>\n\t<form ref=\"form\" @submit.prevent=\"onSubmit\">\n\t\t<NcFormGroup\n\t\t\t:label=\"recoveryEnabled ? t('encryptio