-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Expand file tree
/
Copy pathSettingsAdmin.vue
More file actions
40 lines (35 loc) · 1.63 KB
/
Copy pathSettingsAdmin.vue
File metadata and controls
40 lines (35 loc) · 1.63 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
39
40
<!--
- SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<script setup lang="ts">
import { loadState } from '@nextcloud/initial-state'
import { t } from '@nextcloud/l10n'
import { NcNoteCard, NcSettingsSection } from '@nextcloud/vue'
import { ref } from 'vue'
import SettingsAdminHomeStorage from '../components/SettingsAdminHomeStorage.vue'
import SettingsAdminRecoveryKey from '../components/SettingsAdminRecoveryKey.vue'
import SettingsAdminRecoveryKeyChange from '../components/SettingsAdminRecoveryKeyChange.vue'
import { InitStatus } from '../utils/types.ts'
const adminSettings = loadState<{
recoveryEnabled: boolean
masterKeyEnabled: boolean
encryptHomeStorage: boolean
initStatus: typeof InitStatus[keyof typeof InitStatus]
}>('encryption', 'adminSettings')
const encryptHomeStorage = ref(adminSettings.encryptHomeStorage!)
const recoveryEnabled = ref(adminSettings.recoveryEnabled!)
</script>
<template>
<NcSettingsSection :name="t('encryption', 'Default encryption module')">
<NcNoteCard v-if="adminSettings.initStatus === InitStatus.NotInitialized && !adminSettings.masterKeyEnabled" type="warning">
{{ t('encryption', 'Encryption app is enabled but your keys are not initialized, please log-out and log-in again') }}
</NcNoteCard>
<template v-else>
<SettingsAdminHomeStorage v-model="encryptHomeStorage" />
<br>
<SettingsAdminRecoveryKey v-if="!adminSettings.masterKeyEnabled" v-model="recoveryEnabled" />
<SettingsAdminRecoveryKeyChange v-if="!adminSettings.masterKeyEnabled && recoveryEnabled" />
</template>
</NcSettingsSection>
</template>