nextcloud/dist/encryption-settings_admin.mjs

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

3 lines
7.3 KiB
JavaScript
Raw Normal View History

import{f as k,q as x,s as H,o as m,g as f,u as e,w as c,j as g,t as w,r as i,v as A,c as P,h as p,e as h,H as q,z as K,p as T,F as j,b as z,k as D}from"./runtime-dom.esm-bundler-DIF-dmiV.chunk.mjs";import{a as F,l as I}from"./index-Ma7sfat2.chunk.mjs";import{t as o}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import"./PencilOutline-CaufIfvV.chunk.mjs";import{g as S}from"./createElementId-DhjFt1I9-DmxdOxki.chunk.mjs";import"./index-BJZCBgSE.chunk.mjs";import"./NcBreadcrumbs-5gl8Syfa-_CkkmbDD.chunk.mjs";import"./NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-DCYCyTiK.chunk.mjs";import{w as M}from"./NcModal-DHryP_87-DTKTujA6.chunk.mjs";import"./NcAvatar-C9d7Wrc8-DQEQ3PqU.chunk.mjs";import"./NcContent-O-bMKi-3-DtmBDm0W.chunk.mjs";import{N}from"./autolink-U5pBzLgI-DPNCkNxB.chunk.mjs";import"./Web-D7kU0XCu.chunk.mjs";import"./index-Bndk0DrU.chunk.mjs";import{N as B}from"./NcCheckboxRadioSwitch-BMsPx74L-CnVoVoz9.chunk.mjs";import"./Plus-fUY_fiSE.chunk.mjs";import"./NcColorPicker-DDHxR-iN-BOhWUwld.chunk.mjs";import"./TrayArrowDown-CSxQ3T_x.chunk.mjs";import"./index-BIuNq36J.chunk.mjs";import"./NcSelect-DLheQ2yp-C6fHgfXd.chunk.mjs";import"./NcEmojiPicker-Djc9a0gw-Cs_klLi0.chunk.mjs";import"./NcEmptyContent-B8-90BSI-1y2HcWGh.chunk.mjs";import"./NcRichText-DJlaHs_Q-5ZQTmfxg.chunk.mjs";/* empty css */import"./NcInputField-o5OFv3z6-vgXJNqqQ.chunk.mjs";import{N as E}from"./mdi-LZKofHvu.chunk.mjs";import{N as V}from"./NcPasswordField-uaMO2pdt-3LVTs_hE.chunk.mjs";import{c as R}from"./index-D0gj0nne.chunk.mjs";import"./TrashCanOutline-B5JNH7nQ.chunk.mjs";import"./index-DmA6R0rP.chunk.mjs";import{N as $}from"./ContentCopy-FlPcmQnb.chunk.mjs";import"./NcUserBubble-vOAXLHB5-BLt6cX5g.chunk.mjs";import"./NcUserStatusIcon-XiwrgeCm-CnAxKXWQ.chunk.mjs";import"./colors-BHGKZFDI-mDrpd0b8.chunk.mjs";import{d as O}from"./index-C1xmmKTZ-D5oZDAAj.chunk.mjs";import{N as U,l as C,I as G}from"./types-D2N8JdWQ.chunk.mjs";import"./index-sH3U_332.chunk.mjs";const J=k({__name:"SettingsAdminHomeStorage",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(b){const a=x(b,"modelValue"),s=i(!1);return H(a,()=>{s.value=!0}),M(a,async(t,n)=>{if(t===n){s.value=!1;return}try{await R.post(S("/apps/encryption/ajax/setEncryptHomeStorage"),{encryptHomeStorage:t})}finally{s.value=!1}},{debounce:800}),(t,n)=>(m(),f(e(B),{modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=r=>a.value=r),loading:s.value,description:e(o)("encryption","Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted"),type:"switch"},{default:c(()=>[g(w(e(o)("encryption","Encrypt the home storage")),1)]),_:1},8,["modelValue","loading","description"]))}}),L=k({__name:"SettingsAdminRecoveryKey",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(b){const a=x(b,"modelValue"),s=A("form"),t=i(!1),n=i(!1),r=i(""),l=i(""),v=K(()=>r.value===l.value);async function _(){if(!t.value&&v.value){n.value=!1,t.value=!0;try{const{data:d}=await R.post(S("/apps/encryption/ajax/adminRecovery"),{adminEnableRecovery:!a.value,recoveryPassword:r.value,confirmPassword:l.value});a.value=!a.value,r.value=l.value="",s.value?.reset(),d.data.message&&O(d.data.message)}catch(d){n.value=!0,C.error("Failed to update recovery key settings",{error:d})}finally{t.value=!1}}}return(d,u)=>(m(),P("form",{ref:"form",onSubmit:q(_,["prevent"])},[p(e(U),{label:a.value?e(o)("encryption","Disable recovery key"):e(o)("encryption","Enable recovery key"),description:e(o)("encryption","The recovery key is an additional encryption key used to encrypt files. It is used to recover files from an account if the password is forgotten.")},{default:c(()=>[p(e(V),{modelValue:r.value,"onUpdate:modelValue":u[0]||(u[0]=y=>r.value=y),required:"",name:"password",label:e(o)("encryption","Recovery key password")},null,8,["modelValue","label"]),p(e(V),{modelValue:l.value,"onUpdate:modelValue":u[1]||(u[1]=y=>l.value=y),required:"",name:"confirmPassword",error
//# sourceMappingURL=encryption-settings_admin.mjs.map